Comments (3)
This behaviour has been inherited from Flex: http://flex.sourceforge.net/manual/Why-doesn_0027t-flex-have-non_002dgreedy-operators-like-perl-does_003f.html. In short, they recommend moving the logic from the lexer to the parser, or using start conditions (which nex does not support yet).
However, I'm willing to add non-greedy operators to nex if I can find the time. Stay tuned!
from nex.
Thanks for your help 👍 . I moved said logic to goyacc, but the resulting code is not the prettiest. For my use case, a lot of code duplication arose because I'm only interested in the tokens inside PHP code.
I look forward to your changes :)
from nex.
For anyone searching for the above broken link, here is a mirror:
http://www.cas.mcmaster.ca/~kahl/SE3E03/2006/flex/flex_82.html
(Since nex seems sort of unmaintained, I've resorted to looking at closed issues for hints! Let's all drop any learnings that we get to, somewhere like here!)
from nex.
Related Issues (20)
- The example with go yacc doesn't work HOT 3
- Different output on reruns HOT 2
- argument like go tool yacc's -p to change names of stuff HOT 1
- no way to change func (yylex Lexer) Error(e string) HOT 3
- nested expression question HOT 1
- ternary operators throw unexpected error HOT 1
- strange lexing behavior HOT 2
- Multiline Comments HOT 2
- Do we really need channels and goroutines? HOT 17
- May hang into inf-loop in multi-level klein-closure HOT 1
- Unmatched characters are skipped! HOT 2
- Getting the AST without a global... HOT 4
- Difficulty with matching a "string" HOT 2
- Solved: How to match single line comments (using negation!)
- Case insensitive regular expressions HOT 2
- Thread safety HOT 3
- Unpaired curly inside string confuses nex HOT 1
- Size parameter should also be returned
- regex does not match with parens correctly HOT 11
- Lexer doesn't return a terminal newline token?
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 nex.