We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I came across a bug that was rooted in what seems to be a curious feature of Parsley: changing from single to double quotes leads to a parsing error:
import sys print(sys.version_info) # sys.version_info(major=3, minor=5, micro=1, releaselevel='final', serial=0) import parsley print(parsley.__version__) #1.3 grammar = parsley.makeGrammar(""" add = <digit+>:left sp "+" sp add:right -> ('add', left, right) | <digit+>:child -> child sp = ' '* """, {}) grammar('4 + 3').add() # ('add', '4', '3')
But if we change sp = ' '* to sp = " "* and keep everything else constant, we get an error:
sp = ' '*
sp = " "*
grammar = parsley.makeGrammar(""" add = <digit+>:left sp "+" sp add:right -> ('add', left, right) | <digit+>:child -> child sp = " "* """, {}) grammar('4 + 3').add()
--------------------------------------------------------------------------- ParseError Traceback (most recent call last) <ipython-input-20-5d4b7ce9eeba> in <module>() 6 """, {}) 7 ----> 8 grammar('4 + 3').add() /Users/jakevdp/anaconda/envs/python3.5/lib/python3.5/site-packages/parsley.py in invokeRule(*args, **kwargs) 96 err = ParseError(err.input, err.position + 1, 97 [["message", "expected EOF"]], err.trail) ---> 98 raise err 99 return invokeRule 100 ParseError: 4 + 3 ^ Parse error at line 2, column 0: expected EOF. trail: []
Is the semantic difference between " " and ' ' intended? I couldn't find any discussion of this in the documentation. Thank you!
" "
' '
The text was updated successfully, but these errors were encountered:
I ran into this same issue recently.
Sorry, something went wrong.
No branches or pull requests
I came across a bug that was rooted in what seems to be a curious feature of Parsley: changing from single to double quotes leads to a parsing error:
But if we change
sp = ' '*
tosp = " "*
and keep everything else constant, we get an error:Is the semantic difference between
" "
and' '
intended? I couldn't find any discussion of this in the documentation. Thank you!The text was updated successfully, but these errors were encountered: