CashScript / cashscript

⚖️ Easily write and interact with Bitcoin Cash smart contracts
https://cashscript.org
MIT License
115 stars 80 forks source link

Internally replace function call nodes with operator nodes #26

Open rkalis opened 5 years ago

rkalis commented 5 years ago

Currently the AST includes nodes of the type FunctionCall, which are things like max(int, int). These "functions" are currently stored inside a global symbol table, but since they are essentially language features, there is no reason for these not to be hardcoded. Hardcoding this should simplify the compiler as there is no need to keep a global symbol table for this.

This also frees up the Function Call construct for when libraries or custom functions will be introduced to the language.

rkalis commented 4 years ago

This could also be done for the SizeOp, SplitOp, and TupleIndexOp

rkalis commented 4 years ago

I replaced SizeOp and SplitOp with Unary and Binary operator nodes.