bistromathic: do not display parse errors on completion

Currently autocompletion on a line with errors leaks the error
messages.  It can be useful to let the user know, but GNU Readline
does not provide us with an nice way to display the error.  So we
actually break into the current line of the user.

So instead, do not show these errors.

* examples/c/bistromathic/parse.y (user_context): New.
Use %param to pass it to the parser and scanner.
Keep quiet when in computing autocompletion.
This commit is contained in:
Akim Demaille
2020-07-11 13:48:43 +02:00
parent 093eeb27e9
commit c47e1174d4
2 changed files with 36 additions and 16 deletions

View File

@@ -314,7 +314,6 @@ EOF
run -n 0 '> 1++ ''
> ''
err: 1.3: syntax error: expected - or ( or number or function or variable before +
err: 1.3: syntax error: expected - or ( or number or function or variable before +
'
# And even when the error was recovered from.
@@ -324,7 +323,5 @@ EOF
run -n 0 '> (1++2) + 3 + ''
> ''
err: 1.4: syntax error: expected - or ( or number or function or variable before +
err: 1.4: syntax error: expected - or ( or number or function or variable before +
err: 1.4: syntax error: expected - or ( or number or function or variable before +
err: 1.15: syntax error: expected - or ( or number or function or variable before end of file
'