incorrect ignore behavior
See original GitHub issueHi Erez,
Given a grammar like this:
sudo_parser = Lark(r"""
sudo_item : CNAME*
%import common.CNAME
%import common.WS
%ignore /[\\\\]$/m
%ignore /^#.*\n/m
%ignore /^Defaults.*$/m
%ignore WS
""", start='sudo_item')
This input works:
# ======> BEGINNING OF sudoers.d/00_Cmnd_Aliases
This doesn’t:
# ======> BEGINNING OF sudoers.d/00_Cmnd_Aliases
#New aliases
I’m using the master branch.
Note that if I use $
in the comment pattern, neither the first, nor the second case work. Let me know if I’m doing something wrong.
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Ignoring a wrong behavior is not much different than endorsing it
Exactly. Ignoring a wrong behavior is not much different than endorsing it. It is also similar to being neutral in a situation. It...
Read more >Ignoring: An Effective Way to Change Some Behaviors
The basic principle behind ignoring is: "To stop a child from acting in a particular way, arrange conditions so that the child will...
Read more >Ignoring | Consequences | Essentials | Parenting Information
Ignoring usually helps stop behaviors that your child is using to get your attention. This includes behaviors like throwing tantrums, whining, and interrupting....
Read more >What Is Planned Ignoring? Examples Of Extinction Behavior
The procedure of planned ignoring involves deliberate parental inattention to the occurrence of target child behaviors.
Read more >Using Planned Ignoring | Classroom Check-Up
Effective planned ignoring can help students unlearn problem behaviors that obtain attention and, when paired with positive attention, teaches them more ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Cool! Confirming the fix! Thanks much.
When I run it, it seems just fine. If you’re encountering a problem, it’s probably because your grammar is ambiguous (it can be parsed in more than one correct way), and the latest commit has shifted the default interpretation.
Try instanciating Lark with
Lark(..., ambiguity='explicit')
to see all the possible interpretations. If one of them is incorrect (or undesirable), you have two options:Let me know if this helps.