Browse Source

support Crystal 0.9

master
rhysd 9 years ago
parent
commit
a8c83f35dd
3 changed files with 58 additions and 58 deletions
  1. +1
    -1
      README.md
  2. +1
    -1
      spec/crisp/mal_specs/mal_spec_runner.cr
  3. +56
    -56
      src/crisp/core.cr

+ 1
- 1
README.md View File

@ -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

+ 1
- 1
spec/crisp/mal_specs/mal_spec_runner.cr View File

@ -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

+ 56
- 56
src/crisp/core.cr View File

@ -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

Loading…
Cancel
Save