-
Notifications
You must be signed in to change notification settings - Fork 8
TL1 Features
Meir Cohen edited this page Mar 14, 2018
·
1 revision
Adding features that will make it easier to write more complex compilers:
- better references:
userandownerare generated as pointers,var Stringnow initialize a pointer toString - basic classes: with only instance members
- better expression conversion to C:
=to==,:=to=and.to->,-can be used instead ofminus - arrays support, get item by
[] Type var := arr[index] - update function declaration and call to
func name([params]): [out params] - functions can be called directly after
if,whileand:=, and will evaluate to the last output value
[if/while] func-name([params]): [out params] ...[var] := func-name([params]): [out params] ...
- comments are copied to C
- #include
lumi.1.his generated - all external C code is now in
lumi.1.c - support for variable
argvinput parameter - basic error handling:
raisewill start an error that will terminate the program while writing tostderrthe function call trace (in the generate C code) - adding support for system functios:
exit,systemandgetenv - variables and references are initialized with
(value)(instead of:= value) - support string splitting with
user String ref(some-string[start:length])+ added more string functions - support array splitting with
user Array{Type} ref(some-array[start:length]) - support function references with the
Functype - for loops are now global and cannot be under
doloops:
for n in [value]
# do stuff with n
Suggestions, comments and questions are welcome!
