-
Notifications
You must be signed in to change notification settings - Fork 14
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
Add support for a single quote in a character literal and a double qu… #57
base: dev
Are you sure you want to change the base?
Add support for a single quote in a character literal and a double qu… #57
Conversation
yield previousToken | ||
tokenKind = cls.TokenKind.OtherChars | ||
|
||
start = SourceCodePosition(row, column, absolute) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 yield
ing 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).
pyVHDLParser/Token/Parser.py
Outdated
tokenKind = cls.TokenKind.OtherChars | ||
else: | ||
continue | ||
continue # TODO: Merge with changes from #56! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This if
-block will be merged with the changes made by #56.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#56 was merged. What's next for this PR? Anything I can do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.