rus3 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/Gemfile.lock +6 -1
- data/lib/rus3.rb +5 -4
- data/lib/rus3/evaluator/environment.rb +2 -0
- data/lib/rus3/evaluator/scheme_evaluator.rb +7 -12
- data/lib/rus3/evaluator/translator.rb +89 -46
- data/lib/rus3/printer.rb +41 -5
- data/lib/rus3/procedure/arithmetic.rb +45 -0
- data/lib/rus3/procedure/comparison.rb +45 -0
- data/lib/rus3/repl.rb +26 -31
- data/lib/rus3/version.rb +2 -2
- data/rus3.gemspec +4 -7
- metadata +35 -13
- data/lib/rus3/ast.rb +0 -70
- data/lib/rus3/ast/branch_node.rb +0 -412
- data/lib/rus3/ast/error.rb +0 -8
- data/lib/rus3/ast/leaf_node.rb +0 -55
- data/lib/rus3/lexer.rb +0 -104
- data/lib/rus3/parser.rb +0 -87
- data/lib/rus3/parser/scheme_parser.rb +0 -657
- data/lib/rus3/token.rb +0 -35
data/lib/rus3/token.rb
DELETED
@@ -1,35 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Rus3
|
4
|
-
|
5
|
-
TOKEN_TYPES = [ # :nodoc:
|
6
|
-
# delimiters
|
7
|
-
:lparen, # `(`
|
8
|
-
:rparen, # `)`
|
9
|
-
:vec_lparen, # `#(`
|
10
|
-
:bytevec_lparen, # `#u8(`
|
11
|
-
:quotation, # `'`
|
12
|
-
:backquote, # "`" (aka quasiquote)
|
13
|
-
:comma, # `,`
|
14
|
-
:comma_at, # `,@`
|
15
|
-
:dot, # `.`
|
16
|
-
:semicolon, # `;`
|
17
|
-
:comment_lparen, # `#|`
|
18
|
-
:comment_rparen, # `|#`
|
19
|
-
# value types
|
20
|
-
:identifier, # `foo`
|
21
|
-
:boolean, # `#f` or `#t` (`#false` or `#true`)
|
22
|
-
:number, # `123`, `456.789`, `1/2`, `3+4i`
|
23
|
-
:character, # `#\a`
|
24
|
-
:string, # `"hoge"`
|
25
|
-
# operators
|
26
|
-
:op_proc, # `+`, `-`, ...
|
27
|
-
# control
|
28
|
-
:illegal,
|
29
|
-
]
|
30
|
-
|
31
|
-
Token = Struct.new(:type, :literal) {
|
32
|
-
alias :to_s :literal
|
33
|
-
}
|
34
|
-
|
35
|
-
end
|