Skip to content

Commit

Permalink
Save minor typos.
Browse files Browse the repository at this point in the history
  • Loading branch information
CuppoJava committed Dec 8, 2022
1 parent be74bb0 commit 12ae50b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 10 deletions.
16 changes: 15 additions & 1 deletion build-stanza.proj
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,18 @@ build main :
stz/driver
pkg: "pkgs"
s: "stanza.s"
o: "stanza"
o: "stanza"

build core-macros :
inputs:
stz/check-lang
stz/reader-lang
stz/ast-lang
stz/renamer-lang
stz/resolver-lang
stz/fastio-serializer-lang
stz/ast-printer-lang
stz/core-macros
stz/macro-plugin
o: "../build/core-macros"
pkg: "../pkgs"
15 changes: 6 additions & 9 deletions compiler/core-macros.stanza
Original file line number Diff line number Diff line change
Expand Up @@ -1373,7 +1373,12 @@ defsyntax core :

; Within
; ======
defrule exp4 = (within (?bs:#fnarg ...) = ?e:#exp! #:! ?body:#exp!) :
defproduction within-lhs:List<Splice>
defrule within-lhs = ((?bs:#fnarg ...) =)
defrule within-lhs = (?b:#binder =) : List(splice(List(b)))
defrule within-lhs = () : List()

defrule exp4 = (within ?bs:#within-lhs ?e:#exp! #:! ?body:#exp!) :
;Split expression into function call form, so that we
;can insert the closure as the first argument.
if not tagged-list?(e, `$do) :
Expand All @@ -1396,14 +1401,6 @@ defsyntax core :
;Parse as core expression.
parse-syntax[core / #exp](filled)

defrule exp4 = (within ?e:#exp! #:! ?body:#exp!) :
if not tagged-list?(e, `$do) :
throw(CSE(closest-info(e), "Expected a function call form."))
val f = unwrap-token(e)[1]
val args = tailn(unwrap-token(e), 2)
parse-syntax[core / #exp](
qquote((~ f)((fn () : ~ body) ~@ args)))

; While
; =====
val while-template = CoreExp $ `(
Expand Down

0 comments on commit 12ae50b

Please sign in to comment.