Skip to content

Commit

Permalink
primitive support for comments
Browse files Browse the repository at this point in the history
  • Loading branch information
danieledapo committed Feb 1, 2023
1 parent 11ee65a commit 379a0b0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/dsl/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ mod tests {
line v1 v2
triangle v2 v3 v4
# comment
";

let tree = parse_module(module).unwrap();
Expand Down
5 changes: 5 additions & 0 deletions src/dsl/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ where

let ty = self.next(section).ok()?;

// comments should probably added to the ast
if ty.starts_with("#") {
return None;
}

let res = match ty {
"vertex" => self.parse_vertex(),
"line" => self.parse_line(),
Expand Down

0 comments on commit 379a0b0

Please sign in to comment.