consultingwerk / proparse

Proparse, forked from http://www.oehive.org/proparse/
Other
18 stars 9 forks source link

Issue with single-line comments and ~n #18

Closed mikefechner closed 6 years ago

mikefechner commented 6 years ago

The following comment disturbs proparse - presumingly due to the combination of single-line comments and line-break ~n

// UserWarning: Das Protokolldatum liegt &1 Tage zurück. ~n~n Der Protokolleintrag wird mit diesem Datum gespeichert. 

Causes

Error parsing file: C:\Users\MikeFechner\AppData\Local\Temp\tmp3AAD.tmp org.prorefactor.refactor.RefactorException: Error parsing tmp3AAD.tmp unexpected token: Protokolleintrag antlr.NoViableAltException: NoViableAlt

akera-io commented 6 years ago

There is a comment in the lexer that states this... "Escapes are always processed, even inside strings and comments."

So, '~n' translates to '\n' aka new line so single line comments end prematurely leading to this error you get.

I will try to get around this for single line comments, how do you expect the comment text to look like - keep the '~n' as is or have that replaced with a new line?

akera-io commented 6 years ago

for now, we leave the single line node text to be the original (unescaped) value containing tilde escape code since the multiline comment behaves the same.