Comments (6)
Thanks for your interest in PEG.jl, and sorry for my delay in replying (I was on vacation, and then working through the backlog from that vacation).
I had thought about doing something like this, but I was kind of on the fence because I wanted to keep it simple. But I think seeing that someone else wants this feature too has pushed me off the fence.
I think it might be good to have one extra modifier that changes the behavior of p
and w
, rather than two modifiers that copy p
and w
with the change. Modifier letters are a scarce resource, and in addition to overriding Julia's imsx
, I'd like to avoid redefining those that are in active use in other languages like Perl. That leaves bfhjkqtvyz
. How about h
for horizontal?
I think most whitespace characters are horizontal, so I should just list the ones that aren't, in a negative lookahead before the \s
. That would turn the implementation of p
from \s*
to (?:(?![\r\n\v\f\u85])\s)*
. That is to say, the vertical whitespace characters are: carriage return, line feed, vertical tab, form feed, and next line. Did I miss any?
from peg.jl.
Thanks for your reply! There is actually a special horizontal whitespace \h
regex form, so we can probably use that directly, right?
from peg.jl.
So would this then be?
r","p
to match comma, followed by any whitespacer","ph
to match comma, followed by any horizontal whitespacer"BEGIN"w
to match "BEGIN", followed by any whitespacer"BEGIN"wh
to match "BEGIN", followed by any horizontal whitespace
from peg.jl.
Oh, \h
is good to know! Apparently it was added in Perl 5.10, after I learned Perl 5.6 :)
And yes, your four examples are correct.
OK, I just committed this change; eventually this will be version 0.2.0, once the CI tests finish and I submit the version tag/metadata.
from peg.jl.
Hm, mac tests are taking forever to even start running. Submitted it anyway; hopefully it'll get there eventually.
from peg.jl.
They seem to have passed eventually. Thanks @wdebeaum, this is super helpful!
from peg.jl.
Related Issues (4)
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 peg.jl.