Skip to content

Commit

Permalink
Update peg to support multiline comments on rules (kevinmehall/rust-p…
Browse files Browse the repository at this point in the history
  • Loading branch information
Mingun committed Jul 24, 2020
1 parent 8d2ddb8 commit e546bea
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ description = "Alternative [Kaitai Struct](https://kaitai.io) compiler, written
[dependencies]
serde = { version = "1.0", features = ["derive"] }
serde_yaml = "0.8"
peg = "0.6"
peg = "0.6.3"

[dev-dependencies]
test-generator = "0.3.0"
7 changes: 5 additions & 2 deletions src/expressions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -442,10 +442,13 @@ peg::parser! {
use UnaryOp::*;
use BinaryOp::*;

/// Entry point for parsing expressions in `if`, `io`, `pos`, `repeat-expr`, `repeat-until`, `size`, `switch-on`, `valid.min`, `valid.max`, `valid.expr`, `value`.
/// Entry point for parsing expressions in `if`, `io`, `pos`, `repeat-expr`,
/// `repeat-until`, `size`, `switch-on`, `valid.min`, `valid.max`, `valid.expr`,
/// `value`.
pub rule parse_single() -> Node<'input> = _ e:expr() _ EOS() {e};

/// Entry point for parsing list of expressions in function calls and parametrized types instantiations.
/// Entry point for parsing list of expressions in function calls and parametrized
/// types instantiations.
pub rule parse_list() -> Vec<Node<'input>> = _ h:expr() _ t:("," _ e:expr() _ {e})* EOS() {
let mut result = vec![h];
result.extend(t);
Expand Down

0 comments on commit e546bea

Please sign in to comment.