Comments (4)
Sure, I'm open to this feature.
How do you plan to implement it?
from lark.
Regexp manipulation on grammar before it is processed. (Not my code so won't take credit:))
from lark.
If you mean literally running regexps on the grammar, then I won't merge such code. Using regexps, it will be limited to simple expressions only, it won't handle typos well, and it will hinder future additions to the syntax.
That way to implement this feature is to:
-
Add it to the grammar parser (in load_grammar)
-
Manipulate the resulting tree, before it's compiled into a new parser
from lark.
Just added support for this in latest master (not in the official release yet). Let me know if it works for you!
Syntax looks like:
start: some_expression~1..3
from lark.
Related Issues (20)
- Please remove the duplicate PYPI record HOT 1
- Transformer raises AttributeError when a tree is only a token HOT 1
- Import lark grammar written in one python project into another HOT 2
- Need help figuring out why some characters are captured in __ANON_ HOT 2
- Need help with terminals not showing up as expected
- Transforming tree after standalone parser results in different AST HOT 4
- Making a comment by using regular expression HOT 5
- earley very, very slow HOT 24
- Cant read `meta` from Tree or Token? HOT 5
- How to define lark grammar for best parsing performance HOT 8
- Unable to parse Arabic text HOT 3
- Incorrect start_pos / end_pos in the tree HOT 8
- Add `outlines` in the list of projects using Lark HOT 2
- Lark.open_from_package() does not support namespace packages HOT 2
- Stand-alone program cannot be run HOT 4
- Issue of installing lark in Python HOT 1
- Pipe in terminal regex not working as expected HOT 1
- Transformer Not Applying Expected Transformations in Lark Parser HOT 3
- Deprecation Warning HOT 6
- accepts() vs choices() in InteractiveParser HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lark.