summaryrefslogtreecommitdiff
path: root/src/stages
Commit message (Collapse)AuthorAge
* Allow a macro to invoke itself safelyBen Bridle29 hours
| | | | | | | A macro can now invoke itself if the invocation is inside a conditional block that will eventually return false. The assembler stack can still overflow if the macro recurses too deeply, or if a macro calls itself without a conditional block.
* Allow a macro to invoke itselfBen Bridle29 hours
| | | | | This will currently cause the assembler to hang in all situations where it is used.
* Implement <len> operator for expressionsBen Bridle29 hours
| | | | | The <len> operator returns the width of an integer in bits, using the same calculation as for packing an integer into a bit field.
* Implement octal literalsBen Bridle2 days
| | | | Octal literals use the prefix '0o'.
* Fix width checks for negative integersBen Bridle8 days
| | | | | | | | | | | | The width of a negative integer was previously being counted in the same way as for a positive integer, by inverting the bits to make it a positive integer and then finding the placement of the highest-order 1 bit. The actual width of a negative integer will always be one greater than this value however, because the highest-order 1 bit of an inverted negative integer will always have directly above it a significant 0 bit used as the sign bit.
* Implement negative integer literalsBen Bridle8 days
| | | | | Negative literals take the forms -29, -0x1D, and -0b11101 for decimal, hexadecimal, and binary.
* Report token without prefix in invalid literal errorsBen Bridle2025-03-23
| | | | | | | Previously, the token quoted in the error message for an invalid literal error included the radix prefix. This is already visible in the highlighted source report, and implied by the named radix in the error message.
* Update assembler dependencyBen Bridle2025-03-18
| | | | torque-asm now uses the Compiler type provided by the assembler library.
* Tidy codyBen Bridle2025-03-18
| | | | | | | - Rename tokens field on SyntacticMacroDefinition to body - Rename push_err! macro to err! - Create macros for character-matching logic in syntactic parsing - Replace .as_bytes().to_vec() pattern with .into_bytes()
* Rewrite entire assemblerBen Bridle2025-03-11
The language is now more general, the code is better structured, error reporting is more detailed, and many new language features have been implemented: - conditional blocks - first-class strings - more expression operators - binary literals - negative values - invocations in constant expressions