Skip to content

Commit

Permalink
Fix return token width (#395)
Browse files Browse the repository at this point in the history
Noticed that the error messages looked weird.
Turns out return token is 6 wide not 5.
  • Loading branch information
JSAbrahams authored Dec 28, 2022
1 parent 986ffda commit fdb95f4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/parse/lex/token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ impl Token {
Token::Do => 2,
Token::Continue => 8,
Token::Break => 5,
Token::Ret => 5,
Token::Ret => 6,
Token::With => 4,
Token::Question => 1,
Token::Handle => 5,
Expand Down
2 changes: 1 addition & 1 deletion src/parse/statement.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ mod test {
panic!("Expected reassignment, was: {:?}", ret.node)
};

assert_eq!(expr.pos, Position::new(CaretPos::new(1, 7), CaretPos::new(1, 9)));
assert_eq!(expr.pos, Position::new(CaretPos::new(1, 8), CaretPos::new(1, 10)));
assert_eq!(expr.node, Node::Int { lit: String::from("20") });
}

Expand Down

0 comments on commit fdb95f4

Please sign in to comment.