-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make some interpreter / reader errors a bit nicer
Previously, we produced errors like this: gap> function() 123; end; Syntax error: inside a function, statement or 'end' expected function() 123; end; ^^^ This now is slightly more helpful and reads as follows. gap> function() 123; end; Syntax error: while parsing a function: statement or 'end' expected function() 123; end; ^^^ Similar adjustments are made for loops, atomic blocks and if statements.
- Loading branch information
Showing
4 changed files
with
40 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# | ||
gap> function() 123; end; | ||
Syntax error: while parsing a function: statement or 'end' expected in stream:\ | ||
1 | ||
function() 123; end; | ||
^^^ | ||
gap> if true then 123; fi; | ||
Syntax error: while parsing an 'if' statement: statement or 'fi' expected in s\ | ||
tream:1 | ||
if true then 123; fi; | ||
^^^ | ||
gap> while true do 123; od; | ||
Syntax error: while parsing a 'while' loop: statement or 'od' expected in stre\ | ||
am:1 | ||
while true do 123; od; | ||
^^^ | ||
gap> repeat 123; until true; | ||
Syntax error: while parsing a 'repeat' loop: statement or 'until' expected in \ | ||
stream:1 | ||
repeat 123; until true; | ||
^^^ | ||
gap> for i in [1..3] do 123; od; | ||
Syntax error: while parsing a 'for' loop: statement or 'od' expected in stream\ | ||
:1 | ||
for i in [1..3] do 123; od; | ||
^^^ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters