Skip to content

Commit

Permalink
more cleanup in error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
gares committed Jan 6, 2025
1 parent 8b62f6f commit cf09bfc
Showing 1 changed file with 33 additions and 20 deletions.
53 changes: 33 additions & 20 deletions src/parser/error_messages.txt
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ program: AFTER CONJ2 VDASH
goal: AFTER DDARROW VDASH
goal: LBRACKET AFTER DDARROW VDASH
program: AFTER DDARROW VDASH
program: EXPORTDEF AFTER AFTER ARROW VDASH

This infix operator expects a right hand side.

Expand Down Expand Up @@ -234,10 +235,16 @@ goal: LBRACKET AFTER COLON AFTER BIND VDASH
goal: AFTER DDARROW FLOAT USE_SIG
goal: LBRACKET AFTER DDARROW FLOAT USE_SIG
program: AFTER DDARROW FLOAT USE_SIG
goal: AFTER BIND VDASH
goal: LPAREN USE_SIG
program: EXPORTDEF AFTER AFTER ARROW LPAREN AFTER RPAREN VDASH
program: EXPORTDEF AFTER AFTER VDASH
program: EXPORTDEF AFTER AFTER LPAREN USE_SIG
program: EXPORTDEF AFTER AFTER LPAREN AFTER FULLSTOP
program: EXPORTDEF AFTER AFTER AFTER VDASH

Term expected, got keyword.

goal: LPAREN USE_SIG
goal: LPAREN FAMILY_TILDE VDASH

Mixfix symbol or term expected.
Expand Down Expand Up @@ -331,7 +338,6 @@ type (++) list A -> list A -> list A.
program: RULE LPAREN USE_SIG
program: RULE VDASH
program: RULE IFF AFTER VDASH
program: RULE LPAREN AFTER COLON VDASH
program: RULE AFTER VDASH
program: RULE BIND VDASH
program: RULE BIND AFTER VDASH
Expand All @@ -340,6 +346,7 @@ program: RULE PIPE FLOAT USE_SIG
program: RULE IFF VDASH
program: RULE LPAREN AFTER RTRI VDASH
program: RULE LPAREN AFTER RTRI FLOAT USE_SIG
program: RULE LPAREN AFTER USE_SIG

Malformed CHR rule declaration. Examples:
rule (match this).
Expand All @@ -359,12 +366,11 @@ accumulate foo, bar.
accumulate "foo/bar".

goal: LBRACKET AFTER AFTER RPAREN

Closing '[' with ')'.

goal: LBRACKET PIPE VDASH
goal: LBRACKET AFTER PIPE VDASH
goal: LBRACKET AFTER CONJ2 VDASH
goal: LBRACKET AFTER USE_SIG
goal: LBRACKET AFTER BIND FLOAT USE_SIG

List expected. Examples:
[ this , that | More ].
Expand Down Expand Up @@ -450,29 +456,18 @@ program: FUNC VDASH
program: FUNC AFTER VDASH
program: FUNC AFTER AFTER RPAREN
program: FUNC AFTER ARROW VDASH
program: FUNC AFTER LPAREN FUNC AFTER FULLSTOP
program: FUNC AFTER LPAREN FUNC VDASH
program: FUNC AFTER LPAREN FUNC ARROW VDASH

Predicate declaration expected. Examples:
pred append i:list A, i:list A, o:list A.
pred append i:list A i:list A o:list A.
pred mapR i:list A, i:(pred i:A, o:B), o:list B.
func map list A, (func A -> B) -> list B.

program: EXPORTDEF AFTER LPAREN USE_SIG
program: EXPORTDEF AFTER LPAREN AFTER FULLSTOP
program: EXPORTDEF AFTER AFTER ARROW VDASH
program: EXPORTDEF AFTER AFTER ARROW LPAREN AFTER RPAREN VDASH
program: EXPORTDEF AFTER AFTER VDASH
program: EXPORTDEF AFTER AFTER LPAREN USE_SIG
program: EXPORTDEF AFTER AFTER LPAREN AFTER FULLSTOP
program: EXPORTDEF AFTER AFTER AFTER VDASH
program: EXPORTDEF VDASH
program: EXPORTDEF AFTER TYPE
program: EXPORTDEF AFTER LPAREN PRED VDASH
program: EXPORTDEF AFTER AFTER LPAREN PRED IO_COLON AFTER FULLSTOP
program: EXPORTDEF AFTER LPAREN PRED IO_COLON AFTER FULLSTOP
program: EXPORTDEF AFTER LPAREN FUNC VDASH
program: EXPORTDEF AFTER LPAREN FUNC AFTER FULLSTOP
program: EXPORTDEF AFTER LPAREN FUNC ARROW VDASH
program: EXPORTDEF VDASH

Definition export directive expected (Teyjus compatibility, ignored by Elpi).
Examples:
Expand Down Expand Up @@ -546,6 +541,14 @@ sigma X Y Z\ p X, q Y Z

goal: LPAREN FLOAT COLON AFTER IO_COLON
goal: LPAREN FLOAT COLON VDASH
goal: AFTER COLON VDASH
goal: AFTER COLON AFTER RPAREN
goal: AFTER COLON AFTER BIND VDASH
goal: AFTER COLON AFTER BIND FLOAT USE_SIG
goal: LBRACKET AFTER COLON VDASH
goal: LPAREN AFTER COLON VDASH
goal: LPAREN AFTER COLON AFTER IO_COLON
goal: AFTER COLON LPAREN USE_SIG

Illformed type cast.
Examples:
Expand All @@ -556,3 +559,13 @@ lam (x : ty \ t)
program: LPAREN FLOAT COLON AFTER RPAREN VDASH

You cannot ascribe a type on the head predicate.

goal: AFTER COLON LPAREN PRED VDASH
goal: AFTER COLON AFTER LPAREN FUNC ARROW AFTER ARROW
goal: AFTER COLON LPAREN AFTER IO_COLON
goal: AFTER COLON LPAREN FUNC ARROW AFTER ARROW

Anonymous predicate declaration expected.
Examples:
(pred i:ty, o:ty)
(pred)

0 comments on commit cf09bfc

Please sign in to comment.