ravikumar10 / genyris

Automatically exported from code.google.com/p/genyris
Other
0 stars 0 forks source link

0.6.9-9-gcf84331-b0: Repl Multi-line prompt can be fooled by multi-line strings. #35

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
at REPL:
> '
:
> '
:
'\n\n' # String

What do you see?

Prompt chanegs back to > before the end of the string.

What is the expected output?

prompt should be ':' until the expression ids completed.

Original issue reported on code.google.com by birchb1...@gmail.com on 4 Apr 2013 at 6:55

GoogleCodeExporter commented 9 years ago
Instead of the current logic in the JLineStdioInputStream, maybe change 
Parser.read() so that the parser tells the lexer and hence input stream when it 
is not expecting any input. ie

on init:
_lexer.waiting()
==> jline.setprompt('> ')

_lexer.insideExpression()
==> jline.setprompt(': ')

after last right paren:
_lexer.waiting()
==> jline.setprompt('> ')

this might work - depends on buffering....

_lex

Original comment by birchb1...@gmail.com on 4 Apr 2013 at 7:02

GoogleCodeExporter commented 9 years ago

Original comment by birchb1...@gmail.com on 4 Apr 2013 at 7:03

GoogleCodeExporter commented 9 years ago

Original comment by birchb1...@gmail.com on 4 Apr 2013 at 2:16

GoogleCodeExporter commented 9 years ago

Original comment by birchb1...@gmail.com on 4 Apr 2013 at 2:22

GoogleCodeExporter commented 9 years ago
Fixed in 0.6.9-11-g8ba3850

Original comment by birchb1...@gmail.com on 4 Apr 2013 at 2:24

GoogleCodeExporter commented 9 years ago

Original comment by birchb1...@gmail.com on 13 Apr 2013 at 8:44