summaryrefslogtreecommitdiff
path: root/lex.c
Commit message (Collapse)AuthorAge
* Don't ignore ret variables, remove memory leak on add_token failureDavid Phillips2019-08-11
|
* Fix and add tests for NULL deref cases found by scan-buildDavid Phillips2019-08-11
|
* Wrap tests in valgrind, clean up memory leaksDavid Phillips2019-08-04
|
* lex: empty file is equivalent to EOLDavid Phillips2019-08-04
| | | | | | | | | lex() returning NULL is used to convey an error case but having not allocated any tokens in the case of an empty input file isn't an error case. This patch causes lex to treat an empty token stream after successfully examining a file as just a single EOL token. This is a fair approximation of an empty file for this assembler's purposes, and results in the correct behaviour of an empty output file.
* Enable -Wall and -Wextra, fix warningsDavid Phillips2019-08-03
|
* Add test for asm-disasm-asm, fix bug with labelsDavid Phillips2019-08-03
| | | | | | | | | | | | | | This adds a support script for future expansion of an asm->disasm->asm series of tests, which will at minimum ensure some parity between the assembler and disassembler. Lower level tests to ensure correct behaviour rather than just symmetrical behaviour belong in another set of tests. This patch also fixes the assembler's behaviour around numeric labels. Many other assemblers support entirely numeric labels, and the output of the disassembler includes them. The assembler has been adjusted to lex a probably-numeric as a label if it is at the start of the line. Otherwise, old label behavour and old numeric behaviour is left in place.
* Misc tidy up of assembler sourcesDavid Phillips2019-08-03
|
* Add support for // /**/ style commentsDavid Phillips2019-08-03
|
* Fix bug lexing char valuesDavid Phillips2019-08-03
|
* More unused code removalDavid Phillips2019-08-03
|
* Remove superfluous printfs, factor reg table lookupDavid Phillips2019-08-03
|
* emit_error -> emit, factor keywords outDavid Phillips2019-08-03
|
* Dirst dump of working prototypeDavid Phillips2019-08-03