| author | |
| committer | |
| log | cbd76a10233a219727ef576f0dee88eb5902f798 |
| tree | f4ff3f7c9f9c3dd318b2952ca536b160746a6ef0 |
| parent | b893e32685ff6a5115a0723b9ebf142578c73416 |
2 files changed, 3 insertions(+), 0 deletions(-)
compiler/src/tokenizer.rs+1| ... | @@ -123,6 +123,7 @@ pub fn tokenize(content: String) -> Result<Vec<Token>> { | ... | @@ -123,6 +123,7 @@ pub fn tokenize(content: String) -> Result<Vec<Token>> { |
| 123 | _ => tokens.push(Token::Equals), | 123 | _ => tokens.push(Token::Equals), |
| 124 | }, | 124 | }, |
| 125 | ';' => tokens.push(Token::Semicolon), | 125 | ';' => tokens.push(Token::Semicolon), |
| 126 | '>' => tokens.push(Token::Operator(Operator::GreaterThan)), | ||
| 126 | '+' => tokens.push(Token::Operator(Operator::Add)), | 127 | '+' => tokens.push(Token::Operator(Operator::Add)), |
| 127 | '-' => match chars.peek() { | 128 | '-' => match chars.peek() { |
| 128 | Some((_, '>')) => { | 129 | Some((_, '>')) => { |
compiler/src/util.rs+2| ... | @@ -6,6 +6,7 @@ pub enum Operator { | ... | @@ -6,6 +6,7 @@ pub enum Operator { |
| 6 | Divide, | 6 | Divide, |
| 7 | Power, | 7 | Power, |
| 8 | Equals, | 8 | Equals, |
| 9 | GreaterThan, | ||
| 9 | } | 10 | } |
| 10 | 11 | ||
| 11 | impl Operator { | 12 | impl Operator { |
| ... | @@ -17,6 +18,7 @@ impl Operator { | ... | @@ -17,6 +18,7 @@ impl Operator { |
| 17 | Self::Multiply => "*", | 18 | Self::Multiply => "*", |
| 18 | Self::Power => "**", | 19 | Self::Power => "**", |
| 19 | Self::Equals => "===", | 20 | Self::Equals => "===", |
| 21 | Self::GreaterThan => ">", | ||
| 20 | }) | 22 | }) |
| 21 | } | 23 | } |
| 22 | } | 24 | } |