From f5dc374ef81fc490540a33d3f424b7bf3ef03673 Mon Sep 17 00:00:00 2001 From: rhysd Date: Sat, 13 Jun 2015 22:14:19 +0900 Subject: [PATCH] rename types.cr to expr.cr I did not separate types.cr to type.cr and expr.cr because function type requires the definition of Crisp::Expr. They depend on each definitions. --- src/crisp/core.cr | 2 +- src/crisp/env.cr | 2 +- src/crisp/evaluator.cr | 2 +- src/crisp/{types.cr => expr.cr} | 4 ++-- src/crisp/interpreter.cr | 2 +- src/crisp/printer.cr | 2 +- src/crisp/reader.cr | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) rename src/crisp/{types.cr => expr.cr} (92%) diff --git a/src/crisp/core.cr b/src/crisp/core.cr index 747b65b..dc050c6 100644 --- a/src/crisp/core.cr +++ b/src/crisp/core.cr @@ -1,7 +1,7 @@ require "time" require "readline" -require "./types" +require "./expr" require "./error" require "./printer" require "./reader" diff --git a/src/crisp/env.cr b/src/crisp/env.cr index 26f50a9..1dea91c 100644 --- a/src/crisp/env.cr +++ b/src/crisp/env.cr @@ -1,4 +1,4 @@ -require "./types" +require "./expr" require "./error" module Crisp diff --git a/src/crisp/evaluator.cr b/src/crisp/evaluator.cr index 4fa189f..c2aafb5 100644 --- a/src/crisp/evaluator.cr +++ b/src/crisp/evaluator.cr @@ -3,7 +3,7 @@ require "readline" require "./reader" require "./printer" -require "./types" +require "./expr" require "./env" require "./core" require "./error" diff --git a/src/crisp/types.cr b/src/crisp/expr.cr similarity index 92% rename from src/crisp/types.cr rename to src/crisp/expr.cr index fb2898a..0b6ab54 100644 --- a/src/crisp/types.cr +++ b/src/crisp/expr.cr @@ -40,14 +40,14 @@ module Crisp class Expr alias Func = (Array(Expr) -> Expr) - alias ValueExpr = Nil | Bool | Int32 | String | Symbol | List | Vector | HashMap | Func | Closure | Atom + 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 : ValueExpr) + def initialize(@val : Type) @is_macro = false @meta = nil end diff --git a/src/crisp/interpreter.cr b/src/crisp/interpreter.cr index 489fae0..e9cbcaa 100644 --- a/src/crisp/interpreter.cr +++ b/src/crisp/interpreter.cr @@ -3,7 +3,7 @@ require "readline" require "./reader" require "./printer" -require "./types" +require "./expr" require "./env" require "./core" require "./error" diff --git a/src/crisp/printer.cr b/src/crisp/printer.cr index 4072751..15311d5 100644 --- a/src/crisp/printer.cr +++ b/src/crisp/printer.cr @@ -1,4 +1,4 @@ -require "./types" +require "./expr" module Crisp class Printer diff --git a/src/crisp/reader.cr b/src/crisp/reader.cr index ddbcde9..7efc5c5 100644 --- a/src/crisp/reader.cr +++ b/src/crisp/reader.cr @@ -1,4 +1,4 @@ -require "./types" +require "./expr" require "./error" module Crisp