* Proper coordinate rounding, as in Arond()
* Forgotten EOL now consumed if found (still optional)
* Convert unit tests images to 1-bit before comparing
* Much better unit testing script
* Add 17 test scripts from the 2019 TI-Planet and Planète Casio contest
which consisted in reproducing an image with minimum code
Similarly to how parentheses are omitted at the end of commands, this
change allows them to be omitted at the end of function arguments.
Notice however than this omission is *ambiguous* when the parser does
not know in advance the number of arguments.
GCD(Ent(x;y -> GCD(Ent(x;y))
-> GCD(Ent(x);y)
The fx-92 SC+ parser knows the number of arguments for each function,
and will use the second interpretation, because Ent() has one argument
and GCD() has two. This interpreter, however, uses a generic extensible
construction for function calls and cannot decide on this ground. The
current interpretation is the first.
* Fix angle units for reverse trigonometric functions
* Add a streaming option to capture the output in real-time as a series
of bitmap images
* Switch to Decimal due to the non-continuity of Ent() breaking
assumptions about the fidelity of floats. Trigonometry functions are
still computed as floats.
* Fix the line rendering algorithm for edge cases and add a new test
line-positive.txt that ensures basic patterns are all correct.
* Use custom rules to generate text representation of decimal numbers as
to better match the output of the fx-92.
* Improve the test constants.txt to better evaluate this representation.
The interpreter automatically checks that the representation matches
the value and fails on error to avoid scratching heads.
* Fix EQUAL not being treated as a relational symbol.
There are some edge cases to Bresenham's line drawing algorithm with
cumul=dx. The fx-92 SC+ clearly checks cumul>dx, but for dx=1 and dy=1
this results in a horizontal line.
Apparently dx=dy is the only case where the fx-92 SC+ behaves
differently than cumul>dx, as seen with dx=5 dy=4 (causes cumul=dx after
2 iterations but does not trigger the condition).
Also allow the program to be interrupted with Escape while paused.
This change adds a [cond] grammar symbol corresponding to binary
relations in IF, IFELSE and WHILE conditions. It also adds support for
unary functions with parenthesis syntax. Other functions will need
specific rules depending on their operator precedence level.
Also adds the Window.save() function that implements the --save option
to save the output of the program into a bitmap file. This will be used
to perform automated unit tests.
This change lays the ground for automated unit tests. It adds
command-line options to select the input language format between URL
(hexa text) and plain text, change a few output settings, and redirect
graphical output to an image.
A text lexer has also been added so that unit tests and new programs can
be written in an English-like syntax instead of raw hexadecimal.
The program is currently able to lex most useful tokens, and parse
constructs associated with them on simple examples.
Unit tests are still missing to formally ensure everything's right.