P1: LineContinuation terminal implementation

Coordinator
Jul 19, 2011 at 7:49 PM
Edited Jul 19, 2011 at 8:33 PM

(Copied from discussion on contribution items)

Roman:

Where to put lineContinuation? that's part of the task to figure it out. But it seems to me it should be Non-grammar terminal - you don't put it into production, you just let grammar know it's there (like comment terminal)

thanks for coming forward with this help offer - appreciate it

Yallie:

Yes, that absolutely makes sense. I'll try to implement it then :)

Roman:

The other possibility is to add it to NewLineTerminal

First test it with GwBasic grammar. See if it can be used with miniPython grammar - python uses '\' symbol as line continuation

Jul 19, 2011 at 9:07 PM

Please could I just add a link back to a previous discussion on line continuation terminals. 

http://irony.codeplex.com/discussions/198158

Using a comment terminal is still working for me, if that is any help in working out how to approach this.  The comment kindly "eats" the end of line.  Unfortunately I am not guaranteed to have a space character to mark the end of the "comment", but luckily I havent yet hit any code without indentation.

If I can help with any testing, please let me know.  Out of the five grammars I now have written, only one so far would benefit from such a terminal but I can certainly help test it.

Many thanks.

Will.

 

Developer
Jul 28, 2011 at 11:34 PM

Hi Roman,

>But it seems to me it should be Non-grammar terminal

I've implemented LineContinuationTerminal this way and added unit tests for it. It seems to work well in GwBasicGrammar.

>The other possibility is to add it to NewLineTerminal

Although it could be a bit simpler solution, I've finally decided that a separate terminal is better.


Will, thanks you for the link!

>If I can help with any testing, please let me know.  Out of the five grammars I now have written,
>only one so far would benefit from such a terminal but I can certainly help test it.

I've pushed LineContinuationTerminal to my fork. The source code is available here:
http://irony.codeplex.com/SourceControl/network/Forks/yallie/IronyContrib 

It would be great if you find the time to check out LineContinuation in your grammar.

Regards, yallie.

Coordinator
Jul 28, 2011 at 11:50 PM
Edited Jul 29, 2011 at 5:41 AM

That's great news, thank you! I will merge it with my code (hacking interpreter like crazy) and push the result soon.

thanks again!

Roman

 

Edited: about miniPython - never mind, my bad, forgot it's handled by token filter