Closed aw closed 2 years ago
hmm.. I tried but it fails:
line 285
li t0, '(' # bounded comments start with ( char
AssemblerError: invalid char literal in expr: "' ( '"
Interesting... That might be an assembler bug for me to look into. Either way, this PR is good to go!
Hi,
This PR adds the ability to skip bounded comments, ex:
This will define the word
dup
and skip everything between(
and)
. It's a bit naive and doesn't handle cases of nested parens.. so:... would fail, not that anybody does that...
On the plus side, this makes it possible to easily copy/paste Forth code from existing implementations and libraries without having to manually remove the
(comments)
.This adds 20 bytes to the binary, but can probably be optimized a bit.