projects
/
fur
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add an interpreter
[fur]
/
crossplatform_ir_generation.py
diff --git
a/crossplatform_ir_generation.py
b/crossplatform_ir_generation.py
index
49e7408
..
c67a5f4
100644
(file)
--- a/
crossplatform_ir_generation.py
+++ b/
crossplatform_ir_generation.py
@@
-39,6
+39,10
@@
def generate_symbol_literal(symbol):
def generate_instruction_name_from_builtin(builtin):
try:
return {
def generate_instruction_name_from_builtin(builtin):
try:
return {
+ # Environment operations
+ '__get__': 'get',
+
+ # Integer operations
'__add__': 'add',
'__integer_divide__': 'idiv',
'__modular_divide__': 'mod',
'__add__': 'add',
'__integer_divide__': 'idiv',
'__modular_divide__': 'mod',
@@
-46,12
+50,19
@@
def generate_instruction_name_from_builtin(builtin):
'__negate__': 'neg',
'__subtract__': 'sub',
'__negate__': 'neg',
'__subtract__': 'sub',
+ # Boolean operations
'__eq__': 'eq',
'__neq__': 'neq',
'__lt__': 'lt',
'__lte__': 'lte',
'__gt__': 'gt',
'__gte__': 'gte',
'__eq__': 'eq',
'__neq__': 'neq',
'__lt__': 'lt',
'__lte__': 'lte',
'__gt__': 'gt',
'__gte__': 'gte',
+
+ # String operations
+ '__concat__': 'concat',
+
+ # Structure operations
+ '__field__': 'field',
}[builtin]
except KeyError:
}[builtin]
except KeyError: