Start refactoring how builtins work
Create an enum of builtin operations to start with
This commit is contained in:
parent
e750247134
commit
bfb36b90e4
@ -4,6 +4,33 @@ use std::collections::HashMap;
|
|||||||
use crate::tokenizing::TokenKind;
|
use crate::tokenizing::TokenKind;
|
||||||
use crate::typechecking::{TypeConst, Type};
|
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)]
|
#[derive(Debug, PartialEq, Clone)]
|
||||||
pub struct BinOp {
|
pub struct BinOp {
|
||||||
sigil: Rc<String>
|
sigil: Rc<String>
|
||||||
|
Loading…
Reference in New Issue
Block a user