Comments (2)
Looking at map
, it is currently documented as this:
/// Constructs a parser that has its result converted with the
/// `conv` function. The ´conv` functions signature is
/// `*const fn (ParserResult(parser)) T`, so this function should only
/// be used for conversions that cannot fail. See `convert`.
So the conv
function will be passed one argument, which is the result of the parser it maps over. For combine
the result is a tuple, as documented:
/// Takes a tuple of `Parser(any)` and constructs a parser that
/// only succeeds if all parsers succeed to parse. The parsers
/// will be called in order and parser `N` will use the `rest`
/// from parser `N-1`. The parsers result will be a `Tuple` of
/// all parser not of type `Parser(void)`. If only one parser
/// is not of type `Parser(void)` then this parsers result is
/// returned instead of a tuple.
I'm unsure what is missing to make this more clear, but if you have any ideas I'm all ear.
from mecha.
Thanks, I missed those parts, I understand now. I am wondering how map actually works though, like say I want to build an AST out of it and I use .map
to do it. Would I return the AST nodes in the conversion function, add them to an external list, or something else?
from mecha.
Related Issues (20)
- add zig topic to repo HOT 2
- Delimiter seperated value parser
- Have an alternative to mecha.convert for when the convertion cannot fail HOT 1
- Allow mecha to allocate memory HOT 3
- Example Rgb parser is incorrect
- Documentation HOT 1
- How to parse bareword literal? HOT 2
- Build documentation from doc comments HOT 1
- How to parse indents? HOT 4
- How to parse string literals? HOT 2
- Returning progress when parsing fails HOT 8
- most mecha.ascii.* parsers are Parser(u8), but mecha.ascii.char is Parser(void) HOT 1
- Create zig-master branch HOT 1
- Infinite recursion - i.e. how to use ref()? HOT 2
- Line/column number tracking and custom errors HOT 1
- Support the new zig package manager HOT 2
- Build including mecha fails with no field named 'root_source_file' in struct 'Build.CreateModuleOptions' HOT 2
- Combine yields incompatible tuple types HOT 3
- Update to the latest Zig HOT 3
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 mecha.