From bfb36b90e445a56f813194dc08cf2d8319c514a3 Mon Sep 17 00:00:00 2001 From: greg Date: Mon, 12 Aug 2019 13:10:22 -0700 Subject: [PATCH] Start refactoring how builtins work Create an enum of builtin operations to start with --- schala-lang/language/src/builtin.rs | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/schala-lang/language/src/builtin.rs b/schala-lang/language/src/builtin.rs index 075410f..7eea68f 100644 --- a/schala-lang/language/src/builtin.rs +++ b/schala-lang/language/src/builtin.rs @@ -4,6 +4,33 @@ use std::collections::HashMap; use crate::tokenizing::TokenKind; use crate::typechecking::{TypeConst, Type}; +#[derive(Debug)] +enum Builtin { + Add, + Subtract, + Negate, + Multiply, + Divide, + Quotient, + Modulo, + Exponentiation, + BitwiseAnd, + BitwiseOr, + BooleanAnd, + BooleanOr, + BooleanNot, + Equality, + LessThan, + LessThanEquals, + GreaterThan, + GreaterThanEquals, + Comparison, + FieldAccess, + IOPrint, + IOPrintLn, + IOGetLine, +} + #[derive(Debug, PartialEq, Clone)] pub struct BinOp { sigil: Rc