-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does not parse across multiple Lines #13
Comments
Your regex does not match every characters – it won’t match a new line. Betterparse uses standard Kotlin regular expressions, and by default with the defaults flags. You need to use the Alternatively you should be able to use regex like |
Thanks @silmeth, but it doesn't seem to be the Problem. val singleToken by token(""".+""".toRegex(RegexOption.DOT_MATCHES_ALL)) But at this Point it doesn't help, because the Consequently I reimplemented the I made sure, that it receives Regex Options, and called in my Grammar using: override val tokenizer: Tokenizer by lazy {
MyTokenizer(tokens, RegexOption.MULTILINE, RegexOption.DOT_MATCHES_ALL)
} The result is still the originally descriped error. Could this have to do with the behavior of Javas |
@IARI, in the 0.3.5 update, I've added reflex option transformation to embedded flags. Before 0.3.5, you could also just add the reflex embedded flags into the pattern string. |
Thats nice, but as stated that from as much as I understand doesn't solve the problem. So far, it worked only without the \G |
Any hints? |
I have to apologize in advance: I have no ideas about lexing and parsing.
When I try to simple a Parser and feed it content with multiple lines, the tokenizer fails
Somehow, after the new line the
\G
in the wrappingallInOnePattern
of theDefaultTokenizer
(Tokenizer.kt#L42) does not match anymore.What am I doing wrong here?
The text was updated successfully, but these errors were encountered: