cute unicode tricks
This commit is contained in:
@@ -45,6 +45,7 @@ extern {
|
||||
"-" => Token::Operator('-'),
|
||||
"*" => Token::Operator('*'),
|
||||
"/" => Token::Operator('/'),
|
||||
"÷" => Token::Operator('/'),
|
||||
|
||||
// the previous items just match their tokens, and if you try
|
||||
// to name and use "their value", you get their source location.
|
||||
|
||||
@@ -60,6 +60,7 @@ pub enum Token {
|
||||
#[token("}")]
|
||||
CloseBrace,
|
||||
|
||||
#[token("λ")]
|
||||
#[token("lambda")]
|
||||
#[token("function")]
|
||||
Function,
|
||||
@@ -72,7 +73,7 @@ pub enum Token {
|
||||
|
||||
// Next are the operators for NGR. We only have 4, now, but
|
||||
// we might extend these later, or even make them user-definable!
|
||||
#[regex(r"[+\-*/]", |v| v.slice().chars().next())]
|
||||
#[regex(r"[+\-*/÷]", |v| v.slice().chars().next())]
|
||||
Operator(char),
|
||||
|
||||
/// Numbers capture both the value we read from the input,
|
||||
|
||||
Reference in New Issue
Block a user