bistromathic: don't require spaces after operators for completion

Currently "(1+<TAB>" does not work as expected, because "+" is not a
word breaking character.

* examples/c/bistromathic/parse.y (init_readline): Specify our word
breaking characters.
* examples/c/bistromathic/bistromathic.test: Avoid trailing spaces.
This commit is contained in:
Akim Demaille
2020-03-02 05:09:43 +01:00
parent feb1011c8b
commit f334775dbf
2 changed files with 11 additions and 7 deletions

View File

@@ -93,4 +93,4 @@ run 0 '> ( 1 +
- double precision number sin - double precision number sin
atan exp sqrt atan exp sqrt
> (1+ > (1+
> err: 1.7: syntax error: expected - or ( or double precision number or function or variable before end of file' > err: 1.4: syntax error: expected - or ( or double precision number or function or variable before end of file'

View File

@@ -426,11 +426,15 @@ completion (const char *text, int start, int end)
void init_readline (void) void init_readline (void)
{ {
/* Allow conditional parsing of the ~/.inputrc file. */ // Allow conditional parsing of the ~/.inputrc file.
rl_readline_name = "pushcalc"; rl_readline_name = "bistromathic";
/* Tell the completer that we want a crack first. */ // Tell the completer that we want a crack first.
rl_attempted_completion_function = completion; rl_attempted_completion_function = completion;
// The basic list of characters that signal a break between words
// for the completer routine.
rl_basic_word_break_characters = " \t\n\"\\'`@$><=;|&{(+-*/^)";
} }