diff options
author | Kartik Agaram <vc@akkartik.com> | 2020-02-10 00:47:10 -0800 |
---|---|---|
committer | Kartik Agaram <vc@akkartik.com> | 2020-02-16 01:14:06 -0800 |
commit | deacf2c94e7b6a549c5b302e18e5f7d1a68ec2a8 (patch) | |
tree | 1746f20a7469205b9c0203d205ceca9deaf14142 /apps/factorial.mu | |
parent | 65eb2a57148f02a5ce59b784c0aeaaca116c205b (diff) | |
download | mu-deacf2c94e7b6a549c5b302e18e5f7d1a68ec2a8.tar.gz |
6008
Allow comments at the end of all kinds of statements. To do this I replaced all calls to next-word with next-mu-token.. except one. I'm not seeing any bugs yet, any places where comments break things. But this exception makes me nervous.
Diffstat (limited to 'apps/factorial.mu')
-rw-r--r-- | apps/factorial.mu | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/apps/factorial.mu b/apps/factorial.mu index a94be482..7d9015e2 100644 --- a/apps/factorial.mu +++ b/apps/factorial.mu @@ -1,13 +1,14 @@ fn main -> exit-status/ebx: int { #? run-tests #? result <- copy 0 + test-factorial # abc var tmp/eax: int <- factorial 5 exit-status <- copy tmp } fn factorial n: int -> result/eax: int { compare n 1 - { + { # foo break-if-> result <- copy 1 } @@ -15,7 +16,7 @@ fn factorial n: int -> result/eax: int { break-if-<= var tmp/ecx: int <- copy n tmp <- decrement - result <- factorial tmp + result <- factorial tmp # test comment result <- multiply n } } |