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 8b306de commit d7b3479
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion parser-ng/src/parser/cst/syntax_kind.rs
Original file line number Diff line number Diff line change
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::HYPHEN,
Token::HYPHEN(_) => SyntaxKind::HYPHEN,
Token::PERCENT(_) => SyntaxKind::PERCENT,
Token::PIPE(_) => SyntaxKind::PIPE,
Token::PLUS(_) => SyntaxKind::PLUS,
Expand Down
6 changes: 3 additions & 3 deletions parser-ng/src/tokenizer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ enum HexPatternToken<'src> {
#[logos(source = [u8])]
enum HexJumpToken<'src> {
#[token("-")]
Hypen,
Hyphen,

// Integer literals.
#[regex(
Expand Down Expand Up @@ -651,7 +651,7 @@ fn convert_normal_token(token: NormalToken, span: Span) -> Token {
NormalToken::Colon => Token::COLON(span),
NormalToken::Dot => Token::DOT(span),
NormalToken::Equal => Token::EQUAL(span),
NormalToken::Minus => Token::HYPEN(span),
NormalToken::Minus => Token::HYPHEN(span),
NormalToken::Percent => Token::PERCENT(span),
NormalToken::Pipe => Token::PIPE(span),
NormalToken::Plus => Token::PLUS(span),
Expand Down Expand Up @@ -750,7 +750,7 @@ fn convert_hex_pattern_token(token: HexPatternToken, span: Span) -> Token {

fn convert_hex_jump_token(token: HexJumpToken, span: Span) -> Token {
match token {
HexJumpToken::Hypen => Token::HYPEN(span),
HexJumpToken::Hyphen => Token::HYPHEN(span),
HexJumpToken::Whitespace => Token::WHITESPACE(span),
HexJumpToken::Newline => Token::NEWLINE(span),
HexJumpToken::IntegerLit(lit) => {
Expand Down
2 changes: 1 addition & 1 deletion parser-ng/src/tokenizer/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ fn hex_pattern() {
assert_eq!(lexer.next_token(), Some(Token::L_BRACKET(Span(8..9))));
lexer.enter_hex_jump_mode();
assert_eq!(lexer.next_token(), Some(Token::INTEGER_LIT(Span(9..10))));
assert_eq!(lexer.next_token(), Some(Token::HYPEN(Span(10..11))));
assert_eq!(lexer.next_token(), Some(Token::HYPHEN(Span(10..11))));
assert_eq!(lexer.next_token(), Some(Token::INTEGER_LIT(Span(11..13))));
assert_eq!(lexer.next_token(), Some(Token::R_BRACKET(Span(13..14))));
assert_eq!(lexer.next_token(), Some(Token::HEX_BYTE(Span(14..16))));
Expand Down
4 changes: 2 additions & 2 deletions parser-ng/src/tokenizer/tokens.rs
Original file line number Diff line number Diff line change
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::HYPHEN as u8,
HYPHEN(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 Expand Up @@ -390,7 +390,7 @@ impl Token {
| Token::COMMA(span)
| Token::DOT(span)
| Token::EQUAL(span)
| Token::HYPEN(span)
| Token::HYPHEN(span)
| Token::PERCENT(span)
| Token::PIPE(span)
| Token::PLUS(span)
Expand Down

0 comments on commit d7b3479

Please sign in to comment.