nom-lua53 | Lua | Parser library
kandi X-RAY | nom-lua53 Summary
kandi X-RAY | nom-lua53 Summary
A parser for Lua 5.3 written using the nom parser combinator library
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of nom-lua53
nom-lua53 Key Features
nom-lua53 Examples and Code Snippets
Community Discussions
Trending Discussions on nom-lua53
QUESTION
I'm trying to understand how Rust macro captures work and am looking at the nom parser library.
Location nom/src/bytes.rs declares macro tag!
which captures with ($i:expr, $tag: expr)
.
However throughout the places where tag!
is used it is used with only one argument, i.e. tag!("+")
.
Example: nom-lua52/op.rs. I've read tutorials about macros however this construct seems to be special.
It seems like the input $i
is somehow implicit?
ANSWER
Answered 2018-Jul-16 at 18:24The trick is that the tag!()
macro call is inside the value!
macro, which will match against tag!
and pass it an additional parameter. This is described in the file implementing tag!
.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install nom-lua53
Rust is installed and managed by the rustup tool. Rust has a 6-week rapid release process and supports a great number of platforms, so there are many builds of Rust available at any time. Please refer rust-lang.org for more information.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page