Fix haxe 4.2 compatibility
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
(defun main []
|
||||
(defun :Void main []
|
||||
(let [args (Sys.args)
|
||||
[&mut days years] (for arg args
|
||||
(case arg
|
||||
|
@@ -48,9 +48,9 @@
|
||||
|
||||
// Day 4
|
||||
(when (<= 0 (days.indexOf 4))
|
||||
(assert (= 2 (Passports.countValidPassports (new Stream "src/year2020/inputs/day4-example.txt"))))
|
||||
(assert (= 250 (Passports.countValidPassports (new Stream "src/year2020/inputs/day4-1.txt"))))
|
||||
(assert (= 158 (Passports.countValidPassports (new Stream "src/year2020/inputs/day4-1.txt") "strict"))))
|
||||
(assert (= 2 (Passports.countValidPassports (Stream.fromFile "src/year2020/inputs/day4-example.txt"))))
|
||||
(assert (= 250 (Passports.countValidPassports (Stream.fromFile "src/year2020/inputs/day4-1.txt"))))
|
||||
(assert (= 158 (Passports.countValidPassports (Stream.fromFile "src/year2020/inputs/day4-1.txt") "strict"))))
|
||||
|
||||
// Day 5
|
||||
(when (<= 0 (days.indexOf 5))
|
||||
|
@@ -11,7 +11,7 @@
|
||||
(Sys.sleep delay)
|
||||
(check file delay command erase))
|
||||
|
||||
(defun main []
|
||||
(defun :Void main []
|
||||
(check
|
||||
(nth (Sys.args) 0)
|
||||
(Std.parseFloat (nth (Sys.args) 1))
|
||||
|
@@ -13,7 +13,7 @@
|
||||
// TODO add sequentialPerPDF argument (which, when used, .shift()s pages from the beginning of PDFs)
|
||||
// TODO add chunkSize argument (default 1, which specifies how many pages in order to pull from a random PDF. value of -1 means take the whole PDF, and remove it from the list)
|
||||
// TODO make output page limit optional
|
||||
(defun main []
|
||||
(defun :Void main []
|
||||
(let [[sourceDir numPages] (Sys.args)]
|
||||
(loadAll (for file (Fs.readdirSync sourceDir) (+ sourceDir "/" file))
|
||||
(lambda [:Array<PDFDocument> inputPdfs]
|
||||
|
@@ -1,2 +1,2 @@
|
||||
(defun main []
|
||||
(defun :Void main []
|
||||
(print "Hello world!"))
|
Reference in New Issue
Block a user