Irmen de Jong
a23281afab
added experimental -noreinit option
2022-01-01 16:35:36 +01:00
Irmen de Jong
c15a75556d
Merge branch 'master' into c128target
...
# Conflicts:
# compiler/src/prog8/CompilerMain.kt
# examples/test.p8
2021-12-30 18:22:05 +01:00
Irmen de Jong
5267e06969
added -asmlist cli option to produce assembler listing output
2021-12-30 14:42:09 +01:00
Irmen de Jong
05a1ddad05
Merge branch 'master' into c128target
...
# Conflicts:
# examples/test.p8
2021-12-29 18:14:24 +01:00
Irmen de Jong
de6ce4a46e
add "X in [1,2,3]" expression (efficient containment check)
2021-12-29 17:26:00 +01:00
Irmen de Jong
7a9e5afb93
fix: for loop over array literal no longer crashes the compiler
2021-12-28 17:51:38 +01:00
Irmen de Jong
b2876b0a03
add a suggestion to use when statement if it seems appropriate
2021-12-28 16:38:12 +01:00
Irmen de Jong
30f04962d4
Merge branch 'master' into c128target
...
# Conflicts:
# codeGeneration/src/prog8/codegen/target/C128Target.kt
# codeGeneration/src/prog8/codegen/target/c128/C128MachineDefinition.kt
# codeGeneration/src/prog8/codegen/target/c128/C128Zeropage.kt
# compiler/src/prog8/CompilerMain.kt
# compiler/src/prog8/compiler/Compiler.kt
2021-12-28 14:30:11 +01:00
Irmen de Jong
0feeb88024
codegen package rename 2
2021-12-28 14:23:36 +01:00
Irmen de Jong
56d21de001
Merge branch 'master' into c128target
...
# Conflicts:
# examples/test.p8
2021-12-28 13:57:27 +01:00
Irmen de Jong
7b54aa0c7d
more consistent naming of the statement classes
2021-12-28 13:56:47 +01:00
Irmen de Jong
6e11b8ada1
GoSub no longer inherits from Jump node, fixes subtle ast/codegen bugs related to jsrs
2021-12-28 01:55:13 +01:00
Irmen de Jong
67b0890a6e
remove unneeded var inits when an assignment is already present
2021-12-25 23:31:25 +01:00
Irmen de Jong
6da83e2bd7
first steps to add C128 compiler target
2021-12-21 19:08:33 +01:00
Irmen de Jong
77c2b2b326
fix position of @shared in array var declarations so that the order is now type[] @shared
2021-12-16 20:36:05 +01:00
Irmen de Jong
629117e594
code size optimization: subroutine calls with 1 int arg will pass it via register instead of separate param assignment at every call site
2021-12-16 00:56:59 +01:00
Irmen de Jong
1ff13723fe
implicit int to float conversion is now an error if floats are not enabled.
2021-12-15 01:52:28 +01:00
Irmen de Jong
510bda1b28
fix compiler crash when using floats in a comparison expression
2021-12-15 01:24:25 +01:00
Irmen de Jong
3d743a1ba1
added more constfolding
2021-12-09 23:32:48 +01:00
Irmen de Jong
abca618008
added more constfolding
2021-12-09 23:12:12 +01:00
Irmen de Jong
0d2c3901a3
added more constfolding
2021-12-09 22:12:31 +01:00
Irmen de Jong
d8d56b195f
comments
2021-12-09 21:13:13 +01:00
Irmen de Jong
98315de723
allow using ubyte[] as subroutine parameter type (because it is equivalent to uword pointer var)
2021-12-07 23:28:45 +01:00
Irmen de Jong
dcf487bdc1
fix: correctly insert return statement if needed to prevent 'fall through' into following subroutine
...
this wasn't working correctly anymore when the last statement before the subroutine was a jump/goto
2021-12-07 21:34:50 +01:00
Irmen de Jong
837804b231
test for string x and u escape sequences
2021-12-05 18:39:34 +01:00
Irmen de Jong
0018dc6ce7
refactor machinedefinition
2021-12-04 19:07:19 +01:00
Irmen de Jong
0498444ef2
moved all unit tests into single project to avoid dependency issues
2021-12-04 18:20:22 +01:00
Irmen de Jong
ce3c34e458
tweak in error output for file links, corrected column number off-by-one
2021-12-04 16:52:03 +01:00
Irmen de Jong
b867d8f731
cleanups
2021-12-04 01:03:51 +01:00
Irmen de Jong
b7fffbb6df
release 7.4.1 - oops, funcion call arg count validation was broken
2021-12-01 21:44:03 +01:00
Irmen de Jong
3d1d0696b9
refactor compiler arguments passing
2021-11-30 01:40:21 +01:00
Irmen de Jong
9ecf95b075
fix syntaxerror in const processing of ranges if it contained variables
2021-11-29 23:36:41 +01:00
Irmen de Jong
a2db44f80c
also consider Y register for clobber check for functioncall arguments
2021-11-29 22:09:05 +01:00
Irmen de Jong
c838821615
refactor fuction arguments codegen a bit
2021-11-27 21:14:21 +01:00
Irmen de Jong
110e047681
replace subroutine calls (statement) by GoSub
2021-11-26 19:47:01 +01:00
Irmen de Jong
17d403d812
Merge branch 'ref-subroutine-param' into v7.4-dev
...
# Conflicts:
# compilerAst/src/prog8/ast/AstToplevel.kt
2021-11-26 01:12:14 +01:00
Irmen de Jong
e52d05c7db
fix some scoping related symbol lookup issues, clarified scoping rules in docs
2021-11-23 23:43:23 +01:00
Irmen de Jong
b00db4f8a2
no longer report unknown type errors as well for unknown symbols,
...
added a bunch more unit tests for symbol scoping rules
2021-11-23 22:45:57 +01:00
Irmen de Jong
ff715881bc
allow scoped identifiers to reference a subroutine parameter directly.
...
also for asmsubroutines, but the asm generation for that is not yet done.
2021-11-21 23:21:39 +01:00
Irmen de Jong
8887e6af91
fix substituting 0 only if its actually the same variable that's substituted
2021-11-21 12:34:57 +01:00
Irmen de Jong
b292124f3c
replaced many short/int values by unsigned types if appropriate
2021-11-21 00:55:56 +01:00
Irmen de Jong
c0035ba1a2
char encodings now use UByte type instead of short
2021-11-21 00:07:17 +01:00
Irmen de Jong
adfaddbcf4
give a nicer error when given a wrong compilation target.
2021-11-20 18:30:55 +01:00
Irmen de Jong
74db5c6be7
fix referencesIdentifier() and better removal of unnecessary assignments
2021-11-20 17:41:41 +01:00
Irmen de Jong
f9399bcce7
r=(q+r)-c and r=q+(r-c) are now both also 'augmentable', and BinExprSplitter doesn't check for associativeOperator anymore
2021-11-20 02:03:32 +01:00
Irmen de Jong
87600b23db
fix constvalue parent linkage for prefix and typecast
2021-11-20 00:20:35 +01:00
Irmen de Jong
cedfb17b18
fix too aggressive removal of vars that weren't completely unused
2021-11-19 22:49:35 +01:00
Irmen de Jong
fa4c83df6b
added 3 tests for discovered problems
2021-11-18 23:55:20 +01:00
Irmen de Jong
42c8720e8b
fix float rounding tests
2021-11-18 22:54:49 +01:00
Irmen de Jong
b334d89715
refactor and fix the way memory addresses are checked to be in IO space or regular ram
2021-11-18 22:47:58 +01:00
Irmen de Jong
4c82af36e6
fix improperly changed behavior about =0 initializer
2021-11-18 00:17:22 +01:00
Irmen de Jong
dafa0d9138
fix compiler crash bug due to reused ast expression nodes. Now all (relevant) Nodes have a copy() function to make a clone.
2021-11-17 23:05:59 +01:00
Irmen de Jong
f48d6ca9f8
simplified NumericLiteral to always just contain a Double instead of a Number for the value
2021-11-16 23:52:54 +01:00
Irmen de Jong
c858ceeb58
compiler shouldn't use cx16.r15 as temp var
2021-11-14 02:38:59 +01:00
Irmen de Jong
f0f52b9166
optimize typecasted binary expression to avoid even more estack use. also fix wrong parent crash in removal of unused variable's assignments.
2021-11-13 14:22:37 +01:00
Irmen de Jong
3483515346
preparing for more optimizations
2021-11-12 23:23:51 +01:00
Irmen de Jong
75a06d2a40
preparing for more optimizations
2021-11-12 02:17:37 +01:00
Irmen de Jong
53ac11983b
better unused variable removal
2021-11-11 03:03:21 +01:00
Irmen de Jong
8df3da11e3
add cosr8, sinr8, cosr16 and sinr16 builtin functions that take a degree 0..179 (= 0..358 in 2 degree steps)
...
to more easily scale halves/quarters etc of a circle than possible with the ones that take 0..255 'degrees'.
2021-11-09 23:39:26 +01:00
Irmen de Jong
b909facfe5
fix compiler stackoverflow crash on certain typecasted expressions containing floats.
2021-11-09 19:31:19 +01:00
Irmen de Jong
7780d94de1
discovered crash related to float typecasting in asm assignment codegen
2021-11-09 03:45:07 +01:00
Irmen de Jong
4937e004b5
fix compiler crash where it used wrong datatype in split assignment
...
fixes crash for "ubyte bb ;; uword ww ;; bb = not bb or not ww"
2021-11-09 01:13:23 +01:00
Irmen de Jong
2d1e5bbc7e
remove unimportant empty tests
2021-11-08 17:00:10 +01:00
Irmen de Jong
7961a09d16
converting compiler module's testcases to kotest assertions
2021-11-08 16:14:22 +01:00
Irmen de Jong
613efcacc7
converting compiler module's testcases to kotest (ongoing)
2021-11-08 15:08:48 +01:00
Irmen de Jong
eea3fb48a8
add command line option 'optfloatx' to explicitly re-enable float expr optimization as this can increase code size significantly.
...
The output size of the various example programs using floating point, when not using this optimization, has been reduced significantly.
The resulting code runs a (tiny) bit slower though.
2021-11-03 22:52:08 +01:00
Irmen de Jong
b4fa72c058
fix parent node linkage for reading array parameter
2021-11-03 21:57:31 +01:00
Irmen de Jong
7e287a5359
proper parent node linkage in generated const values out of typecast expressions. Fixes crash mentioned in #72
2021-11-02 00:47:01 +01:00
Irmen de Jong
1110bd0851
fix vardecl initialization value to not use stack eval anymore but separate assignment
...
(this causes the optimized assignment code gen to be used instead)
but some programs now end up larger in output size
2021-11-01 00:24:15 +01:00
Irmen de Jong
dfbef8495d
got rid of ParsingFailedError
2021-10-30 17:05:23 +02:00
Irmen de Jong
7b17c49d8f
update petscii tables with improvements to box drawing chars. fixes #68
2021-10-30 16:45:23 +02:00
Irmen de Jong
4b3f31c2ee
added option to suppress assembler output (and enabled this in unit tests)
2021-10-30 15:26:40 +02:00
Irmen de Jong
9ccc65bf8f
more petscii tests
2021-10-30 15:15:11 +02:00
Irmen de Jong
3767b4bbe7
'Program' is not an ast Node
2021-10-30 00:25:34 +02:00
Irmen de Jong
d7d2eefa4f
implemented CharLiteral.constValue()
2021-10-30 00:05:55 +02:00
Irmen de Jong
6737f28d1e
moved unittests of compilerInterfaces into compiler module itself
2021-10-29 23:46:51 +02:00
Irmen de Jong
3da9404c2d
removed memsizer arg from all builtin functions
2021-10-29 23:38:31 +02:00
Irmen de Jong
1137da37c3
reshuffle ErrorReporter
2021-10-29 17:02:03 +02:00
Irmen de Jong
495a18805c
move asmgen test to codeGeneration module
2021-10-29 16:20:53 +02:00
Irmen de Jong
a226b82d0b
cleanup imports
2021-10-29 05:30:12 +02:00
Irmen de Jong
0b5ddcdc9b
split out the code generator into own project submodule
2021-10-29 05:00:30 +02:00
Irmen de Jong
f21dcaa6fb
split out the code optimizers into own project submodule
2021-10-29 02:42:10 +02:00
Irmen de Jong
7d22b9b9f9
simplified name conflict check for sub params
2021-10-29 00:20:33 +02:00
Irmen de Jong
2bf4017f2b
fix nested label lookups in anon scopes
...
fixed non-global qualified names lookup
2021-10-28 23:48:01 +02:00
Irmen de Jong
08d2f8568b
refactoring symbol lookups
2021-10-27 23:48:12 +02:00
Irmen de Jong
ac5f45d2d4
fix nested label lookups in anon scopes (partly)
2021-10-27 02:41:24 +02:00
Irmen de Jong
9684f4e42a
add unit tests for AnonScope refactoring, cleaned up imports
2021-10-27 00:05:46 +02:00
Irmen de Jong
5e1459564a
no longer take AddressOf a str-variable that is a subroutine's parameter with str type (it's just an address/uword already)
2021-10-25 23:49:01 +02:00
Irmen de Jong
69a8813a3d
first steps to add support for str parameter type
2021-10-24 20:57:10 +02:00
Irmen de Jong
17175df835
more precise error messages checks
2021-10-24 19:14:46 +02:00
Irmen de Jong
6b32535cb6
don't complain about uninitialized str var if it's not a var
2021-10-24 15:13:38 +02:00
Irmen de Jong
2815a14bb5
(7.2) can now test for specific error messages, and specify to omit invoking assembler in tests
2021-10-22 01:25:26 +02:00
Irmen de Jong
f4dfa60790
(7.2) tests for pass by ref parameters
2021-10-22 00:41:34 +02:00
Irmen de Jong
4d5094a517
(7.2) cleanup Petscii converter errorhandling, add unit tests for error scenarios
2021-10-20 23:48:20 +02:00
Irmen de Jong
dd5abae721
move testcase to proper location
2021-10-20 23:08:40 +02:00
Irmen de Jong
440abf4998
fix test to recognise inserted return statements
2021-10-20 22:50:18 +02:00
Irmen de Jong
df2d5c6585
tests for callgraph and unused subroutine removal in optimizer
2021-10-20 22:24:10 +02:00
Irmen de Jong
82d20dea39
a few comment and TODO cleanups.
...
remove remark about chars UBYTE type, kotlin's closest native type that can contain 0-255 is a short.
2021-10-19 23:20:34 +02:00
Irmen de Jong
804bb06859
clarified isInRegularRAM() by making it an extension method on AssignTarget
2021-10-19 22:36:05 +02:00
Irmen de Jong
5afa7e53f8
got rid of program arg for isInRegularRAM
2021-10-19 22:30:30 +02:00
Irmen de Jong
552e0c2248
rename mainModule to toplevelModule.
...
failed module no longer retains in the Ast.
improved some tests on that.
2021-10-19 21:49:05 +02:00
Irmen de Jong
502bf90007
comments
2021-10-19 01:12:28 +02:00
Irmen de Jong
aea364e43d
paths are now always relative to the current directory. Fixes #64
2021-10-16 14:26:33 +02:00
Irmen de Jong
06defd0cb0
paths are now always relative
2021-10-16 02:43:22 +02:00
Irmen de Jong
16ed68c1ec
Module.name is now derived back from the source's origin string
2021-10-14 23:58:14 +02:00
Irmen de Jong
e63cf660c6
petscii now use Result instead of Either
2021-10-13 23:22:46 +02:00
Irmen de Jong
aaff484306
refactor executeImportDirective
2021-10-13 23:14:27 +02:00
Irmen de Jong
0447b3e4cc
remove testcase that attempted to check invalid %import syntax.
...
we only allow unquoted names, without filename suffix, in %import.
2021-10-13 22:10:35 +02:00
Irmen de Jong
d790878af6
enabled test
2021-10-13 20:28:42 +02:00
Irmen de Jong
6070afa6b6
cleanup SourceCode class
2021-10-13 19:16:01 +02:00
Irmen de Jong
6b8c3ef614
renamed command line option -libdirs to -srcdirs
...
this more clearly separates this meaning from the internal library modules
2021-10-13 18:16:51 +02:00
Irmen de Jong
66574d058a
renamed InferredType.typeOrElse to getOr()
...
this is closer to the convention of most functional return types
2021-10-13 00:21:38 +02:00
Irmen de Jong
1c7c67060d
better result and error handling for importModule()
2021-10-12 23:54:48 +02:00
Irmen de Jong
9827ee97ad
better returnvalue/errorhandling for Petscii encoding
2021-10-12 23:26:45 +02:00
Irmen de Jong
e5a1b37981
simplify
2021-10-12 01:22:17 +02:00
Irmen de Jong
30aa72dc8e
fix unittest and use kotlin.test method to test for exceptions
2021-10-11 21:22:06 +02:00
Irmen de Jong
2c2d474059
fix crash when attempting to import non-existing module
2021-10-11 20:37:55 +02:00
Irmen de Jong
2d26b9c994
fixed module parent linking mistakes in unit tests: module's parent should always be the GlobalNamespace
2021-10-11 01:34:55 +02:00
Irmen de Jong
f38fe092ee
optimized imports
2021-10-11 00:22:04 +02:00
Irmen de Jong
5db0408b9f
syntactic sugar: turned some functions into read only properties
2021-10-11 00:05:51 +02:00
Irmen de Jong
73838ccb8b
ref github issue
2021-10-10 23:00:31 +02:00
Irmen de Jong
371d4768e6
fix filename case issue
2021-10-09 17:59:40 +02:00
Irmen de Jong
7241cef7a5
fix char range in float-range test and exclude test.p8 example from tests
2021-09-12 18:59:53 +02:00
Irmen de Jong
5145296486
fix test assertion for float ranges (and re-enable test)
2021-09-12 18:53:12 +02:00
Irmen de Jong
2cbf2d2226
fix regression in imported module order (reversed)
...
this caused an error in determining the main module and correct compilation options
2021-09-12 18:16:24 +02:00
meisl
ac02a99934
* move ModuleImporter to prog8.compiler (package & module), together with its tests
2021-08-02 10:07:19 +02:00
meisl
fb67d1155f
* structure TestCompilerOnImportsAndIncludes, add (@Disabled for now) test re %import with string arg
2021-08-02 08:57:09 +02:00
meisl
eb46852bb9
* restrict access to Program.modules, add tests
2021-08-02 08:15:20 +02:00
meisl
c914f7bbcf
+ TestCompilerOptionLibdirs.kt: libdirs option doesn't seem to work
2021-08-01 10:16:37 +02:00
meisl
1b451180c1
* test helpers assumeXyz (helpers/paths.kt) return the resulting path (unless they fail, of course); test directories are checked automatically at init, so no sanityCheckDirectories is needed anymore
2021-07-31 14:44:02 +02:00
meisl
e1026584c8
* split up test helpers into separate files, move mapCombinations(..) down to compilerAst/test/helpers since they're generic and don't depend on compiler
2021-07-30 18:37:12 +02:00
meisl
4c615e4fac
* solve problem re shared test helpers: a) don't use the same file name (results in same JVM class name) & b) tell gradle about it (put them in extra dir(s) test/helpers/ and add this to test source set)
2021-07-30 17:19:44 +02:00
meisl
db76c8d7f4
-/* remove IStringEncoding as param in compilerAst, and all other uses that were only because of that.
...
For good measure we also turn on *all* compiler tests with examples (they do take some time).
Note that the total *mentions* of IStringEncoding in the entire project went down from ~50 to 6, only 3 of which are *actual uses* (the others are 2 imports and 1 supertype ref in ICompilationTarget : IStringEncoding)!
2021-07-17 22:08:17 +02:00
meisl
522bf91c30
* refactor RangeExpr, step 2: make toConstantIntegerRange and size *extension methods* and move them to compiler/astprocessing/AstExtensions.kt (along with the simple helper makeRange). They are in fact *only* used from the compiler module - strong indication that they actually belong there.
2021-07-17 21:13:34 +02:00
meisl
48d3abc1fe
* refactor RangeExpr, step 1: remove IStringEncoding as ctor arg and instead put it as arg to the two methods that actually depend on it: toConstantIntegerRange and size (as *it* calls the former)
2021-07-17 20:45:17 +02:00
meisl
3f6f25e06f
* @Disable tests re unsolved #55 , "float[] initializer with range and no explicit array size"
2021-07-17 17:12:16 +02:00
meisl
34ba07ee3b
+ expose #55 : float[] initializer as range where no array size is stated
2021-07-17 16:30:16 +02:00
meisl
ac37319d20
Merge branch 'bug_asmbinary' into testability_steps_1_2_3_again
2021-07-17 15:08:32 +02:00
meisl
b2c6274f74
* fix #54 / step 3: avoid some (= not all) complaints re the .binary filename 64tass still had/has.
...
Actually, I don't quite understand why it still says "not the real name of the file". The 64tass docs say:
> -Wno-portable
> Don't warn about source portability problems.
> These cross platform development annoyances are checked for:
> * Case insensitive use of file names or use of short names.
> * Use of backslashes for path separation instead of forward slashes.
> * Use of reserved characters in file names.
> * Absolute paths
2021-07-17 13:03:05 +02:00
meisl
ee115b3337
+ expose #54 , %asmbinary when outputDir != workingDir; also: refactor compiler tests on examples and add test helpers
2021-07-17 13:02:20 +02:00
meisl
82f5a141ed
* reintroduce the conversion of CharLiteral to UBYTE literals, but now *during AST preprocessing*, not in the parser
2021-07-11 22:03:32 +02:00
meisl
0567168ea9
+ add AST node CharLiteral, *without* turning them into ubyte s. This breaks tests, particularly 3 in TestCompilerOnCharLit. I'm comitting this separately since the failure modes might be of interest (compiler says "internal error").
2021-07-11 21:32:18 +02:00
meisl
c80a15846d
* some more housekeeping re tests: gradle doesn't like .* imports for annotations, added @Disabled comments, made warnings go away
2021-07-11 19:04:53 +02:00
meisl
5e194536a8
* refactor compiler tests, again prog8test.helpers (TODO: remove duplication)
2021-07-11 18:18:27 +02:00
meisl
cd295228ef
+ TestCompilerOnImportsAndIncludes.kt: 2 tests, both passing (but see FIXME in asmIncludeFromSameFolder.p8)
2021-07-11 15:33:44 +02:00
meisl
39d5b7edb0
+ test examples for both platforms, cx16 and c64; test two more: tehtriz and textelite (the largest ones, 20KB / 36KB)
2021-07-10 21:41:51 +02:00
meisl
ddaef3e5d5
+ add tests for SourceCode.fromResources; refactor tests
2021-07-10 20:55:23 +02:00
meisl
19bb56df47
* no more scattering magic "@embedded@" all over the place: add SourceCode.isFromResources, *change Module.source from type Path to type SourceCode*
2021-07-09 17:32:33 +02:00
meisl
81abf29bec
Merge branch 'irmen:v7.1' into v7.1
2021-07-09 11:03:31 +02:00
Irmen de Jong
a7736d88a9
got rid of Module.isLibraryModule variable, is now function that derives it from source path
2021-07-04 15:44:25 +02:00
meisl
07d8052a57
* fix comments: no more problem with exitProcess
2021-07-02 13:28:19 +02:00
meisl
db9edb477e
* less confusing assertion messages (seemingly contradictory in case of failure)
2021-07-02 12:38:24 +02:00
Irmen de Jong
9bd3a6758a
improve testability: use error returnvalues instead of using exitProcess()
2021-07-02 00:11:21 +02:00
meisl
006059438f
+ same warning on the other "TestCompilerXyz" file
2021-06-28 18:49:01 +02:00
meisl
84ea3b9788
+ compiler/test/TestCompilerOnExamples.kt: *not actually unit tests - just a kludge!* (but better than nothing)
2021-06-28 18:42:05 +02:00
meisl
b667abde10
+ compiler/test/TestCompilerOnCharLit.kt
2021-06-28 18:24:35 +02:00
Irmen de Jong
19e99204b9
fix asm symbol name scoping bug and add unit tests for this
2021-06-04 22:42:28 +02:00
Irmen de Jong
3a2498401d
working on unit tests for symbol scope bug
2021-06-03 21:21:38 +02:00
Irmen de Jong
53b20ba625
name
2021-06-01 22:22:58 +02:00
Irmen de Jong
e7f6f0950f
identified asm symbol name scoping bugs
2021-06-01 22:21:50 +02:00
Irmen de Jong
078485134d
split up unittests files
2021-06-01 22:07:39 +02:00
Irmen de Jong
c03f6604af
added free words counting method to zeropage
2021-05-30 00:55:11 +02:00
Irmen de Jong
0e614ad6fc
added @shared flag to vardecl to mark variable as shared with assembly code elsewhere, to not have it optimized away
2021-05-19 01:19:25 +02:00
Irmen de Jong
ba96a637be
remove strdedup compiler argument again
...
(string deduplication is the default again but only for known-const strings, i.e. string literals)
2021-05-18 23:52:43 +02:00
Irmen de Jong
25d80f4df1
added compiler option to choose string literal deduplication yes/no -- default changed to NO
2021-05-13 00:35:22 +02:00
Irmen de Jong
a9a7068818
removed support for structs. It was too much hassle and complexity and subtle bugs.
2021-04-29 00:01:20 +02:00
Irmen de Jong
2b7b925090
codegen now uses correct machine target's string encoder/decoder. Encoding more robust by checking upper case mapping if lowercase mapping fails.
2021-04-09 23:33:32 +02:00
Irmen de Jong
b29f04ce01
fix unittest
2021-03-31 20:49:35 +02:00
Irmen de Jong
3e286dd14c
move test
2021-03-18 19:34:54 +01:00
Irmen de Jong
11247d52b1
fix bugs in word <= and >= comparisons
2021-03-18 19:20:48 +01:00
Irmen de Jong
1dbc902513
fix bugs in uword <= and >= comparisons
2021-03-18 18:41:41 +01:00
Irmen de Jong
b30b8b7368
fix bug in float < and > comparisons
2021-03-18 01:41:54 +01:00
Irmen de Jong
3df182b8c3
created extensive comparison test suite
2021-03-18 00:50:13 +01:00
Irmen de Jong
7f21d89fea
moved test programs to test folder in compiler module
2021-03-17 20:15:16 +01:00
Irmen de Jong
6995ee2d17
fix cx16 bresenham line inaccuracy
2021-03-09 22:04:19 +01:00
Irmen de Jong
d23c2eed86
test
2021-02-20 16:58:24 +01:00
Irmen de Jong
2aa39757b4
reduce dependencies on global compilationtarget
2021-02-19 19:02:29 +01:00
Irmen de Jong
219d17de34
reduce dependencies on global compilaiontarget
2021-02-19 18:33:54 +01:00
Irmen de Jong
bc37097df2
reducing dependencies
2021-02-09 18:49:25 +01:00
Irmen de Jong
7d98275763
reducing dependencies
2021-02-09 02:06:27 +01:00
Irmen de Jong
d6ffb549f6
reducing dependencies
2021-02-09 01:47:05 +01:00
Irmen de Jong
ccd1516637
reducing ast dependencies
2021-02-07 18:44:38 +01:00
Irmen de Jong
f1f51a01c6
reducing ast dependencies
2021-02-07 18:34:55 +01:00
Irmen de Jong
e35b739579
reducing ast dependencies
2021-02-07 06:39:08 +01:00
Irmen de Jong
170a0183f8
added 'inline' keyword to force inlining of trivial subroutines
2020-12-26 05:34:14 +01:00
Irmen de Jong
e0c5ccc16b
begun with converting builtin functions to new call convention
2020-11-02 23:00:20 +01:00
Irmen de Jong
fdd91170dc
allow simple binary expressions as array indexing too, but not more
2020-10-17 22:43:35 +02:00
Irmen de Jong
439761cb67
fixed C64 ZP addresses to allow disk I/O, introduced diskio library module
2020-10-14 01:17:18 +02:00
Irmen de Jong
95e9e1b550
avoid adding unneeded variable initalization assignments. Improved removal of useless double assignments.
2020-10-01 00:39:49 +02:00
Irmen de Jong
1d1fe364d0
added %option no_sysinit to avoid having the system re-initialization code executed at the start of the program
2020-09-23 23:01:47 +02:00
Irmen de Jong
e8679ae03b
fixed print_f on cx16. Some more examples are now multi-platform.
2020-09-22 01:45:51 +02:00
Irmen de Jong
de06353194
auto select correct library to import based on target, instead of having c64- and cx16- prefix variants
...
some programs are now 100% source compatible between C64 and Cx16 targets!
import libraries have been rena;med
2020-09-21 00:50:09 +02:00
Irmen de Jong
49a0584c54
added a %target directive
2020-09-09 22:53:34 +02:00
Irmen de Jong
8d8c066447
made the ZP and compilation target more generic
2020-08-25 19:32:31 +02:00
Irmen de Jong
63c073c93f
got rid of the Simulator / AST VM
2020-03-22 02:50:34 +01:00
Irmen de Jong
0ee4d420b1
slight tweaks on the Ast, Program (the top level) is now a Node as well
2020-03-18 22:29:30 +01:00
Irmen de Jong
6bd99d63b4
cleanup of error reporting
2020-03-14 23:47:26 +01:00
Irmen de Jong
5f1ec80ae0
improved array literal datatype handling, fixed some datatype compiler errors related to this
2020-03-12 01:10:19 +01:00
Irmen de Jong
ef6c731bb3
added '@' alternative string/char encoding
2020-03-11 00:32:50 +01:00
Irmen de Jong
11de3db25f
simplified heapId for arrayvalues
2020-02-08 18:49:48 +01:00
Irmen de Jong
875a71c786
removed datatype from StringValue classes (is always STR now)
2020-02-08 02:21:18 +01:00
Irmen de Jong
8c2e602cc7
preparing for multiple compiler backends/targets
2019-10-26 23:41:15 +02:00
Irmen de Jong
aa94300bdd
added output directory command line option
...
improved cli parser by using kotlinx.cli
2019-08-23 00:11:08 +02:00
Irmen de Jong
8eff51904e
taking down the heapvalue mess further
2019-08-21 00:29:31 +02:00
Irmen de Jong
c717f4573d
taking down the heapvalue mess further
2019-08-20 23:02:13 +02:00
Irmen de Jong
984d251a6d
taking down the heapvalue mess, RuntimeValue class separation
2019-08-20 00:01:31 +02:00
Irmen de Jong
8c3b43f3ed
taking down the heapvalue mess
2019-08-19 22:28:41 +02:00
Irmen de Jong
b64d611e02
split array and string literal classes
2019-08-13 03:00:17 +02:00
Irmen de Jong
2665618fa6
zp test added, some cleanups
2019-08-11 22:23:18 +02:00
Irmen de Jong
bccfeb2fa2
fix some unittests
2019-08-05 21:04:15 +02:00
Irmen de Jong
e834924857
more ++ and -- code, 'dontuse' zeropage option
2019-08-04 22:44:20 +02:00
Irmen de Jong
2c3b8a9819
more ++ and -- code, 'dontuse' zeropage option
2019-08-04 22:35:27 +02:00
Irmen de Jong
9961a404ae
got rid of bytecode based compiler and vm
2019-07-23 20:44:11 +02:00
Irmen de Jong
e03c68b632
optimize imports
2019-07-17 02:11:16 +02:00
Irmen de Jong
31f4e378aa
split up Literalvalue into numeric and reference ones
2019-07-15 01:11:32 +02:00
Irmen de Jong
87c28cfdbc
restructure c64 machinedefinition
2019-07-13 03:16:48 +02:00
Irmen de Jong
a59f7c75dc
fixed some compile time and vm arithmetic errors
2019-07-10 13:33:52 +02:00
Irmen de Jong
1794f704e7
restructuring more things
2019-07-08 14:38:51 +02:00
Irmen de Jong
ade7a4c398
restructuring vm
2019-07-08 13:40:52 +02:00
Irmen de Jong
5a27b035b0
restructuring of the AST package
2019-07-08 13:33:31 +02:00
Irmen de Jong
060e05c868
strlen and strings with zeros in them should terminate at the zero
2019-06-26 02:34:43 +02:00
Irmen de Jong
268856823a
got rid of old Value in favor of new RuntimeValue implementation
2019-06-24 22:45:27 +02:00
Irmen de Jong
4bac5043b6
fix integer wraparounds for RuntimeValue
2019-06-24 22:18:50 +02:00
Irmen de Jong
ebd38f27e6
cleaned up some symbol visibilities
2019-06-23 13:49:35 +02:00
Irmen de Jong
518c3bfd76
actually, get rid of integer pow() because a naive multiplication loop approach is way too slow
2019-03-31 18:05:41 +02:00
Irmen de Jong
bf3caaefe1
stackvm now uses a proper instruction pointer call stack instead of instruction linking
2019-03-13 22:00:41 +01:00
Irmen de Jong
f5ba072294
removed str_p and str_ps pascal string types, fixes #10
2019-03-10 18:11:26 +01:00
Irmen de Jong
2f1249489b
datatype cleanups
2019-02-25 01:22:56 +01:00
Irmen de Jong
ee497d2ffb
improved zero page address addresses for floating point support mode
2019-02-09 17:29:59 +01:00
Irmen de Jong
7459896155
finalized zeropage variable allocation
2019-01-27 22:59:40 +01:00
Irmen de Jong
3a8f069854
zp allocations
2019-01-27 17:10:49 +01:00
Irmen de Jong
953cf9a335
preparing for vars on zeropage
2019-01-26 22:46:01 +01:00
Irmen de Jong
2911e357bd
restructured program init code and library imports a bit
2019-01-20 17:45:57 +01:00
Irmen de Jong
f1b2bd1cc4
got rid of separate '//' floordivision operator
2019-01-09 22:01:47 +01:00
Irmen de Jong
b8b531276d
fixed some shift opcode issues in stackvm, tweak mandelbrot example
2019-01-08 01:31:59 +01:00
Irmen de Jong
d203bfaf25
normal division is always float, implemented (u)byte integer division
2019-01-06 01:43:47 +01:00
Irmen de Jong
39a8508daa
sine table and bit shifting of signed values fixed
2019-01-05 02:42:58 +01:00
Irmen de Jong
9ffc68acab
casts
2018-12-20 16:17:58 +01:00
Irmen de Jong
5870006b2f
introduced type cast "... as ..." instead of builtin functions
2018-12-20 03:17:41 +01:00
Irmen de Jong
3a7b341f47
fixes
2018-12-18 18:32:41 +01:00
Irmen de Jong
2478c73bc0
more asm float calculations
2018-12-16 03:38:17 +01:00
Irmen de Jong
8597ea2ec7
correct printing of numbers
2018-12-14 23:15:44 +01:00
Irmen de Jong
7cb42de60e
more float asm operations, fix some % operator problems
2018-12-13 01:19:43 +01:00
Irmen de Jong
ef2ae60868
byte/word asm comparisons
2018-12-08 17:21:34 +01:00
Irmen de Jong
711d6f4ee5
fix memory pointer variables in the StackVm
2018-12-02 23:53:09 +01:00
Irmen de Jong
89ac374db9
float stuff
2018-12-02 17:59:36 +01:00
Irmen de Jong
8a2584c7df
added JZ/JNZ/etc opcodes for conditional jumps based on stack value
...
fix function parameter replacement of auto-heaped strings
2018-11-27 00:35:37 +01:00
Irmen de Jong
d6432df90d
got rid of 16-bit register pair variables (AX, AY, XY) they were complicating things too much
2018-11-02 22:06:57 +01:00
Irmen de Jong
4ef680f6fd
assignments
2018-11-01 23:42:10 +01:00
Irmen de Jong
5bf2c4a798
got rid of matrix type
2018-10-30 20:29:03 +01:00
Irmen de Jong
7c4846700b
simplified opcodes (removed COPY_XXX and MEM signed/unsigned distinction)
2018-10-27 22:08:46 +02:00
Irmen de Jong
5203dad7c1
more asm output
2018-10-26 01:44:01 +02:00
Irmen de Jong
f42a036fc5
more asm output, added COPY_MEM_XXX optimized opcodes
2018-10-25 00:28:50 +02:00
Irmen de Jong
b8f3f942d4
implemented all bit rotate and shift operations
2018-10-22 01:02:24 +02:00
Irmen de Jong
067426016d
more asm
2018-10-17 01:01:01 +02:00
Irmen de Jong
b7d8f026f4
refactor
2018-10-13 18:17:06 +02:00
Irmen de Jong
dff4518608
intermediate program written in blocks
2018-10-13 16:55:01 +02:00
Irmen de Jong
7aec14524e
fix datatype conversion issues
2018-10-12 15:50:32 +02:00
Irmen de Jong
1fe5c943fd
adding singed integer datatypes
2018-10-11 21:50:10 +02:00
Irmen de Jong
2f7d03b6ab
adding singed integer datatypes
2018-10-10 09:21:20 +02:00
Irmen de Jong
f5261a3425
added %zpreserved
2018-10-09 00:01:53 +02:00
Irmen de Jong
9d10210466
optimized var copying
2018-10-08 02:24:35 +02:00
Irmen de Jong
52e1661c8e
even more opcodes type-specific
2018-10-05 16:57:13 +02:00
Irmen de Jong
e8ba21d3ba
made a lot more opcodes type-specific
2018-10-05 13:58:37 +02:00
Irmen de Jong
42e4891fcf
allowing vardecl with non-const initial value assignment
2018-10-05 00:29:46 +02:00
Irmen de Jong
7d77504335
types
2018-10-04 02:30:23 +02:00
Irmen de Jong
d2ffb1063b
made more opcodes type-specific (will be needed for assembly generation later)
2018-10-04 02:17:18 +02:00
Irmen de Jong
38e7d48492
implemented floating-point arrays
2018-10-02 02:20:42 +02:00
Irmen de Jong
505de87f27
builtin funcs
2018-09-30 16:25:00 +02:00
Irmen de Jong
6b89bb7be5
strings and arrays are now stored in a 'heap' instead of in the value itself, to reflect how the target platform will store them
2018-09-29 17:33:59 +02:00
Irmen de Jong
814b7ce6aa
track vars per block for later 6502 generation
2018-09-28 23:04:36 +02:00
Irmen de Jong
c5d251073f
removed broken unused symbol clean up for now
...
streamlined irq routine handling and compilation
2018-09-28 21:28:16 +02:00
Irmen de Jong
4d7279b004
fix lsb, msb result data type
2018-09-28 19:35:34 +02:00
Irmen de Jong
7f28f8be11
60hz irq implemented in stackvm
2018-09-27 22:45:57 +02:00
Irmen de Jong
53cd50ad48
changed float handling and appropriate compiler messages
2018-09-25 19:52:59 +02:00
Irmen de Jong
d990b05998
compilation of prefix operators, added NOT opcode
2018-09-25 01:02:01 +02:00
Irmen de Jong
70e5a38aa2
changed set/clear carry and irqd somewhat
2018-09-24 23:38:33 +02:00
Irmen de Jong
cef0aae927
compilation of builtin functions to opcode
...
untit tests for stackvm opcodes, value and parser literalvalue
2018-09-24 22:34:12 +02:00
Irmen de Jong
cfd63dc42a
more opcodes unit tested
2018-09-22 14:16:48 +02:00
Irmen de Jong
f84e06bdeb
tweak branches
2018-09-22 00:33:25 +02:00
Irmen de Jong
0137478ad4
tweaks
2018-09-21 22:43:29 +02:00
Irmen de Jong
2f48406aad
unit tests for most of the StackVM opcodes. Fixed some opcode behaviors.
2018-09-21 02:20:37 +02:00
Irmen de Jong
455f60fb84
for loop and comparison expression fixes
2018-09-20 01:13:21 +02:00
Irmen de Jong
326e5cd81a
restructure compiler
2018-09-16 20:36:02 +02:00
Irmen de Jong
8ff72167a4
renamed project to Prog8
2018-09-15 16:21:05 +02:00