Comments (4)
Hi, I did some programming for Arpeggio and from what I know, defining rules in Arpeggio, automatically includes whitespaces and endlines.
If you write your rule as:
rule = "key" "word" "test
All of the following statements will fit ( dots represent spaces, arrows represent tabs):
// Example 1:
key....word
test
// Example 2:
key....word...test
// Example 3:
key
--->word
test
Unless something changed in the meantime, Arpeggio by default accepts any number of whitespaces (space or tab) and newlines between two element in a rule.
from arpeggio.
There is a parser parameter skipws
which is True by default. When this param is set to False arpeggio will not skip whitespaces.
Yash, considering the error you are getting. It is a bug in the PEG rules resolving during ParserPEG
construction triggered by the rule calc = test
. I am working on it. In the mean time the workaround is to remove this rule and directly reference test
rule from ParserPEG
. Like this:
parser = ParserPEG(calc_grammar, "test", skipws=False)
from arpeggio.
The issue is fixed. this test now passes.
from arpeggio.
Yup worked well
from arpeggio.
Related Issues (20)
- Detect and report invalid grammars
- Question to the possible design of the reporting functionality
- Indentation based languages HOT 5
- Is there a way to go back through a tree to already visited node?
- Feature Request: Allowing grammar to filter out constants HOT 2
- The DSL used for arpeggio grammars looks very similar to parsimonious. Is it intentional? HOT 1
- Automatic detection of main rule name assumming it is the first one
- help(parse_tree) trigger an AssertionError HOT 1
- Match until end of line HOT 2
- setup.py fails with UnicodeDecodeError
- ParserPEG with multiple root rules HOT 1
- How to define a recursive rule with Python style? HOT 2
- performance issue when parsing => grammar not good? HOT 7
- Repetitions with separators terminate on empty separator match
- 1.10.2: pytest warnings
- pytest-runner is not required
- Lookahead rules always showed as not matched in debug mode HOT 1
- Lookahead not working in OrderedChoice HOT 5
- Can PEG syntax (cleanpeg) use reduce_tree and memoization? HOT 6
- Unexpected NoMatch when suppressing a StrMatch from the parse tree HOT 1
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 arpeggio.