Add support for a single quote in a character literal and a double qu…#57
Add support for a single quote in a character literal and a double qu…#57skaupper wants to merge 1 commit intoPaebbels:devfrom
Conversation
| yield previousToken | ||
| tokenKind = cls.TokenKind.OtherChars | ||
|
|
||
| start = SourceCodePosition(row, column, absolute) |
There was a problem hiding this comment.
The following if-elif code block is now present about eight times in this function. What are your thoughts on replacing those with calls to a separate function?
The variables buffer, previousToken, tokenKind etc. would have to be passed by reference in order to support yielding tokens out of it. But I do not really know a simple, non-hacky way to pass enumerations by reference (other than wrapping it manually in a temporary object/dict ofc).
| tokenKind = cls.TokenKind.OtherChars | ||
| else: | ||
| continue | ||
| continue # TODO: Merge with changes from #56! |
There was a problem hiding this comment.
This if-block will be merged with the changes made by #56.
There was a problem hiding this comment.
#56 was merged. What's next for this PR? Anything I can do?
There was a problem hiding this comment.
As soon as I have some spare time I will rebase this branch. Since it touches the same if-branches in the parser as #56 I will have a look if something can be cleaned up.
I would appreciate your thoughts about my other comment, though.
8cd5ca2 to
63fb610
Compare
|
Oh. looks like I got distracted from that one ... |
…ote in a string literal
63fb610 to
479005d
Compare
|
As far as I am concerned, this PR could be merged. Do you have any objections? |
As discussed in #56, this PR adds support for single quotes in a character literal (
''') and double quotes in a string literal ("""","foo""", etc.).As soon as #56 is merged, this PR will get additional test cases (like
character'(''')) to avoid conflicts with qualified expressions.