Minor "else" improvements

- Do not generate s.never to skip Else branch
- Add Display impl to SourcePosition
- Correct SourcePositions pointing to the end of a parsed expr instead of the beginning
- Remove 'true', 'always', 'false' and 'never' from README.md
This commit is contained in:
2020-10-22 21:55:00 +02:00
parent 0006cd06ec
commit 8d10fa406d
6 changed files with 45 additions and 14 deletions
+19
View File
@@ -1,4 +1,23 @@
(
; test else
(cmp 0 5
(eq? (fault))
(else? (ld r0 15))
(lt? (fault)) ; This should produce a warning
)
(cmp 15 r0
(ne? (fault "else did not run")))
(ld r0 0)
(cmp 0 5
(lt? (nop))
(else? (fault "fallthrough to else"))
)
;
(ld r8 0)
(ld r0 1