diff --git a/Makefile b/Makefile index 0594d29f8..7209b87be 100644 --- a/Makefile +++ b/Makefile @@ -4,9 +4,9 @@ all: gradle installdist installshadowdist - @echo "compiler launch script can be found here: compiler/build/install/compiler-shadow/bin/p8compile" + @echo "compiler launch script can be found here: compiler/build/install/compiler-shadow/bin/prog8c" test: gradle build - @echo "compiler launch script can be found here: compiler/build/install/compiler-shadow/bin/p8compile" + @echo "compiler launch script can be found here: compiler/build/install/compiler-shadow/bin/prog8c" diff --git a/benchmark-program/Makefile b/benchmark-program/Makefile index 1bc6b5f43..0699fde60 100644 --- a/benchmark-program/Makefile +++ b/benchmark-program/Makefile @@ -9,4 +9,4 @@ emu: benchmark.prg x16emu -run -prg $< -warp benchmark.prg: benchmark.p8 b_3d.p8 b_adpcm.p8 b_circles.p8 b_life.p8 b_mandelbrot.p8 b_maze.p8 b_queens.p8 b_textelite.p8 - p8compile $< -target cx16 + prog8c $< -target cx16 diff --git a/compiler/build.gradle b/compiler/build.gradle index a166e63ab..16eade8b0 100644 --- a/compiler/build.gradle +++ b/compiler/build.gradle @@ -80,11 +80,11 @@ startScripts.enabled = true application { mainClass = 'prog8.CompilerMainKt' - applicationName = 'p8compile' + applicationName = 'prog8c' } shadowJar { - archiveBaseName = 'prog8compiler' + archiveBaseName = 'prog8c' archiveVersion = version // minimize() } diff --git a/compiler/test/arithmetic/Makefile b/compiler/test/arithmetic/Makefile index b92c32d43..70a5c9a74 100644 --- a/compiler/test/arithmetic/Makefile +++ b/compiler/test/arithmetic/Makefile @@ -6,7 +6,7 @@ clean: rm -f *.prg *.asm *.vice-* test: clean - p8compile -target cx16 *.p8 >/dev/null + prog8c -target cx16 *.p8 >/dev/null for program in *.prg; do \ echo "RUNNING:" $$program ; \ x16emu -run -prg $$program >/dev/null ; \ diff --git a/compiler/test/comparisons/Makefile b/compiler/test/comparisons/Makefile index 09ff9f0a1..a6a110947 100644 --- a/compiler/test/comparisons/Makefile +++ b/compiler/test/comparisons/Makefile @@ -12,7 +12,7 @@ generate: python make_eq_tests_splitw.py python make_cmp_tests.py python make_cmp_tests_splitw.py - p8compile -target cx16 -sourcelines *.p8 >/dev/null + prog8c -target cx16 -sourcelines *.p8 >/dev/null test_prgs: x16emu -run -prg ifelse.prg diff --git a/docs/Makefile b/docs/Makefile index 7fc7f889d..ed44760bd 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -17,12 +17,12 @@ help: symboldumps: mkdir -p source/_static/symboldumps - p8compile -target atari import-all-atari.p8 -dumpsymbols > source/_static/symboldumps/skeletons-atari.txt - p8compile -target c64 import-all-c64.p8 -dumpsymbols > source/_static/symboldumps/skeletons-c64.txt - p8compile -target c128 import-all-c128.p8 -dumpsymbols > source/_static/symboldumps/skeletons-c128.txt - p8compile -target cx16 import-all-cx16.p8 -dumpsymbols > source/_static/symboldumps/skeletons-cx16.txt - p8compile -target pet32 import-all-pet32.p8 -dumpsymbols > source/_static/symboldumps/skeletons-pet32.txt - p8compile -target virtual import-all-virtual.p8 -dumpsymbols > source/_static/symboldumps/skeletons-virtual.txt + prog8c -target atari import-all-atari.p8 -dumpsymbols > source/_static/symboldumps/skeletons-atari.txt + prog8c -target c64 import-all-c64.p8 -dumpsymbols > source/_static/symboldumps/skeletons-c64.txt + prog8c -target c128 import-all-c128.p8 -dumpsymbols > source/_static/symboldumps/skeletons-c128.txt + prog8c -target cx16 import-all-cx16.p8 -dumpsymbols > source/_static/symboldumps/skeletons-cx16.txt + prog8c -target pet32 import-all-pet32.p8 -dumpsymbols > source/_static/symboldumps/skeletons-pet32.txt + prog8c -target virtual import-all-virtual.p8 -dumpsymbols > source/_static/symboldumps/skeletons-virtual.txt # Catch-all target: route all unknown targets to Sphinx using the new diff --git a/docs/source/compiling.rst b/docs/source/compiling.rst index 2adbb9860..467d3f773 100644 --- a/docs/source/compiling.rst +++ b/docs/source/compiling.rst @@ -13,8 +13,8 @@ Then you can choose a few ways to get a compiler: **Download an official release version from Github:** -#. download a recent "fat-jar" (called something like "prog8compiler-all.jar") from `the releases on Github `_ -#. run the compiler with "java -jar prog8compiler.jar" to see how you can use it (use the correct name and version of the jar file you've downloaded). +#. download a recent "fat-jar" (called something like "prog8c-all.jar") from `the releases on Github `_ +#. run the compiler with "java -jar prog8c.jar" to see how you can use it (use the correct name and version of the jar file you've downloaded). **Or, install via a Package Manager:** @@ -22,7 +22,7 @@ Currently, it's only available on `AUR `_. This package, alongside the compiler itself, also globally installs syntax highlighting for ``vim`` and ``nano``. -In order to run compiler, you can type either ``p8compile`` or ``prog8c``. The usage of those commands is exactly the same as with the ``java -jar`` method. +In order to run compiler, you can type ``prog8c``. The usage of those commands is exactly the same as with the ``java -jar`` method. In case you prefer to install AUR packages in a traditional manner, make sure to install `"tass64" package `_ before installing prog8, as `makepkg `_ itself doesn't fetch AUR dependencies. @@ -31,7 +31,7 @@ before installing prog8, as `makepkg ` #. find the latest CI build on `the actions page on Github `_ #. download the zipped jar artifact from that build, and unzip it. -#. run the compiler with "java -jar prog8compiler.jar" (use the correct name and version of the jar file you've downloaded). +#. run the compiler with "java -jar prog8c.jar" (use the correct name and version of the jar file you've downloaded). **Or, use the Gradle build system to build it yourself from source:** @@ -45,7 +45,7 @@ The most interesting gradle commands to run are probably the ones listed below. Read below at those tasks for where the resulting compiler jar file gets written. ``./gradlew installDist`` Builds the compiler and installs it with scripts to run it, in the directory - ``./compiler/build/install/p8compile`` + ``./compiler/build/install/prog8c`` ``./gradlew installShadowDist`` Creates a 'fat-jar' that contains the compiler and all dependencies, in a single executable .jar file, and includes few start scripts to run it. @@ -56,7 +56,7 @@ The most interesting gradle commands to run are probably the ones listed below. For normal use, the ``installDist`` task should suffice and after succesful completion, you can start the compiler with: - ``./compiler/build/install/p8compile/bin/p8compile `` + ``./compiler/build/install/prog8c/bin/prog8c `` (You should probably make an alias or link...) @@ -110,7 +110,7 @@ The compiler will link everything together into one output program at the end. If you start the compiler without arguments, it will print a short usage text. For normal use the compiler can be invoked with the command: - ``$ java -jar prog8compiler.jar -target cx16 sourcefile.p8`` + ``$ java -jar prog8c.jar -target cx16 sourcefile.p8`` (Use the appropriate name and version of the jar file downloaded from one of the Git releases. Other ways to invoke the compiler are also available: see the introduction page about how @@ -391,9 +391,9 @@ There are cross-platform examples that can be compiled for various systems unalt and there are also examples specific to certain computers (C64, X16, etcetera). So for instance, to compile and run the Commodore 64 rasterbars example program, use this command:: - $ java -jar prog8compiler.jar -target c64 -emu examples/c64/rasterbars.p8 + $ java -jar prog8c.jar -target c64 -emu examples/c64/rasterbars.p8 or:: - $ /path/to/p8compile -target c64 -emu examples/c64/rasterbars.p8 + $ /path/to/prog8c -target c64 -emu examples/c64/rasterbars.p8 diff --git a/examples/test.p8 b/examples/test.p8 index 2fc31ff52..e77b0ced1 100644 --- a/examples/test.p8 +++ b/examples/test.p8 @@ -4,18 +4,29 @@ main { + bool[] barray = [true, false, true, false] + uword[] warray = [&value1, &barray, &value5, 4242] + + bool @shared value1 + bool @shared value2 = barray[2] ; should be const! + bool @shared value3 = true + bool @shared value4 = false + bool @shared value5 = barray[cx16.r0L] ; cannot be const + uword @shared value6 = warray[3] ; should be const! + uword @shared value7 = warray[2] ; cannot be const + sub start() { - bool[] barray = [true, false, true, false] - uword[] warray = [&value1, &barray, &value5, 4242] - - bool @shared value1 - bool @shared value2 = barray[2] ; should be const! - bool @shared value3 = true - bool @shared value4 = false - bool @shared value5 = barray[cx16.r0L] ; cannot be const - uword @shared value6 = warray[3] ; should be const! - uword @shared value7 = warray[2] ; cannot be const - + txt.print_bool(value1) + txt.spc() + txt.print_bool(value2) + txt.spc() + txt.print_bool(value3) + txt.spc() + txt.print_bool(value4) + txt.spc() + txt.print_bool(value5) + txt.spc() + txt.print_uw(value6) txt.nl() } }