Add new_instance method

This commit is contained in:
Windel Bouwman
2018-07-14 12:14:16 +02:00
parent 66ff3f0bc3
commit e6493ec996
14 changed files with 295 additions and 150 deletions

View File

@@ -133,6 +133,10 @@ CompOp: ast::Comparison = {
"<=" => ast::Comparison::LessOrEqual,
">" => ast::Comparison::Greater,
">=" => ast::Comparison::GreaterOrEqual,
"in" => ast::Comparison::In,
"not" "in" => ast::Comparison::NotIn,
"is" => ast::Comparison::Is,
"is" "not" => ast::Comparison::IsNot,
};
Expression: ast::Expression = {
@@ -280,20 +284,22 @@ extern {
"<=" => lexer::Tok::LessEqual,
">" => lexer::Tok::Greater,
">=" => lexer::Tok::GreaterEqual,
"assert" => lexer::Tok::Assert,
"import" => lexer::Tok::Import,
"break" => lexer::Tok::Break,
"continue" => lexer::Tok::Break,
"return" => lexer::Tok::Return,
"pass" => lexer::Tok::Pass,
"if" => lexer::Tok::If,
"while" => lexer::Tok::While,
"for" => lexer::Tok::For,
"in" => lexer::Tok::In,
"with" => lexer::Tok::With,
"as" => lexer::Tok::As,
"def" => lexer::Tok::Def,
"assert" => lexer::Tok::Assert,
"break" => lexer::Tok::Break,
"class" => lexer::Tok::Class,
"continue" => lexer::Tok::Break,
"def" => lexer::Tok::Def,
"for" => lexer::Tok::For,
"if" => lexer::Tok::If,
"in" => lexer::Tok::In,
"is" => lexer::Tok::Is,
"import" => lexer::Tok::Import,
"not" => lexer::Tok::Not,
"pass" => lexer::Tok::Pass,
"return" => lexer::Tok::Return,
"while" => lexer::Tok::While,
"with" => lexer::Tok::With,
"True" => lexer::Tok::True,
"False" => lexer::Tok::False,
"None" => lexer::Tok::None,