lcsb-biocore / pikaparser.jl Goto Github PK
View Code? Open in Web Editor NEWPure Julia implementation of pika parser.
Home Page: https://lcsb-biocore.github.io/PikaParser.jl
License: Apache License 2.0
Pure Julia implementation of pika parser.
Home Page: https://lcsb-biocore.github.io/PikaParser.jl
License: Apache License 2.0
apparently, there are convoluted cases that result in the topologic order of derivation of canMatchZeroChars
giving wrong results.
Change the derivation to a flood-fill algorithm.
...because it's just much more handy than checking if the match really matched everything
(something){123}
in regex. Possibly doable by using the option index in ZeroOrMore (or OneOrMore) to count the matched repetitions.Hi, I was trying to parse regexes with this parser and couldn't get the |
operator to work.
For abc|de
I get
sequence(
expr(char()),
expr(char()),
expr(either(sequence(expr(char())), pipe(), sequence(expr(char()), expr(char())))),
)
Because I don't know how to specify that |
should have the largest possible sequences on left and right.
The relevant grammar parts of this are :sequence => P.one_or_more(:expr)
, then :expr => P.first(:either, :negative_lookahead, :positive_lookahead, :positive_lookbehind, :negative_lookbehind, :zero_or_more, :one_or_more, :repetition, :repetition_at_least, :repetition_from_to, :maybe, :noncapturing_group, :capturing_group, :not_set, :set, :specialized_char, :dot, :normalized_char, :char, :_begin, :_end)
and :either => P.seq(:sequence, :pipe, :sequence)
.
I saw that https://github.com/lukehutch/pikaparser has precedence integers for clauses but I didn't see anything here, is that a missing piece of the puzzle?
@laurentheirendt can you please add the codecov token to this repo (just as with other repos)
We've got a nice 99% coverage so better report it. :D
Often I find myself that some clauses are more easily parsed with a regex than with PikaParser clauses. The solution is to user a Scan
in a way similar to:
rules = Dict(
...,
:id => PikaParser.scan() do x
matched = match(r"^[a-z][a-zA-Z0-9_]*", x)
isnothing(matched) && return 0
length(matched.match)
end,
...,
)
It would be great if we could just pass the regex to scan
.
Only regex of the form r"^..."
should be accepted. If the ^
clause is not present, then the regex will search the pattern along all the input.
This issue is used to trigger TagBot; feel free to unsubscribe.
If you haven't already, you should update your TagBot.yml
to include issue comment triggers.
Please see this post on Discourse for instructions and more details.
If you'd like for me to do this for you, comment TagBot fix
on this issue.
I'll open a PR within a few hours, please be patient!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.