Sigh.  Let me redo mdn-expr

any-space -> SPACE | TAB | VTAB | FORMFEED | CR | LF | comment

; the core implementations here need to be
; factored out, as the sweet-expr parser needs
; to do similar processing when differentating
; between space-significant and space-insignificant
; quote.
mdn-expr -> QUOTE any-space* mdn-expr
  (list 'quote $3)
mdn-expr -> QUASIQUOTE any-space* mdn-expr
  (list 'quasiquote $3)
mdn-expr -> UNQUOTE any-space* mdn-expr
  (list 'unquote $3)
mdn-expr -> UNQUOTE-SPLICING any-space* mdn-expr
  (list 'unquote-splicing $3)
mdn-expr -> mdn-expr-post-quote
  $1

; use a different base-expr here:
; disallow post-mdn-expr after things
; like STRING, NUMBER, OTHER
mdn-expr-post-quote -> base-expr-postable post-mdn-expr
  ($2 $1)
mdn-expr-post-quote -> base-expr
  $1

post-mdn-expr -> post-mdn-expr-1 post-mdn-expr
  (lambda (e) ($2 ($1 e)))
post-mdn-expr -> post-mdn-expr-1
  $1

post-mdn-expr-1 -> list-notation
  (lambda (e) (cons e $1))
post-mdn-expr-1 -> LBRACKET list-content RBRACKET
  (lambda (e) (cons 'bracketaccess (cons e $2)))
post-mdn-expr-1 -> curly-infix
  (lambda (e) (list e $1))

list-notation -> LPARENS list-content RPARENS
  $2
; CONS = . i.e. the dotted-pair operator
list-content -> any-space* CONS any-space* mdn-expr any-space*
  $4
list-content -> any-space* mdn-expr list-content
  (cons $2 $3)
list-content -> any-space*
  '()

base-expr-postable -> SYMBOL
  $1
base-expr-postable -> list-notation
  $1
base-expr-postable -> bracket-notation
  $1
base-expr-postable -> curly-infix
  $1

; basically, these cases involve calling
; the built-in reader.
base-expr -> STRING
  $1
base-expr -> NUMBER
  $1
base-expr -> OTHER ; i.e. for #x reader
  $1
base-expr -> base-expr-postable
  $1

; again, hook for language-specific bracket meanings
bracket-notation -> bracket-notation-scheme
  $1
bracket-notation-scheme -> LBRACKET list-content RBRACKET
  $2
bracket-notation-arc -> LBRACKET list-content RBRACKET
  (list 'lambda (list '_) $2)

anyone find more bugs?
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Readable-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/readable-discuss

Reply via email to