pull/10/head
Matthew Butterick 8 years ago
parent 1902d283c9
commit 7b573be83c

@ -5,7 +5,7 @@
(define-macro (b-module-begin (b-program LINE ...))
(with-pattern
([(LINE-NUM ...)
(filter-stx-prop 'b-line-number
(filter-stx-prop 'b-line-num
(stx-flatten #'(LINE ...)))]
[(LINE-ID ...) (prefix-ids "line-" #'(LINE-NUM ...))])
#'(#%module-begin

@ -1,7 +1,7 @@
#lang brag
b-program : [b-line] (/NEWLINE [b-line])*
b-line : b-line-number [b-statement] (/":" [b-statement])* [b-rem]
@b-line-number : INTEGER
b-line : b-line-num [b-statement] (/":" [b-statement])* [b-rem]
@b-line-num : INTEGER
@b-statement : b-end | b-print | b-goto
b-rem : REM
b-end : /"end"

@ -3,6 +3,6 @@
(define (50) (print "never gets here"))
(define (40) (end))
(define (60) (print "three") (print (+ 1.0 3)))
(define (70) (goto (+ 11 18.5 0.5)))
(define (70) (goto (+ 11 18.5 0.5)) (rem "ignored"))
(define (10) (print "o" "n" "e"))
(define (20) (print) (goto 60) (end))
Loading…
Cancel
Save