Skip to content

Commit

Permalink
fix: rename HYPEN to HYPHEN
Browse files Browse the repository at this point in the history
  • Loading branch information
plusvic committed Jul 10, 2024
1 parent c02c620 commit 8b306de
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
10 changes: 5 additions & 5 deletions parser-ng/src/parser/cst/syntax_kind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ pub enum SyntaxKind {
BACKSLASH,
DOT,
EQUAL,
HYPEN,
HYPHEN,
PERCENT,
PIPE,
PLUS,
Expand Down Expand Up @@ -210,11 +210,11 @@ impl SyntaxKind {
SyntaxKind::XOR_KW => TokenId::XOR_KW,

SyntaxKind::ADD => TokenId::PLUS,
SyntaxKind::SUB => TokenId::HYPEN,
SyntaxKind::SUB => TokenId::HYPHEN,
SyntaxKind::MUL => TokenId::ASTERISK,
SyntaxKind::DIV => TokenId::BACKSLASH,
SyntaxKind::MOD => TokenId::PERCENT,
SyntaxKind::MINUS => TokenId::HYPEN,
SyntaxKind::MINUS => TokenId::HYPHEN,

SyntaxKind::SHL => TokenId::SHL,
SyntaxKind::SHR => TokenId::SHR,
Expand Down Expand Up @@ -251,7 +251,7 @@ impl SyntaxKind {
SyntaxKind::COMMA => TokenId::COMMA,
SyntaxKind::DOT => TokenId::DOT,
SyntaxKind::EQUAL => TokenId::EQUAL,
SyntaxKind::HYPEN => TokenId::HYPEN,
SyntaxKind::HYPHEN => TokenId::HYPHEN,
SyntaxKind::PERCENT => TokenId::PERCENT,
SyntaxKind::PIPE => TokenId::PIPE,

Expand Down Expand Up @@ -336,7 +336,7 @@ impl From<&Token> for SyntaxKind {
Token::COMMA(_) => SyntaxKind::COMMA,
Token::DOT(_) => SyntaxKind::DOT,
Token::EQUAL(_) => SyntaxKind::EQUAL,
Token::HYPEN(_) => SyntaxKind::HYPEN,
Token::HYPEN(_) => SyntaxKind::HYPHEN,
Token::PERCENT(_) => SyntaxKind::PERCENT,
Token::PIPE(_) => SyntaxKind::PIPE,
Token::PLUS(_) => SyntaxKind::PLUS,
Expand Down
4 changes: 2 additions & 2 deletions parser-ng/src/parser/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1161,7 +1161,7 @@ impl<'src> InternalParser<'src> {
p.expect_d(t!(XOR_KW), DESC).opt(|p| {
p.expect(t!(L_PAREN))
.expect(t!(INTEGER_LIT))
.opt(|p| p.expect(t!(HYPEN)).expect(t!(INTEGER_LIT)))
.opt(|p| p.expect(t!(HYPHEN)).expect(t!(INTEGER_LIT)))
.expect(t!(R_PAREN))
})
})
Expand Down Expand Up @@ -1244,7 +1244,7 @@ impl<'src> InternalParser<'src> {
.begin_alt()
.alt(|p| {
p.opt_expect(t!(INTEGER_LIT))
.expect(t!(HYPEN))
.expect(t!(HYPHEN))
.opt_expect(t!(INTEGER_LIT))
})
.alt(|p| p.expect(t!(INTEGER_LIT)))
Expand Down
12 changes: 6 additions & 6 deletions parser-ng/src/parser/tests/testdata/hex-patterns-3.out
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ [email protected]
[email protected]
[email protected] "["
[email protected] "1"
HYPEN@46..47 "-"
HYPHEN@46..47 "-"
[email protected] "2"
[email protected] "]"
[email protected] " "
[email protected] "33"
[email protected] " "
[email protected]
[email protected] "["
HYPEN@54..55 "-"
HYPHEN@54..55 "-"
[email protected] "100"
[email protected] "]"
[email protected] " "
Expand All @@ -50,14 +50,14 @@ [email protected]
[email protected]
[email protected] "["
[email protected] "100"
HYPEN@67..68 "-"
HYPHEN@67..68 "-"
[email protected] "]"
[email protected] " "
[email protected] "55"
[email protected] " "
[email protected]
[email protected] "["
HYPEN@74..75 "-"
HYPHEN@74..75 "-"
[email protected] "]"
[email protected] " "
[email protected] "66"
Expand Down Expand Up @@ -111,14 +111,14 @@ [email protected]
[email protected]
[email protected] "["
[email protected] "1"
HYPEN@152..153 "-"
HYPHEN@152..153 "-"
[email protected] "2"
[email protected] "]"
[email protected] " "
[email protected]
[email protected] "["
[email protected] "100"
HYPEN@160..161 "-"
HYPHEN@160..161 "-"
[email protected] "]"
[email protected] " "
[email protected] "33"
Expand Down
2 changes: 1 addition & 1 deletion parser-ng/src/parser/tests/testdata/pattern-mods-1.out
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ [email protected]
[email protected] "xor"
[email protected] "("
[email protected] "20"
HYPEN@216..217 "-"
HYPHEN@216..217 "-"
[email protected] "30"
[email protected] ")"
[email protected] " "
Expand Down
6 changes: 3 additions & 3 deletions parser-ng/src/tokenizer/tokens.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ pub(crate) enum TokenId {
COMMA,
DOT,
EQUAL,
HYPEN,
HYPHEN,
PERCENT,
PIPE,
PLUS,
Expand Down Expand Up @@ -173,7 +173,7 @@ impl TokenId {
TokenId::COMMA => "`,`",
TokenId::DOT => "`.`",
TokenId::EQUAL => "`=`",
TokenId::HYPEN => "`-`",
TokenId::HYPHEN => "`-`",
TokenId::PERCENT => "`%`",
TokenId::PIPE => "`|`",
TokenId::PLUS => "`+`",
Expand Down Expand Up @@ -285,7 +285,7 @@ pub enum Token {
COMMA(Span) = TokenId::COMMA as u8,
DOT(Span) = TokenId::DOT as u8,
EQUAL(Span) = TokenId::EQUAL as u8,
HYPEN(Span) = TokenId::HYPEN as u8,
HYPEN(Span) = TokenId::HYPHEN as u8,
PERCENT(Span) = TokenId::PERCENT as u8,
PIPE(Span) = TokenId::PIPE as u8,
PLUS(Span) = TokenId::PLUS as u8,
Expand Down

0 comments on commit 8b306de

Please sign in to comment.