Comments (6)
Hey Danny, thanks for the report - that's correct, there is no support for comments yet. I'll see to add them when I find the time for it.
from pddl-rs.
Where would a comment
parser fit into this? I assume it would be under parsers/utilities.rs
, similar to ws
. I am new to nom
, having uses pest
before, so I am not certain of how a comment parser would be implemented, perhaps something like this?
/// A combinator that takes a parser `inner` and produces a parser that consumes
/// all leading comment characters `;` and the endline char or EOF at the end of
/// the line, returning the outputs of `inner`.
pub fn comment<'a, F, O>(inner: F) -> impl FnMut(Span<'a>) -> ParseResult<'a, O>
where
F: FnMut(Span<'a>) -> ParseResult<'a, O>,
{
delimited(many1(char(';')), ws(inner), alt((line_ending, eof)))
}
This seems to work for simple tests with strings like ; content
, ;; content
, ; content\n
, ;content
, etc.
However, I am not sure where this would be integrated so that it works throughout the parser, such as in my example above.
Thoughts?
from pddl-rs.
Utilities would be a good spot - I noticed you forked the repo already, but if the tests go through here on GitHub it will be fixed in #82 and I'll release a new version right away.
I had a little argument with nom about this too just now. That both ws
and the comment parser would have to ignore spaces, which in turn interfered with space_separated_list1
and the likes.
from pddl-rs.
It's available in 0.0.7
now - could you give it a try and tell me if it checks out?
from pddl-rs.
Works for all examples I was utilizing it for. I really appreciate your swiftness at acknowledging and resolving this issue.
from pddl-rs.
Pleasure! If you can put the library to good use, do tell - I'd be happy to hear your feedback!
from pddl-rs.
Related Issues (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 pddl-rs.