add semicolons to raw haxe code
This commit is contained in:
@@ -202,6 +202,7 @@ class Macros {
|
||||
for (matchBodySymbol in matchBodySymbols) {
|
||||
caseInterp.variables.set(Prelude.symbolNameValue(matchBodySymbol), matchBodies.shift());
|
||||
}
|
||||
prepareForConditional(caseInterp, k);
|
||||
try {
|
||||
var hscriptStr = Prelude.convertToHScript(caseStr);
|
||||
#if test
|
||||
|
@@ -514,7 +514,7 @@ class Reader {
|
||||
name;
|
||||
case RawHaxe(code):
|
||||
// #| haxeCode() |#
|
||||
'#{ $code }#';
|
||||
'#| $code |#';
|
||||
case RawHaxeBlock(code):
|
||||
// #{ haxeCode(); moreHaxeCode(); }#
|
||||
'#{ $code }#';
|
||||
|
@@ -3,7 +3,7 @@
|
||||
(function :FerrySquare emptySeat [:Array<FerrySquare> n :SeatsChanged changed]
|
||||
// Empty seats with completely empty neighbors, fill up
|
||||
(cond
|
||||
((= true (apply = (for neighbor n #{neighbor != fullSeat}#)))
|
||||
((= true (apply = (for neighbor n #{neighbor != fullSeat;}#)))
|
||||
(set changed.changed true)
|
||||
fullSeat)
|
||||
(true emptySeat)))
|
||||
@@ -11,7 +11,7 @@
|
||||
(function :FerrySquare fullSeat [:Array<FerrySquare> n :SeatsChanged changed]
|
||||
// Full seats with 4 or more full neighbors become empty
|
||||
(cond
|
||||
((<= 4 (count n (lambda [neighbor] #{neighbor == fullSeat}#)))
|
||||
((<= 4 (count n (lambda [neighbor] #{neighbor == fullSeat;}#)))
|
||||
(set changed.changed true)
|
||||
emptySeat)
|
||||
(true fullSeat)))
|
||||
@@ -43,7 +43,7 @@
|
||||
(for :Array<FerrySquare> row state
|
||||
(apply +
|
||||
(for :FerrySquare seat row
|
||||
(if #{seat == fullSeat}# 1 0))))))
|
||||
(if #{seat == fullSeat;}# 1 0))))))
|
||||
|
||||
(defReaderMacro "L" [stream] `emptySeat)
|
||||
(defReaderMacro "#" [stream] `fullSeat)
|
||||
|
@@ -126,7 +126,7 @@
|
||||
dist (Adapters.distribution diffs)]
|
||||
(assert (= 1998 (* (dictGet dist 1) (dictGet dist 3)))))
|
||||
(let [memoized (memoize Adapters.arrangementCount)]
|
||||
(set Adapters.arrangementCount #{cast memoized}#))
|
||||
(set Adapters.arrangementCount cast memoized))
|
||||
(assert (= "347250213298688" (Int64.toStr (Adapters.arrangementCount adapters 0))))))
|
||||
|
||||
(day 11
|
||||
|
@@ -4,7 +4,7 @@
|
||||
`(let [theMap ,theMap key ,key amount ,amount &mut count (dictGet theMap key)]
|
||||
(unless count
|
||||
(dictSet theMap key (set count (Int64Helper.fromFloat 0))))
|
||||
(dictSet theMap key #{count + amount}#)))
|
||||
(dictSet theMap key #{count + amount;}#)))
|
||||
|
||||
// Remove and return an arbitrary key-value pair from the given Map
|
||||
(function :Array<Dynamic> dictShift [:Map<String,Dynamic> m]
|
||||
|
@@ -37,4 +37,4 @@
|
||||
(function :Int numHotPositions [file &opt :Bool part2]
|
||||
(let [theMap (ventsByPos file ?part2)
|
||||
two (Int64Helper.fromFloat 2)]
|
||||
(count theMap ->vents #{ vents >= two }#)))
|
||||
(count theMap ->vents #{ vents >= two; }#)))
|
@@ -9,7 +9,7 @@
|
||||
(doFor age list
|
||||
(let [count (dictGet theMap age)
|
||||
one (Int64Helper.fromFloat 1)]
|
||||
(dictSet theMap age #{count + one}#)))
|
||||
(dictSet theMap age #{count + one;}#)))
|
||||
theMap))
|
||||
|
||||
(function :Map<Int,Int64> stepAgeMap [:Map<Int,Int64> theMap]
|
||||
|
@@ -184,10 +184,10 @@
|
||||
(let [daysInMonth (DateTime.daysInMonth (nextDay.getMonth) (nextDay.isLeapYear))
|
||||
adjustedDays (for day days (% (+ daysInMonth day) daysInMonth))]
|
||||
(when (contains adjustedDays (nextDay.getDay)) (return true)))
|
||||
#{nextDay -= oneDayInterval}#)
|
||||
#{nextDay -= oneDayInterval;}#)
|
||||
(return false)))
|
||||
((Interval days lastDayDone)
|
||||
(or !lastDayDone (<= days #{(DateTime.fromDate(Date.now()) - DateTime.fromString(lastDayDone)).getTotalDays()}#)))
|
||||
(or !lastDayDone (<= days #{(DateTime.fromDate(Date.now()) - DateTime.fromString(lastDayDone)).getTotalDays();}#)))
|
||||
(Todo (= 0 .points (activeLabel e)))
|
||||
(otherwise true)))
|
||||
|
||||
|
@@ -18,7 +18,7 @@
|
||||
(when !(= direction Vector3.ZERO)
|
||||
(set direction (direction.normalized))
|
||||
// TODO for some reason, the Vector3 addition operator is only found when used in a raw haxe expr:
|
||||
(pivot.lookAt #{translation + direction}# Vector3.UP))
|
||||
(pivot.lookAt #{translation + direction;}# Vector3.UP))
|
||||
|
||||
(set _velocity.x (* direction.x speed))
|
||||
(set _velocity.z (* direction.z speed))
|
||||
|
Reference in New Issue
Block a user