Skip to content

Commit

Permalink
Parse ;& ;| ;;& operators
Browse files Browse the repository at this point in the history
  • Loading branch information
magicant committed Nov 10, 2024
1 parent 7f2095c commit 1eec2f3
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions yash-syntax/src/parser/lex/op.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,28 @@ const AND: Trie = Trie(&[Edge {
}]);

/// Trie of the operators that start with `;`.
const SEMICOLON: Trie = Trie(&[Edge {
key: ';',
value: Some(Operator::SemicolonSemicolon),
const SEMICOLON: Trie = Trie(&[
Edge {
key: '&',
value: Some(Operator::SemicolonAnd),
next: NONE,
},
Edge {
key: ';',
value: Some(Operator::SemicolonSemicolon),
next: SEMICOLON_SEMICOLON,
},
Edge {
key: '|',
value: Some(Operator::SemicolonBar),
next: NONE,
},
]);

/// Trie of the operators that start with `;;`.
const SEMICOLON_SEMICOLON: Trie = Trie(&[Edge {
key: '&',
value: Some(Operator::SemicolonSemicolonAnd),
next: NONE,
}]);

Expand Down

0 comments on commit 1eec2f3

Please sign in to comment.