From a8c83f35ddfe2fbfebca803306b273c14bada8e1 Mon Sep 17 00:00:00 2001 From: rhysd Date: Sat, 31 Oct 2015 15:14:02 +0900 Subject: [PATCH] support Crystal 0.9 --- README.md | 2 +- spec/crisp/mal_specs/mal_spec_runner.cr | 2 +- src/crisp/core.cr | 112 ++++++++++++------------ 3 files changed, 58 insertions(+), 58 deletions(-) diff --git a/README.md b/README.md index c8afaf6..5f40e1d 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ Please see [mal test cases](https://github.com/rhysd/Crisp/tree/master/spec/cris ## Development Environment - OS X -- Crystal 0.7.1 ~ 0.7.3 or 0.7.7 +- Crystal 0.7.1 ~ 0.7.3 or 0.7.7 ~ 0.9.0 ## License diff --git a/spec/crisp/mal_specs/mal_spec_runner.cr b/spec/crisp/mal_specs/mal_spec_runner.cr index d465c8a..a9e31fa 100644 --- a/spec/crisp/mal_specs/mal_spec_runner.cr +++ b/spec/crisp/mal_specs/mal_spec_runner.cr @@ -2,7 +2,7 @@ class MalTestRunner def initialize(@test_file) end - private macro check_EOF + macro check_EOF return if l.is_a? Iterator::Stop end diff --git a/src/crisp/core.cr b/src/crisp/core.cr index 988aaf0..fe2b148 100644 --- a/src/crisp/core.cr +++ b/src/crisp/core.cr @@ -353,62 +353,62 @@ module Crisp end NameSpace = { - "+" => calc_op(:+) - "-" => calc_op(:-) - "*" => calc_op(:*) - "/" => calc_op(:/) - "list" => func(:list) - "list?" => func(:list?) - "empty?" => func(:empty?) - "count" => func(:count) - "=" => rel_op(:==) - "<" => rel_op(:<) - ">" => rel_op(:>) - "<=" => rel_op(:<=) - ">=" => rel_op(:>=) - "pr-str" => func(:pr_str) - "str" => func(:str) - "prn" => func(:prn) - "println" => func(:println) - "read-string" => func(:read_string) - "slurp" => func(:slurp) - "cons" => func(:cons) - "concat" => func(:concat) - "nth" => func(:nth) - "first" => func(:first) - "rest" => func(:rest) - "throw" => -> (args : Array(Crisp::Expr)) { raise Crisp::RuntimeException.new args[0] } - "apply" => func(:apply) - "map" => func(:map) - "nil?" => func(:nil?) - "true?" => func(:true?) - "false?" => func(:false?) - "symbol?" => func(:symbol?) - "symbol" => func(:symbol) - "keyword" => func(:keyword) - "keyword?" => func(:keyword?) - "vector" => func(:vector) - "vector?" => func(:vector?) - "hash-map" => func(:hash_map) - "map?" => func(:map?) - "assoc" => func(:assoc) - "dissoc" => func(:dissoc) - "get" => func(:get) - "contains?" => func(:contains?) - "keys" => func(:keys) - "vals" => func(:vals) - "sequential?" => func(:sequential?) - "readline" => func(:readline) - "meta" => func(:meta) - "with-meta" => func(:with_meta) - "atom" => func(:atom) - "atom?" => func(:atom?) - "deref" => func(:deref) - "deref" => func(:deref) - "reset!" => func(:reset!) - "swap!" => func(:swap!) - "conj" => func(:conj) - "time-ms" => func(:time_ms) + "+" => calc_op(:+), + "-" => calc_op(:-), + "*" => calc_op(:*), + "/" => calc_op(:/), + "list" => func(:list), + "list?" => func(:list?), + "empty?" => func(:empty?), + "count" => func(:count), + "=" => rel_op(:==), + "<" => rel_op(:<), + ">" => rel_op(:>), + "<=" => rel_op(:<=), + ">=" => rel_op(:>=), + "pr-str" => func(:pr_str), + "str" => func(:str), + "prn" => func(:prn), + "println" => func(:println), + "read-string" => func(:read_string), + "slurp" => func(:slurp), + "cons" => func(:cons), + "concat" => func(:concat), + "nth" => func(:nth), + "first" => func(:first), + "rest" => func(:rest), + "throw" => -> (args : Array(Crisp::Expr)) { raise Crisp::RuntimeException.new args[0] }, + "apply" => func(:apply), + "map" => func(:map), + "nil?" => func(:nil?), + "true?" => func(:true?), + "false?" => func(:false?), + "symbol?" => func(:symbol?), + "symbol" => func(:symbol), + "keyword" => func(:keyword), + "keyword?" => func(:keyword?), + "vector" => func(:vector), + "vector?" => func(:vector?), + "hash-map" => func(:hash_map), + "map?" => func(:map?), + "assoc" => func(:assoc), + "dissoc" => func(:dissoc), + "get" => func(:get), + "contains?" => func(:contains?), + "keys" => func(:keys), + "vals" => func(:vals), + "sequential?" => func(:sequential?), + "readline" => func(:readline), + "meta" => func(:meta), + "with-meta" => func(:with_meta), + "atom" => func(:atom), + "atom?" => func(:atom?), + "deref" => func(:deref), + "deref" => func(:deref), + "reset!" => func(:reset!), + "swap!" => func(:swap!), + "conj" => func(:conj), + "time-ms" => func(:time_ms), } of String => Crisp::Func end