resume in world-sexp

dev-elider-3
Matthew Butterick 9 years ago
parent 6e54846a3f
commit 0c976a1634

@ -35,10 +35,10 @@
#'(module-begin _section ...)) #'(module-begin _section ...))
(provide verb-section) (provide verb-section)
(define-inverting #'(verb-section _heading _verb-entry ...) (define-inverting #'(verb-section _heading _verb-item ...)
(inject-syntax ([#'in-verbs (shared-syntax 'in-verbs)]) (inject-syntax ([#'in-verbs (shared-syntax 'in-verbs)])
#'(define-verbs in-verbs #'(define-verbs in-verbs
_verb-entry ...))) _verb-item ...)))
(provide verb-item) (provide verb-item)
(define-inverting #'(verb-item (_name0 _transitive0?) (_name _transitive?) ... _desc) (define-inverting #'(verb-item (_name0 _transitive0?) (_name _transitive?) ... _desc)
@ -57,22 +57,18 @@
#'(define-everywhere everywhere-actions #'(define-everywhere everywhere-actions
([_name _desc] ...))) ([_name _desc] ...)))
(provide everywhere-item) (provide id-desc)
(define-inverting #'(everywhere-item _name _desc) (define-inverting #'(id-desc _id _desc)
#'(_name _desc)) #'(_id _desc))
(provide things-section) (provide things-section)
(define-inverting #'(things-section _heading _thing ...) (define-inverting #'(things-section _heading _thing ...)
#'(begin _thing ...)) #'(begin _thing ...))
(provide thing-item) (provide thing-item)
(define-inverting #'(thing-item (thing-id _thingname) (_actionname _actiondesc) ...) (define-inverting #'(thing-item _thingname (_actionname _actiondesc) ...)
#'(define-thing _thingname [_actionname _actiondesc] ...)) #'(define-thing _thingname [_actionname _actiondesc] ...))
(provide thing-action)
(define-inverting #'(thing-action _actionname _actiondesc)
#'(_actionname _actiondesc))
(provide places-section) (provide places-section)
(define-inverting #'(places-section _heading _placeitem ...) (define-inverting #'(places-section _heading _placeitem ...)
#'(begin _placeitem ...)) #'(begin _placeitem ...))
@ -81,9 +77,6 @@
(define-inverting #'(place-item _place-id _place-desc [_place-item ...] [_actionname _actiondesc] ...) (define-inverting #'(place-item _place-id _place-desc [_place-item ...] [_actionname _actiondesc] ...)
#'(define-place _place-id _place-desc [_place-item ...] ([_actionname _actiondesc] ...))) #'(define-place _place-id _place-desc [_place-item ...] ([_actionname _actiondesc] ...)))
(provide place-id)
(define #'(place-id _id) #'_id)
(provide place-descrip) (provide place-descrip)
(define #'(place-descrip _desc) #'_desc) (define #'(place-descrip _desc) #'_desc)
@ -95,11 +88,6 @@
[#'(_ "," _id) #'_id] [#'(_ "," _id) #'_id]
[#'(_ _id) #'_id]) [#'(_ _id) #'_id])
(provide place-action)
(define-inverting #'(place-action _id _desc) #'(_id _desc))
(provide desc)
(define #'(desc _d) #'_d)
(provide s-exp) (provide s-exp)
(define-cases-inverting #'s-exp (define-cases-inverting #'s-exp

@ -1,41 +1,31 @@
#lang ragg #lang ragg
txtadv-program : [verb-section] [everywhere-section] [things-section] places-section start-section txtadv-program : verb-section everywhere-section things-section places-section start-section
verb-section : "===VERBS===" verb-item+ verb-section : "===VERBS===" verb-item+
verb-item : verb-name+ desc verb-item : verb-name+ s-exp
verb-name : [","] ID ["_"] verb-name : [","] ID ["_"]
everywhere-section : "===EVERYWHERE===" everywhere-item+ everywhere-section : "===EVERYWHERE===" id-desc+
everywhere-item : ID desc
things-section : "===THINGS===" thing-item+ things-section : "===THINGS===" thing-item+
thing-item : thing-id thing-action+ thing-item : DASHED-NAME id-desc+
thing-id : DASHED-NAME
thing-action : ID desc
places-section : "===PLACES===" place-item+ places-section : "===PLACES===" place-item+
place-item : place-id place-descrip place-items place-action+ place-item : DASHED-NAME place-descrip place-items id-desc+
place-id : DASHED-NAME place-descrip : STRING ; `place-desc` is already used in expander
place-descrip : STRING ; place-desc is already used in expander place-items : "[" place-name* "]" ; `place-things` is already used
place-items : "[" place-name* "]" ; place-things is already used
place-name : [","] ID place-name : [","] ID
place-action : ID desc
start-section : "===START===" place-name start-section : "===START===" place-name
desc : s-exp id-desc : ID s-exp
s-exp : ID | STRING | ("(" | "[" | "{") s-exp* (")" | "]" | "}") s-exp : ID | STRING | "(" s-exp* ")"
Loading…
Cancel
Save