Skip to content

Commit

Permalink
Merge pull request #117 from kamisori/superfluous-semi-after-declaration
Browse files Browse the repository at this point in the history
emit-declaration: when called by emit-statement, there is a semi in caller emit-block
  • Loading branch information
bakpakin committed May 12, 2023
2 parents ba134a0 + 46910c1 commit 40ac3a8
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions spork/cjanet.janet
Original file line number Diff line number Diff line change
Expand Up @@ -332,11 +332,9 @@
[binding &opt value]
(def [v vtype] (type-split binding))
(emit-type vtype v)
(if (not= nil value)
(do
(prin " = ")
(emit-expression value true))
(print ";")))
(when (not= nil value)
(prin " = ")
(emit-expression value true)))

(varfn emit-statement
[form]
Expand Down Expand Up @@ -507,7 +505,8 @@
(def v (last form))
(when (next storage-classes)
(emit-storage-classes storage-classes))
(emit-declaration binding v))
(emit-declaration binding v)
(print ";"))

(defn- do-typedef
[n d]
Expand Down

0 comments on commit 40ac3a8

Please sign in to comment.