Commit Graph

145 Commits

Author SHA1 Message Date
Irmen de Jong
2675623aea fix optimization ast parent linkage problem 2024-04-16 23:27:22 +02:00
Irmen de Jong
731132d4b3 check number of result values in return statements 2024-04-05 02:13:31 +02:00
Irmen de Jong
788f6b44a6 antlr grammar now understands underscores in identifier names 2024-03-31 00:31:10 +01:00
Irmen de Jong
32afcbfe42 compilerAst BOOL type changes 2024-03-02 23:19:20 +01:00
Irmen de Jong
d4a2031c07 fix certain assignment data type mismatch crash 2024-01-25 21:14:20 +01:00
Irmen de Jong
87c46ba730 check boolean array size mismatch.
check for weird string assignment.
check for X16 problematic cpu instructions rmb, smb, bbr, bbs.
tweak number node equality wrt bool type
2024-01-21 19:15:22 +01:00
Irmen de Jong
fdbbd181ea fixes for address-of uword pointer array expressions 2024-01-17 22:51:15 +01:00
Irmen de Jong
f27e3478b9 fix const value of AddressOf for certain types 2024-01-09 22:10:25 +01:00
Irmen de Jong
f2daa17b92 tweak some not optimizations
cleanup IR typestring
2024-01-05 17:49:56 +01:00
Irmen de Jong
6d9fccacb1 boolean not expression tweaks and optimizations 2024-01-05 13:32:16 +01:00
Irmen de Jong
bfd3edb617 fix expression evaluation bug where intermediate values were overwritten, yielding the wrong result 2024-01-04 21:04:11 +01:00
Irmen de Jong
0e086d788b removed chained comparisons again, because they caused invalid expression evaluations due to changed semantics. 2024-01-01 16:00:11 +01:00
Irmen de Jong
d1f8ee1e56 replace most common subexpressions by a single temp variable 2024-01-01 14:57:24 +01:00
Irmen de Jong
932bbd0381 allow casting of byte<->ubyte and word<->uword 2023-12-29 16:23:24 +01:00
Irmen de Jong
ccc11e49d2 fix asmgen for uword shift right 8 or more bits 2023-12-29 05:06:09 +01:00
Irmen de Jong
bcc4bf5c2b almost forgot 2023-12-28 20:39:27 +01:00
Irmen de Jong
09c6cb4d6b replace unwritten vars by consts. Improved const eval.
Fixed some slight bugs in library code
2023-12-28 05:17:15 +01:00
Irmen de Jong
b428343c2a tweak chained comparisons 2023-12-28 02:31:39 +01:00
Irmen de Jong
dfce292294 allow chained comparisons i<x<j (desugared into: i<x and x<j) 2023-12-28 01:18:59 +01:00
Irmen de Jong
5179562fb2 can be val 2023-12-26 19:39:02 +01:00
Irmen de Jong
b7279a3d9e fix 'not in' parsing error
fixes #115
2023-12-19 19:49:25 +01:00
Irmen de Jong
a8be94de6b better error message when attempting to cast a float to integer 2023-12-15 22:28:06 +01:00
Irmen de Jong
ee782e92ac fix cast error and vm float parsing 2023-12-05 22:51:15 +01:00
Irmen de Jong
b09e0a05bf some tweaks to errors about long integer literals 2023-12-03 02:45:26 +01:00
Irmen de Jong
c609e982fe allow const expression intermediate values to be 32 bits integers to avoid needless overflow errors. 2023-12-03 01:48:12 +01:00
Irmen de Jong
3b0d7ea960 better const-evaluation of addressOf a memory mapped variable 2023-11-08 22:04:41 +01:00
Irmen de Jong
880c0a5da8 allow taking address of array element 2023-09-18 04:37:41 +02:00
Irmen de Jong
f98ee326b4 error when doing txt.print('@') where "@" was intended (byte for string parameter) 2023-08-14 19:25:31 +02:00
Irmen de Jong
2c9e50873c use math.square for optimized X*X calculation (words only).
Added IR SQUARE instruction.
2023-08-14 01:05:17 +02:00
Irmen de Jong
c223702ea0 code cleanups 2023-07-30 18:42:45 +02:00
Irmen de Jong
cad18b8a3a uniform symbol prefixing with p8_ 2023-07-02 06:15:02 +02:00
Irmen de Jong
bb9d29b061 fix an array literal assignment type error for word arrays 2023-05-30 22:46:37 +02:00
Irmen de Jong
6218c1c00b fix too greedy expression simplification
could cause problems when variables occur multiple times in the same expression.
Fixes #101
2023-03-22 18:25:28 +01:00
Irmen de Jong
af1b07ad44 add more referencesIdentifier() on ast nodes 2023-03-15 20:44:24 +01:00
Irmen de Jong
f20ca06f85 give correct error when using memory mapped var as array pointer 2023-03-11 00:26:19 +01:00
Irmen de Jong
117d848466 consolidate builtin function definitions into codeCore 2023-01-25 00:23:00 +01:00
Irmen de Jong
8e730ef93d optimizing scoped names more and fix scoping of identifier names in arrays (pointers) in SymbolTable 2022-12-31 03:20:20 +01:00
Irmen de Jong
35af53828a fix endless loop in optimizer, fix cx16 register clobbering in psg interrupt handler, fix crash on certain arrays, fix undefined symbol when it's in another imported module 2022-07-13 18:42:06 +02:00
Irmen de Jong
88cbb6913d tweak bool type handling 2022-07-11 14:55:50 +02:00
Irmen de Jong
7a26646e1b tweak bool type handling 2022-07-11 02:08:12 +02:00
Irmen de Jong
92eb3b0bf6 bool logical testcase 2022-07-09 22:29:38 +02:00
Irmen de Jong
211e2bb37a improved bool type checking 2022-07-08 22:29:13 +02:00
Irmen de Jong
81b3d2db4f fix compiler crash 2022-07-08 21:50:06 +02:00
Irmen de Jong
9500fc11ac document new bool datatype and removal of boolean() conversion function 2022-07-07 22:23:56 +02:00
Irmen de Jong
41f4e22a17 introduce BOOL type 2022-07-07 22:23:56 +02:00
Irmen de Jong
25aad8d7be improve const-evaluation of builtin expressions 2022-07-02 16:29:01 +02:00
Irmen de Jong
97cb0cbd08 tweak "not" removal/rewriting 2022-06-30 02:16:30 +02:00
Irmen de Jong
4b358abbb7 "not" operator removed from ast and codegen (it's been replaced with x==0 as equivalent) 2022-06-29 01:13:08 +02:00
Irmen de Jong
ef92451d1a fix logical expressions on arbitrary values, for now with boolean() around the operands 2022-06-28 01:18:36 +02:00
Irmen de Jong
bf9d120081 logical operators now always return a boolean byte result, instead of sometimes word type as well
(preparing for codegen simplifications for these)
2022-06-13 01:37:16 +02:00