forked from AbleScript/ablescript
Removed ! for ain't
This commit is contained in:
parent
19fa04f979
commit
89326fd344
|
@ -152,7 +152,7 @@ pub enum Expr {
|
||||||
rhs: Box<Spanned<Expr>>,
|
rhs: Box<Spanned<Expr>>,
|
||||||
kind: BinOpKind,
|
kind: BinOpKind,
|
||||||
},
|
},
|
||||||
Not(Box<Spanned<Expr>>),
|
Aint(Box<Spanned<Expr>>),
|
||||||
Literal(Value),
|
Literal(Value),
|
||||||
Cart(Vec<(Spanned<Expr>, Spanned<Expr>)>),
|
Cart(Vec<(Spanned<Expr>, Spanned<Expr>)>),
|
||||||
Index {
|
Index {
|
||||||
|
|
|
@ -174,7 +174,7 @@ impl ExecEnv {
|
||||||
NotEqual => Value::Abool((lhs != rhs).into()),
|
NotEqual => Value::Abool((lhs != rhs).into()),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Not(expr) => !self.eval_expr(expr)?,
|
Aint(expr) => !self.eval_expr(expr)?,
|
||||||
Literal(value) => value.clone(),
|
Literal(value) => value.clone(),
|
||||||
Expr::Cart(members) => Value::Cart(
|
Expr::Cart(members) => Value::Cart(
|
||||||
members
|
members
|
||||||
|
|
|
@ -59,8 +59,8 @@ pub enum Token {
|
||||||
#[token("!=")]
|
#[token("!=")]
|
||||||
NotEqual,
|
NotEqual,
|
||||||
|
|
||||||
#[regex("!|ain't")]
|
#[token("ain't")]
|
||||||
Not,
|
Aint,
|
||||||
|
|
||||||
// Keywords
|
// Keywords
|
||||||
#[token("functio")]
|
#[token("functio")]
|
||||||
|
|
|
@ -103,7 +103,7 @@ impl<'source> Parser<'source> {
|
||||||
Token::Identifier(_)
|
Token::Identifier(_)
|
||||||
| Token::String(_)
|
| Token::String(_)
|
||||||
| Token::Integer(_)
|
| Token::Integer(_)
|
||||||
| Token::Not
|
| Token::Aint
|
||||||
| Token::LeftBracket
|
| Token::LeftBracket
|
||||||
| Token::LeftParen => Ok(Spanned::new(
|
| Token::LeftParen => Ok(Spanned::new(
|
||||||
self.value_flow(token)?,
|
self.value_flow(token)?,
|
||||||
|
@ -213,10 +213,10 @@ impl<'source> Parser<'source> {
|
||||||
start..self.lexer.span().end,
|
start..self.lexer.span().end,
|
||||||
)),
|
)),
|
||||||
|
|
||||||
Token::Not => Ok(Spanned::new(
|
Token::Aint => Ok(Spanned::new(
|
||||||
{
|
{
|
||||||
let next = self.checked_next()?;
|
let next = self.checked_next()?;
|
||||||
Expr::Not(Box::new(self.parse_expr(next, buf)?))
|
Expr::Aint(Box::new(self.parse_expr(next, buf)?))
|
||||||
},
|
},
|
||||||
start..self.lexer.span().end,
|
start..self.lexer.span().end,
|
||||||
)),
|
)),
|
||||||
|
|
Loading…
Reference in a new issue