@@ -3,7 +3,7 @@ import text/StringTokenizer
3
3
4
4
5
5
Value : abstract class {
6
- type : abstract func -> String
6
+ type : abstract func -> Class
7
7
toString : abstract func -> String
8
8
}
9
9
@@ -12,7 +12,7 @@ StringValue: class extends Value {
12
12
13
13
init : func (= value ) {}
14
14
15
- type : func -> String { " String" }
15
+ type : func -> Class { String }
16
16
toString : func -> String { value }
17
17
}
18
18
@@ -21,7 +21,7 @@ BoolValue: class extends Value {
21
21
22
22
init : func (= value ) {}
23
23
24
- type : func -> String { " Bool" }
24
+ type : func -> Class { Bool }
25
25
toString : func -> String { value toString () }
26
26
27
27
isTrue : func -> Bool { value }
@@ -32,7 +32,7 @@ ListValue: class extends Value {
32
32
33
33
init : func (= list ) {}
34
34
35
- type : func -> String { " List" }
35
+ type : func -> Class { List }
36
36
toString : func -> String { "List size=%d" format (list size ()) }
37
37
38
38
list : func -> List < Value> { list }
@@ -43,7 +43,7 @@ HashValue: class extends Value {
43
43
44
44
init : func (= hash ) {}
45
45
46
- type : func -> String { "Hash" }
46
+ type : func -> Class { HashMap }
47
47
toString : func -> String { "Hash" }
48
48
49
49
hash : func -> HashMap < Value> { hash }
@@ -90,7 +90,7 @@ Context: class {
90
90
tokenizer := StringTokenizer new (expression, ' ' )
91
91
for (name : String in tokenizer) {
92
92
next = currentHash get (name)
93
- if (! next || next type () ! = "Hash" ) break
93
+ if (! next || next type () ! = HashMap ) break
94
94
95
95
currentHash = (next as HashValue ) hash ()
96
96
}
0 commit comments