Bladeren bron

update for Crystal 0.17.4

master
rhysd 8 jaren geleden
bovenliggende
commit
f661185d6f
6 gewijzigde bestanden met toevoegingen van 10 en 13 verwijderingen
  1. +1
    -1
      README.md
  2. +2
    -2
      src/crisp/core.cr
  3. +1
    -1
      src/crisp/env.cr
  4. +1
    -1
      src/crisp/error.cr
  5. +4
    -7
      src/crisp/expr.cr
  6. +1
    -1
      src/crisp/reader.cr

+ 1
- 1
README.md Bestand weergeven

@ -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 ~ 0.11.0
- Crystal 0.7.1 ~ 0.7.3 or 0.7.7 ~ 0.11.0 or 0.17.4
## License

+ 2
- 2
src/crisp/core.cr Bestand weergeven

@ -149,7 +149,7 @@ module Crisp
end
end
def nil?(args)
def nil_value?(args)
args.first.unwrap.nil?
end
@ -380,7 +380,7 @@ module Crisp
"throw" => -> (args : Array(Crisp::Expr)) { raise Crisp::RuntimeException.new args[0] },
"apply" => func(:apply),
"map" => func(:map),
"nil?" => func(:nil?),
"nil?" => func(:nil_value?),
"true?" => func(:true?),
"false?" => func(:false?),
"symbol?" => func(:symbol?),

+ 1
- 1
src/crisp/env.cr Bestand weergeven

@ -6,7 +6,7 @@ module Crisp
class Env
property data
def initialize(@outer = nil)
def initialize(@outer p">: Env? = nil)
@data = {} of String => Crisp::Expr
end

+ 1
- 1
src/crisp/error.cr Bestand weergeven

@ -9,7 +9,7 @@ module Crisp
class RuntimeException < Exception
getter :thrown
def initialize(@thrown)
def initialize(@thrown : Crisp::Expr)
super()
end
end

+ 4
- 7
src/crisp/expr.cr Bestand weergeven

@ -5,7 +5,7 @@ module Crisp
class Symbol
property :str
def initialize(@str)
def initialize(@str : String)
end
def ==(other : Symbol)
@ -24,7 +24,7 @@ module Crisp
class Atom
property :val
def initialize(@val)
def initialize(@val : Expr)
end
def ==(rhs : Atom)
@ -34,7 +34,7 @@ module Crisp
class Closure
property :ast, :params, :env, :fn
def initialize(@ast, @params, @env, @fn)
def initialize(@ast : Expr, @params : List | Vector, @env : Env, @fn : Func)
end
end
@ -42,14 +42,11 @@ module Crisp
alias Func = (Array(Expr) -> Expr)
alias Type = Nil | Bool | Int32 | String | Symbol | List | Vector | HashMap | Func | Closure | Atom
is_macro :: Bool
meta :: Expr
property :is_macro, :meta
def initialize(@val : Type)
@is_macro = false
@meta = nil
@meta = nil as Expr?
end
def initialize(other : Expr)

+ 1
- 1
src/crisp/reader.cr Bestand weergeven

@ -5,7 +5,7 @@ module Crisp
extend self
class Reader
def initialize(@tokens)
def initialize(@tokens : Array(String))
@pos = 0
end

Laden…
Annuleren
Opslaan