Skip to content

Commit

Permalink
reserve default field value syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffBezanson committed Jun 28, 2015
1 parent 995772c commit f7a4aa3
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/julia-syntax.scm
Original file line number Diff line number Diff line change
Expand Up @@ -1169,6 +1169,15 @@
(let ((mut (cadr e))
(sig (caddr e))
(fields (cdr (cadddr e))))
(let loop ((f fields))
(if (null? f)
'()
(let ((x (car f)))
(cond ((or (symbol? x) (decl? x) (and (pair? x) (eq? (car x) 'line)))
(loop (cdr f)))
((and (assignment? x) (or (symbol? (cadr x)) (decl? (cadr x))))
(error (string "\"" (deparse x) "\" inside type definition is reserved")))
(else '())))))
(expand-binding-forms
(receive (name params super) (analyze-type-sig sig)
(struct-def-expr name params super fields mut)))))
Expand Down

0 comments on commit f7a4aa3

Please sign in to comment.