Skip to content

Commit

Permalink
修复'+''-'定位的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
DingWH03 committed Apr 20, 2024
1 parent 10f1fee commit 52e2dae
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion source.c
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
*a=2;
*a=2;
int c = a+2;
4 changes: 2 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,7 @@ impl Lexer {
self.tokens.push(Token::Operators(Operator::Add));
self.tokens_location.push(TokenLocation {
row: self.row,
col: self.col,
col: self.col-1,
});
self.state = State::Start;
return ptr_index;
Expand Down Expand Up @@ -812,7 +812,7 @@ impl Lexer {
self.tokens.push(Token::Operators(Operator::Subtract));
self.tokens_location.push(TokenLocation {
row: self.row,
col: self.col,
col: self.col-1,
});
self.state = State::Start;
return ptr_index;
Expand Down

0 comments on commit 52e2dae

Please sign in to comment.