fix(ast): SelfInc use wrong way to recognize
This commit is contained in:
+18
-2
@@ -269,8 +269,24 @@ fn parse_puncuation(
|
||||
};
|
||||
let c = str_iter.peek().ok_or(LexParseError::NotMatched)?;
|
||||
let token_value = match c {
|
||||
'+' => TokenValue::Plus,
|
||||
'-' => TokenValue::Minus,
|
||||
'+' => {
|
||||
str_iter.advance(1);
|
||||
if let Some('+') = str_iter.peek() {
|
||||
TokenValue::PlusPlus
|
||||
} else {
|
||||
str_iter.back(1);
|
||||
TokenValue::Plus
|
||||
}
|
||||
},
|
||||
'-' => {
|
||||
str_iter.advance(1);
|
||||
if let Some('-') = str_iter.peek() {
|
||||
TokenValue::MinusMinus
|
||||
} else {
|
||||
str_iter.back(1);
|
||||
TokenValue::Minus
|
||||
}
|
||||
},
|
||||
'*' => TokenValue::Star,
|
||||
'/' => TokenValue::Slash,
|
||||
'%' => TokenValue::Percent,
|
||||
|
||||
Reference in New Issue
Block a user