Skip to content
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

ParseError on extremely simple grammar #35

Closed
clayote opened this issue Oct 24, 2017 · 2 comments
Closed

ParseError on extremely simple grammar #35

clayote opened this issue Oct 24, 2017 · 2 comments

Comments

@clayote
Copy link

clayote commented Oct 24, 2017

I'm building a grammar to process a kind of assignment statement. I started from the beginning and built one that just finds the left and right sides, but this never completes parsing.

degen_expex = Lark("""
start: lhs "=" rhs

lhs: ESCAPED_STRING

rhs: ESCAPED_STRING

%import common.ESCAPED_STRING
%import common.WS
%ignore WS
""")

deparsed = degen_expex.parse('foo=bar')

My actual grammar is more complex than this, of course. It doesn't complete parsing either, but I feel like it would be pointless to debug that if I can't get the most basic thing working.

I'm in Python 3.6 on Windows with Lark version 0.3.7

@clayote
Copy link
Author

clayote commented Oct 24, 2017

It's because I made bad assumptions about what an ESCAPED_STRING was

@clayote clayote closed this as completed Oct 24, 2017
@erezsh
Copy link
Member

erezsh commented Oct 24, 2017

No problem, parsing can be confusing. We're using a language within a language to parse a language, and sometimes it's hard to keep track of what belongs where.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants