Irmen de Jong
686b32dc29
replace ^^str by ^^ubyte and allow returning ubyte/uword when pointer is expected
2025-05-16 17:53:15 +02:00
Irmen de Jong
11456496bd
Merge branch 'master' into structs
...
# Conflicts:
# compilerAst/src/prog8/ast/antlr/Antlr2Kotlin.kt
# parser/src/main/antlr/Prog8ANTLR.g4
2025-05-15 21:35:31 +02:00
Irmen de Jong
f5fc4e345c
fix build error on case-insensitive filesystems
2025-05-15 21:11:34 +02:00
Irmen de Jong
f4b2264fcf
fix struct type checks for subroutine call arguments
2025-05-14 23:33:55 +02:00
Irmen de Jong
913ab03963
get rid of invalid ARRAY_STRUCT data type (arrays of struct instance are not yet supported)
2025-05-14 20:43:00 +02:00
Irmen de Jong
38448e471c
Merge branch 'master' into structs
...
# Conflicts:
# codeGenCpu6502/src/prog8/codegen/cpu6502/ForLoopsAsmGen.kt
# codeGenIntermediate/src/prog8/codegen/intermediate/IRCodeGen.kt
# examples/test.p8
2025-05-13 23:42:13 +02:00
Irmen de Jong
435dfbb932
optimize: rewrite suitable when into on..goto
2025-05-13 01:12:58 +02:00
Irmen de Jong
924e28e9b3
Merge branch 'master' into structs
...
# Conflicts:
# codeGenCpu6502/src/prog8/codegen/cpu6502/AsmGen.kt
# compiler/src/prog8/compiler/astprocessing/CodeDesugarer.kt
# compiler/src/prog8/compiler/astprocessing/SimplifiedAstMaker.kt
# compilerAst/src/prog8/ast/AstToSourceTextConverter.kt
# compilerAst/src/prog8/ast/antlr/Antlr2Kotlin.kt
# compilerAst/src/prog8/ast/walk/AstWalker.kt
# compilerAst/src/prog8/ast/walk/IAstVisitor.kt
# docs/source/todo.rst
# examples/test.p8
# parser/src/main/antlr/Prog8ANTLR.g4
2025-05-11 23:23:06 +02:00
Irmen de Jong
31c1bf8bc5
added on..goto/call statement
2025-05-11 21:37:44 +02:00
Irmen de Jong
abbb7d7ba3
fix struct pointers in subroutine parameters and return values
2025-05-11 02:08:59 +02:00
Irmen de Jong
59c378089e
fix some struct type and symbol lookup errors
2025-05-11 00:52:35 +02:00
Irmen de Jong
8353c689ca
start making '&' (address-of) return a typed pointer, fixes some errors
2025-05-08 23:40:41 +02:00
Irmen de Jong
af920d1427
pointer arithmetic for '-', fixed '+'
2025-05-05 21:06:49 +02:00
Irmen de Jong
38949b82c3
type check tuning
2025-05-05 15:41:32 +02:00
Irmen de Jong
d11386ef26
type check tuning
2025-05-04 23:23:21 +02:00
Irmen de Jong
55e0dbab27
preparing for statically allocating struct instances
2025-05-03 23:44:29 +02:00
Irmen de Jong
4dc82f2c83
preparing for statically allocating struct instances
2025-05-03 19:00:27 +02:00
Irmen de Jong
1ba5587404
allow syntax for declaring variables with struct instance type
2025-05-03 16:14:22 +02:00
Irmen de Jong
835c4b6da3
allow multi-field declarations in structs, get rid of . -> ^^ rewrite
2025-05-03 12:32:29 +02:00
Irmen de Jong
dbd955b61e
tweak typecheck and better code for constant indexes in pointer derefs
2025-05-02 23:44:26 +02:00
Irmen de Jong
e0dea89477
added support for ptr[x].field
2025-05-02 22:16:20 +02:00
Irmen de Jong
6fc2902895
fixing ptr traversal typecheck issues
2025-05-02 00:41:42 +02:00
Irmen de Jong
c96e4b40d4
building syntax support for ptr[x].field
...
attempting to do this by making '.' an expression operator
2025-05-02 00:41:42 +02:00
Irmen de Jong
37da3e2170
parser
2025-05-02 00:41:42 +02:00
Irmen de Jong
2661d3c489
allow array syntax on pointers
2025-05-02 00:41:42 +02:00
Irmen de Jong
696bf636ed
better parsing of directive names results in better error messages when an invalid one is found
2025-05-02 00:41:42 +02:00
Irmen de Jong
0162e7a0c1
fix the scoping problems on subtypes
2025-05-02 00:41:42 +02:00
Irmen de Jong
63a410a6df
implicit cast to bool for numeric or pointers as condition arguments (to if, while, until)
2025-05-02 00:41:42 +02:00
Irmen de Jong
803e6bd81a
fix uword vs pointer type errors and casts
2025-05-02 00:41:42 +02:00
Irmen de Jong
b920d553a0
make address-of dereference work
2025-05-02 00:41:42 +02:00
Irmen de Jong
5e2d0d0dfc
fix param order of AssignTarget
2025-05-02 00:41:42 +02:00
Irmen de Jong
2ae3bd68eb
more pointer dereferencing for chains
2025-05-02 00:41:42 +02:00
Irmen de Jong
9c183f27eb
pointer dereferencing for chains
2025-05-02 00:41:42 +02:00
Irmen de Jong
8046023e82
pointer dereferencing for simple types (read and write)
2025-05-02 00:41:42 +02:00
Irmen de Jong
e328520588
initial struct and typed pointer support
2025-05-02 00:41:40 +02:00
Irmen de Jong
b047731f82
removed some redundant arguments
2025-04-25 23:27:06 +02:00
Irmen de Jong
99ae8ea52e
code cleanup
2025-04-24 18:51:03 +02:00
Irmen de Jong
1e702439b7
avoid JDK 21+/Kotlin method conflict of removeLast()/removeFirst()
...
background: see https://www.reddit.com/r/androiddev/comments/1gspjrs/dont_use_kotlins_removefirst_and_removelast_when/
https://youtrack.jetbrains.com/issue/KT-71375/Prevent-Kotlins-removeFirst-and-removeLast-from-causing-crashes-on-Android-14-and-below-after-upgrading-to-Android-API-Level-35
it's about Android but the problem also occurs on desktop JDKs for example when running a Java21 compiled prog8 with Java17
2025-04-24 18:11:42 +02:00
Irmen de Jong
dd2d466350
code cleanups
2025-04-17 22:58:02 +02:00
Irmen de Jong
37b3868ca3
symboldump now also includes aliased symbols (like palette.set_default)
2025-04-08 21:40:28 +02:00
Irmen de Jong
3770a4fe0c
easier datatype notation by just using the type objects directly
2025-03-18 23:33:04 +01:00
Irmen de Jong
a6ba05d60c
compile time evaluation of constant rangecheck
2025-03-01 13:45:11 +01:00
Irmen de Jong
6ff75bef29
fix verafx register address typo VERA_FX_POLY_FILL_H
2025-02-27 21:59:04 +01:00
Irmen de Jong
3e2b2a698d
Separate simple Ast and Symboltable from codeCore into new simpleAst module. VirtualMachine and Intermediate do not need them, just codeCore.
2025-02-24 22:06:52 +01:00
Irmen de Jong
efd41260f2
added %jmptable
2025-02-09 15:02:59 +01:00
Irmen de Jong
75ddcda5f3
simplify DirectiveArg
2025-02-02 04:35:20 +01:00
Irmen de Jong
ee784e1ccc
fix indication for when imported modules are library modules or not.
...
This fixes a bug where syslib and such gets optimized away when it is loaded from an alternative library location using the configurable target library path property setting.
2025-01-26 21:19:29 +01:00
Irmen de Jong
228be5cd04
callgraph no longer forgets some identifier occurrences
2025-01-18 21:18:08 +01:00
Irmen de Jong
08cd2fd6e8
fix check for assigning to a constant, for multi-value assigns.
2025-01-18 20:38:02 +01:00
Irmen de Jong
09a17743ad
merge IMachineDefinition into ICompilationTarget
2025-01-13 21:45:38 +01:00