mirror of https://github.com/rm-dr/daisy
Fixed negative bug
parent
b8e736af45
commit
b71cbcafcd
|
@ -38,12 +38,12 @@ pub fn p_tokenize(input: &String) -> VecDeque<Token> {
|
||||||
// Needs special treatment.
|
// Needs special treatment.
|
||||||
'-' => {
|
'-' => {
|
||||||
if t.is_some() { g.push_back(update_line_location(t.unwrap(), i)); }
|
if t.is_some() { g.push_back(update_line_location(t.unwrap(), i)); }
|
||||||
match g.back() {
|
match g.back().as_ref().unwrap() {
|
||||||
// If previous token was any of the following,
|
// If previous token was any of the following,
|
||||||
// this is the "minus" operator
|
// this is the "minus" operator
|
||||||
Some(Token::Number(_, _)) |
|
Token::PreNumber(_, _) |
|
||||||
Some(Token::PreGroup(_, _)) |
|
Token::PreGroup(_, _) |
|
||||||
Some(Token::PreWord(_, _)) => {
|
Token::PreWord(_, _) => {
|
||||||
t = Some(Token::PreOperator(
|
t = Some(Token::PreOperator(
|
||||||
LineLocation{pos: i, len: 1},
|
LineLocation{pos: i, len: 1},
|
||||||
Operator::Subtract
|
Operator::Subtract
|
||||||
|
@ -118,8 +118,6 @@ pub fn p_tokenize(input: &String) -> VecDeque<Token> {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Word
|
// Word
|
||||||
//'A'..='Z' |
|
|
||||||
//'a'..='z'
|
|
||||||
_ => {
|
_ => {
|
||||||
match &mut t {
|
match &mut t {
|
||||||
Some(Token::PreWord(_, val)) => {
|
Some(Token::PreWord(_, val)) => {
|
||||||
|
|
Loading…
Reference in New Issue