-
Notifications
You must be signed in to change notification settings - Fork 34
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
Proper ways for Multiline String and String Interpolation #481
Comments
hello @swety2003 , using GenericLexer , the String lexeme should natively handle multiline strings. Regarding string interpolation, I think the best way is using GenericLexer modes hope this would help Olivier |
@swety2003 are you ok with my answer ? |
Well, GenericLexer can indeed solve the problem of multi line strings, but the delimiter can only be one character. How can we parse strings with multiple characters as delimiters? [String(delimiter:"\"\"")]
STRING, LEXER_STRING_DELIMITER_MUST_BE_1_CHAR [FATAL] bad lexem "" : StringToken lexeme delimiter char must be 1 character length |
@swety2003 could you please explain precisely what kind of token you are trying to parse ? |
For example:
|
So, to sum up you need a string that
Then the generic lexer modes is the way to go. |
OK, thank you for your help, I'll try to use it to solve the problem. |
You Can take a look at https://github.com/b3b00/csly/tree/dev/src/samples/SimpleTemplate for inspiration. |
@swety2003 , to fix issue #495 i've done what you want in the IndentedwhileParser. you can take a look it should answer most of your need |
Is there a suitable way to implement multi-line string and string interpolation like C #?
The text was updated successfully, but these errors were encountered: