You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Following are optional, but will help us consider adding:
Why is this useful?
When it comes to parsing in Rust; nom is virtually as popular as regex. Arguably, nom is the most rust idiomatic.
Example Code:
The currency in nom is parsers. Parser are built on top of other parsers and then combined in different ways. In the Assembler interpreter (part II), a top level parser to select between different assembly instructions could look something like this:
Please complete the following information about the package:
Package name: Nom
Language name: Rust
Website: https://github.com/rust-bakery/nom
Following are optional, but will help us consider adding:
Why is this useful?
When it comes to parsing in Rust; nom is virtually as popular as regex. Arguably, nom is the most rust idiomatic.
Example Code:
The currency in nom is parsers. Parser are built on top of other parsers and then combined in different ways. In the Assembler interpreter (part II), a top level parser to select between different assembly instructions could look something like this:
pub fn tokenize_other(input: &str) -> IResult<&str, Token> {
alt((movri, movrr, addri, addrr, subri, subrr, mulri, mulrr, divri, divrr, cmpri, cmprr, incr, decr,
alt((end, ret, call, jmp, je, jne, jle, jl, jg, jge, label))
))(input)
}
The text was updated successfully, but these errors were encountered: