Skip to content

Commit 630cc11

Browse files
committed
Better diagnostic
1 parent e23306d commit 630cc11

15 files changed

Lines changed: 34 additions & 17 deletions

src/main/java/org/jamplate/glucose/spec/command/hashcapture/HashCaptureSpec.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ public Compiler getCompiler() {
7272
//throw
7373
c -> (compiler, compilation, tree) -> {
7474
throw new CompileException(
75-
"#Capture without #Endcapture closing it"
75+
"#Capture without #Endcapture closing it",
76+
tree
7677
);
7778
}
7879
);

src/main/java/org/jamplate/glucose/spec/command/hashcapture/HashEndcaptureSpec.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ public Compiler getCompiler() {
7272
//throw
7373
c -> (compiler, compilation, tree) -> {
7474
throw new CompileException(
75-
"#Endcapture without #Capture"
75+
"#Endcapture without #Capture",
76+
tree
7677
);
7778
}
7879
);

src/main/java/org/jamplate/glucose/spec/command/hashfor/HashEndforSpec.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ public Compiler getCompiler() {
7272
//throw
7373
c -> (compiler, compilation, tree) -> {
7474
throw new CompileException(
75-
"#Endfor without #For"
75+
"#Endfor without #For",
76+
tree
7677
);
7778
}
7879
);

src/main/java/org/jamplate/glucose/spec/command/hashfor/HashForSpec.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ public Compiler getCompiler() {
7373
//throw
7474
c -> (compiler, compilation, tree) -> {
7575
throw new CompileException(
76-
"#For without #Endfor closing it"
76+
"#For without #Endfor closing it",
77+
tree
7778
);
7879
}
7980
);

src/main/java/org/jamplate/glucose/spec/command/hashif/FlowIfSpec.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,8 @@ public Compiler getCompiler() {
222222
//check required subcomponent trees
223223
if (valueT == null)
224224
throw new CompileException(
225-
"Command IF/ELIF is missing some components"
225+
"Command IF/ELIF is missing some components",
226+
tree
226227
);
227228

228229
//compile the value
@@ -263,7 +264,8 @@ public Compiler getCompiler() {
263264
//check required subcomponent trees
264265
if (valueT == null)
265266
throw new CompileException(
266-
"Command IFDEF/ELIFDEF is missing some components"
267+
"Command IFDEF/ELIFDEF is missing some components",
268+
tree
267269
);
268270

269271
//def sandbox
@@ -288,7 +290,8 @@ public Compiler getCompiler() {
288290
//check required subcomponent trees
289291
if (valueT == null)
290292
throw new CompileException(
291-
"Command IFNDEF/ELIFNDEF is missing some components"
293+
"Command IFNDEF/ELIFNDEF is missing some components",
294+
tree
292295
);
293296

294297
//ndef sandbox

src/main/java/org/jamplate/glucose/spec/command/hashif/HashElifSpec.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ public Compiler getCompiler() {
7373
//throw
7474
c -> (compiler, compilation, tree) -> {
7575
throw new CompileException(
76-
"#Elif outside if flow"
76+
"#Elif outside if flow",
77+
tree
7778
);
7879
}
7980
);

src/main/java/org/jamplate/glucose/spec/command/hashif/HashElifdefSpec.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ public Compiler getCompiler() {
7272
//throw
7373
c -> (compiler, compilation, tree) -> {
7474
throw new CompileException(
75-
"#Elifdef outside if flow"
75+
"#Elifdef outside if flow",
76+
tree
7677
);
7778
}
7879
);

src/main/java/org/jamplate/glucose/spec/command/hashif/HashElifndefSpec.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ public Compiler getCompiler() {
7272
//throw
7373
c -> (compiler, compilation, tree) -> {
7474
throw new CompileException(
75-
"#Elifndef outside if flow"
75+
"#Elifndef outside if flow",
76+
tree
7677
);
7778
}
7879
);

src/main/java/org/jamplate/glucose/spec/command/hashif/HashElseSpec.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ public Compiler getCompiler() {
7272
//throw
7373
c -> (compiler, compilation, tree) -> {
7474
throw new CompileException(
75-
"#Else outside if flow"
75+
"#Else outside if flow",
76+
tree
7677
);
7778
}
7879
);

src/main/java/org/jamplate/glucose/spec/command/hashif/HashEndifSpec.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ public Compiler getCompiler() {
7272
//throw
7373
c -> (compiler, compilation, tree) -> {
7474
throw new CompileException(
75-
"#Endif without #If"
75+
"#Endif without #If",
76+
tree
7677
);
7778
}
7879
);

0 commit comments

Comments
 (0)