turmali 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +33 -11
- data/lib/turmali/grammar.y +1 -0
- data/lib/turmali/lexer.rb +2 -7
- data/lib/turmali/nodes.rb +1 -1
- data/lib/turmali/parser.rb +327 -277
- data/lib/turmali/runtime/bootstrap.rb +38 -0
- data/lib/turmali/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 50dd915336d790bddf699cd67b7797adfe1bba8c
|
4
|
+
data.tar.gz: cee91a42f507574fade6bed46169ac6989ce7d8e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ad708d750e12f349a327f455bfc556063b7c8956ca397d7737c57e3f27a9eb792fb761b788064c912cdb668b5ed7b2cd696bc8c62da3b15c863fb82dd3a138ce
|
7
|
+
data.tar.gz: 3157d41c7af42ad24c94fad99c840449f9250b6a6a37bbb054a03e656eed85a9a5f7ae2389b627947f95c63347ff2b060d47854235263c3afbc1e9de7fa6658a
|
data/README.md
CHANGED
@@ -2,32 +2,52 @@
|
|
2
2
|
|
3
3
|
![Turmali Logo](turmali.png "Turmali Logo")
|
4
4
|
|
5
|
-
Turmali is a website building language.
|
5
|
+
## Turmali is a website building language.
|
6
6
|
|
7
7
|
▪ As in Python, blocks of code are delimited by their indentation.
|
8
8
|
▪ Classes are declared with the class keyword.
|
9
9
|
▪ Methods can be defined anywhere using the def keyword.
|
10
10
|
▪ Identifiers starting with a capital letter are constants which are globally accessible.
|
11
11
|
▪ Lower-case identifiers are local variables or method names.
|
12
|
-
▪ If a method has a receiver and no argument, parenthesis can be skipped
|
12
|
+
▪ If a method has a receiver and no argument, parenthesis can be skipped.
|
13
13
|
▪ The last value evaluated in a method is its return value.
|
14
14
|
▪ Everything is an object.
|
15
15
|
|
16
16
|
## Example
|
17
17
|
|
18
|
-
```
|
18
|
+
```example.tml
|
19
19
|
class Turmali:
|
20
20
|
def name:
|
21
|
-
"
|
22
|
-
def
|
23
|
-
|
24
|
-
|
21
|
+
"hello eiffel"
|
22
|
+
def method:
|
23
|
+
a = 5
|
24
|
+
if a > 3.0:
|
25
|
+
a = 3.4
|
26
|
+
b = 5.7
|
27
|
+
c = a + b
|
28
|
+
c
|
25
29
|
|
26
30
|
tml = Turmali.new
|
27
|
-
print(tml.name)
|
28
|
-
print(tml.
|
31
|
+
print(tml.name)
|
32
|
+
print(tml.method)
|
29
33
|
```
|
30
34
|
|
35
|
+
## Requirement
|
36
|
+
|
37
|
+
### windows
|
38
|
+
|
39
|
+
https://rubyinstaller.org/
|
40
|
+
|
41
|
+
### mac osx
|
42
|
+
|
43
|
+
Since now all Mac OSX system preinstalled ruby enviroment, that's not a big issue.
|
44
|
+
|
45
|
+
recommend install ruby through:
|
46
|
+
|
47
|
+
1: rbenv https://github.com/rbenv/rbenv
|
48
|
+
|
49
|
+
2: rvm http://www.rvm.io/
|
50
|
+
|
31
51
|
## Installation
|
32
52
|
|
33
53
|
Add this line to your application's Gemfile:
|
@@ -43,11 +63,13 @@ And then execute:
|
|
43
63
|
Or install it yourself as:
|
44
64
|
|
45
65
|
$ gem install turmali
|
66
|
+
or
|
67
|
+
$ sudo gem install turmali # require admin role
|
46
68
|
|
47
69
|
## Usage
|
48
70
|
|
49
|
-
$ tml example.tml
|
50
|
-
$ tml
|
71
|
+
$ tml example.tml # turmali interpreter mode
|
72
|
+
$ tml # turmali repl console mode
|
51
73
|
|
52
74
|
## License
|
53
75
|
|
data/lib/turmali/grammar.y
CHANGED
@@ -155,6 +155,7 @@ rule
|
|
155
155
|
| Expression '-' Expression { result = CallNode.new(val[0], val[1], [val[2]]) }
|
156
156
|
| Expression '*' Expression { result = CallNode.new(val[0], val[1], [val[2]]) }
|
157
157
|
| Expression '/' Expression { result = CallNode.new(val[0], val[1], [val[2]]) }
|
158
|
+
| '!' Expression { result = CallNode.new(val[1], val[0], []) }
|
158
159
|
;
|
159
160
|
|
160
161
|
# Then we have rules for getting and setting values of constants and local variables.
|
data/lib/turmali/lexer.rb
CHANGED
@@ -25,8 +25,8 @@ class Lexer
|
|
25
25
|
tokens << [:CONSTANT, constant]
|
26
26
|
i += constant.size
|
27
27
|
|
28
|
-
elsif number = chunk[/\A(
|
29
|
-
tokens << [:NUMBER, number.
|
28
|
+
elsif number = chunk[/\A(\d+(\.\d+)?)/, 1]
|
29
|
+
tokens << [:NUMBER, number.to_f]
|
30
30
|
i += number.size
|
31
31
|
|
32
32
|
elsif string = chunk[/\A"([^"]*)"/, 1]
|
@@ -57,21 +57,16 @@ class Lexer
|
|
57
57
|
raise "Missing ':'"
|
58
58
|
end
|
59
59
|
i += indent.size + 1
|
60
|
-
|
61
60
|
elsif operator = chunk[/\A(\|\||&&|==|!=|<=|>=)/, 1]
|
62
61
|
tokens << [operator, operator]
|
63
62
|
i += operator.size
|
64
|
-
|
65
63
|
elsif chunk.match(/\A /)
|
66
64
|
i += 1
|
67
|
-
|
68
65
|
else
|
69
66
|
value = chunk[0,1]
|
70
67
|
tokens << [value, value]
|
71
68
|
i += 1
|
72
|
-
|
73
69
|
end
|
74
|
-
|
75
70
|
end
|
76
71
|
|
77
72
|
while indent = indent_stack.pop
|
data/lib/turmali/nodes.rb
CHANGED
data/lib/turmali/parser.rb
CHANGED
@@ -11,7 +11,7 @@ require 'racc/parser.rb'
|
|
11
11
|
|
12
12
|
class Parser < Racc::Parser
|
13
13
|
|
14
|
-
module_eval(<<'...end grammar.y/module_eval...', 'grammar.y',
|
14
|
+
module_eval(<<'...end grammar.y/module_eval...', 'grammar.y', 227)
|
15
15
|
def parse(code, show_tokens=false)
|
16
16
|
@tokens = Lexer.new.tokenize(code) # Tokenize the code using our lexer
|
17
17
|
puts @tokens.inspect if show_tokens
|
@@ -25,214 +25,245 @@ module_eval(<<'...end grammar.y/module_eval...', 'grammar.y', 220)
|
|
25
25
|
##### State transition tables begin ###
|
26
26
|
|
27
27
|
racc_action_table = [
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
22, 23, 24,
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
19, 20, 21, 22, 23, 24,
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
21, 22, 23, 24,
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
nil,
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
40,
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
28
|
+
29, 27, 28, 17, 19, 20, 21, 22, 23, 24,
|
29
|
+
26, 33, 33, 30, 77, 25, 29, 27, 28, 17,
|
30
|
+
19, 20, 21, 22, 23, 24, 26, 17, 58, 30,
|
31
|
+
16, 25, 18, 79, 29, 27, 28, 56, 19, 20,
|
32
|
+
21, 22, 23, 24, 26, 53, 16, 30, 18, 25,
|
33
|
+
85, 52, 84, 29, 27, 28, 18, 19, 20, 21,
|
34
|
+
22, 23, 24, 26, 16, 73, 30, 88, 25, 29,
|
35
|
+
27, 28, 51, 19, 20, 21, 22, 23, 24, 26,
|
36
|
+
31, 77, 30, 16, 25, 29, 27, 28, 77, 19,
|
37
|
+
20, 21, 22, 23, 24, 26, 48, 94, 30, 16,
|
38
|
+
25, 29, 27, 28, 33, 19, 20, 21, 22, 23,
|
39
|
+
24, 26, nil, nil, 30, 16, 25, 29, 27, 28,
|
40
|
+
nil, 19, 20, 21, 22, 23, 24, 26, nil, nil,
|
41
|
+
30, 16, 25, 29, 27, 28, nil, 19, 20, 21,
|
42
|
+
22, 23, 24, 26, nil, nil, 30, 16, 25, 29,
|
43
|
+
27, 28, nil, 19, 20, 21, 22, 23, 24, 26,
|
44
|
+
nil, nil, 30, 16, 25, 29, 27, 28, nil, 19,
|
45
|
+
20, 21, 22, 23, 24, 26, nil, nil, 30, 16,
|
46
|
+
25, 29, 27, 28, nil, 19, 20, 21, 22, 23,
|
47
|
+
24, 26, nil, nil, 30, 16, 25, 29, 27, 28,
|
48
|
+
nil, 19, 20, 21, 22, 23, 24, 26, nil, nil,
|
49
|
+
30, 16, 25, 29, 27, 28, nil, 19, 20, 21,
|
50
|
+
22, 23, 24, 26, nil, nil, 30, 16, 25, 29,
|
51
|
+
27, 28, nil, 19, 20, 21, 22, 23, 24, 26,
|
52
|
+
nil, nil, 30, 16, 25, 29, 27, 28, nil, 19,
|
53
|
+
20, 21, 22, 23, 24, 26, nil, nil, 30, 16,
|
54
|
+
25, 29, 27, 28, nil, 19, 20, 21, 22, 23,
|
55
|
+
24, 26, nil, nil, 30, 16, 25, 29, 27, 28,
|
56
|
+
nil, 19, 20, 21, 22, 23, 24, 26, nil, nil,
|
57
|
+
30, 16, 25, 29, 27, 28, nil, 19, 20, 21,
|
58
|
+
22, 23, 24, 26, nil, nil, 30, 16, 25, 29,
|
59
|
+
27, 28, nil, 19, 20, 21, 22, 23, 24, 26,
|
60
|
+
nil, nil, 30, 16, 25, 29, 27, 28, nil, 19,
|
61
|
+
20, 21, 22, 23, 24, 26, nil, nil, 30, 16,
|
62
|
+
25, 29, 27, 28, 17, 19, 20, 21, 22, 23,
|
63
|
+
24, 26, nil, 90, 30, 16, 25, 29, 27, 28,
|
64
|
+
nil, 19, 20, 21, 22, 23, 24, 26, nil, nil,
|
65
|
+
30, 16, 25, 18, 33, nil, 44, 45, 42, 43,
|
66
|
+
38, 39, 40, 41, 36, 37, 33, 16, 44, 45,
|
67
|
+
42, 43, 38, 39, 40, 41, 36, 37, 35, 34,
|
68
|
+
49, 77, 48, 71, 33, nil, 44, 45, 42, 43,
|
69
|
+
38, 39, 40, 41, 36, 37, 35, 34, 77, nil,
|
70
|
+
92, 33, 91, 44, 45, 42, 43, 38, 39, 40,
|
71
|
+
41, 36, 37, 35, 34, 33, nil, 44, 45, 42,
|
72
|
+
43, 38, 39, 40, 41, 36, 37, 35, 34, 33,
|
73
|
+
nil, 44, 45, 42, 43, 38, 39, 40, 41, 36,
|
74
|
+
37, 35, 34, 33, nil, 44, 45, 42, 43, 38,
|
75
|
+
39, 40, 41, 36, 37, 35, 34, 33, nil, 44,
|
76
|
+
45, 42, 43, 38, 39, 40, 41, 36, 37, 35,
|
77
|
+
34, 33, nil, 44, 45, 42, 43, 38, 39, 40,
|
78
|
+
41, 36, 37, 35, 34, 33, nil, 44, 45, 42,
|
79
|
+
43, 38, 39, 40, 41, 36, 37, 35, 34, 33,
|
80
|
+
nil, 44, 45, 42, 43, 38, 39, 40, 41, 36,
|
81
|
+
37, 35, 33, nil, 44, 45, 42, 43, 38, 39,
|
82
|
+
40, 41, 33, nil, 44, 45, 42, 43, 38, 39,
|
83
|
+
40, 41, 33, nil, 44, 45, 42, 43, 33, nil,
|
84
|
+
44, 45, 42, 43, 33, nil, 44, 45, 42, 43,
|
85
|
+
33, nil, 44, 45, 42, 43, 33, nil, 44, 45,
|
86
|
+
33, nil, 44, 45 ]
|
75
87
|
|
76
88
|
racc_action_check = [
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
nil,
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
54, 54,
|
121
|
-
|
122
|
-
|
123
|
-
|
89
|
+
77, 77, 77, 77, 77, 77, 77, 77, 77, 77,
|
90
|
+
77, 69, 70, 77, 52, 77, 0, 0, 0, 0,
|
91
|
+
0, 0, 0, 0, 0, 0, 0, 2, 33, 0,
|
92
|
+
77, 0, 77, 52, 48, 48, 48, 31, 48, 48,
|
93
|
+
48, 48, 48, 48, 48, 28, 0, 48, 0, 48,
|
94
|
+
74, 27, 74, 16, 16, 16, 2, 16, 16, 16,
|
95
|
+
16, 16, 16, 16, 48, 48, 16, 79, 16, 49,
|
96
|
+
49, 49, 26, 49, 49, 49, 49, 49, 49, 49,
|
97
|
+
1, 91, 49, 16, 49, 25, 25, 25, 53, 25,
|
98
|
+
25, 25, 25, 25, 25, 25, 58, 92, 25, 49,
|
99
|
+
25, 85, 85, 85, 50, 85, 85, 85, 85, 85,
|
100
|
+
85, 85, nil, nil, 85, 25, 85, 29, 29, 29,
|
101
|
+
nil, 29, 29, 29, 29, 29, 29, 29, nil, nil,
|
102
|
+
29, 85, 29, 30, 30, 30, nil, 30, 30, 30,
|
103
|
+
30, 30, 30, 30, nil, nil, 30, 29, 30, 45,
|
104
|
+
45, 45, nil, 45, 45, 45, 45, 45, 45, 45,
|
105
|
+
nil, nil, 45, 30, 45, 32, 32, 32, nil, 32,
|
106
|
+
32, 32, 32, 32, 32, 32, nil, nil, 32, 45,
|
107
|
+
32, 44, 44, 44, nil, 44, 44, 44, 44, 44,
|
108
|
+
44, 44, nil, nil, 44, 32, 44, 34, 34, 34,
|
109
|
+
nil, 34, 34, 34, 34, 34, 34, 34, nil, nil,
|
110
|
+
34, 44, 34, 35, 35, 35, nil, 35, 35, 35,
|
111
|
+
35, 35, 35, 35, nil, nil, 35, 34, 35, 36,
|
112
|
+
36, 36, nil, 36, 36, 36, 36, 36, 36, 36,
|
113
|
+
nil, nil, 36, 35, 36, 37, 37, 37, nil, 37,
|
114
|
+
37, 37, 37, 37, 37, 37, nil, nil, 37, 36,
|
115
|
+
37, 38, 38, 38, nil, 38, 38, 38, 38, 38,
|
116
|
+
38, 38, nil, nil, 38, 37, 38, 39, 39, 39,
|
117
|
+
nil, 39, 39, 39, 39, 39, 39, 39, nil, nil,
|
118
|
+
39, 38, 39, 40, 40, 40, nil, 40, 40, 40,
|
119
|
+
40, 40, 40, 40, nil, nil, 40, 39, 40, 42,
|
120
|
+
42, 42, nil, 42, 42, 42, 42, 42, 42, 42,
|
121
|
+
nil, nil, 42, 40, 42, 41, 41, 41, nil, 41,
|
122
|
+
41, 41, 41, 41, 41, 41, nil, nil, 41, 42,
|
123
|
+
41, 43, 43, 43, 86, 43, 43, 43, 43, 43,
|
124
|
+
43, 43, nil, 86, 43, 41, 43, 51, 51, 51,
|
125
|
+
nil, 51, 51, 51, 51, 51, 51, 51, nil, nil,
|
126
|
+
51, 43, 51, 86, 60, nil, 60, 60, 60, 60,
|
127
|
+
60, 60, 60, 60, 60, 60, 46, 51, 46, 46,
|
128
|
+
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
|
129
|
+
24, 55, 24, 46, 55, nil, 55, 55, 55, 55,
|
130
|
+
55, 55, 55, 55, 55, 55, 55, 55, 54, nil,
|
131
|
+
87, 54, 87, 54, 54, 54, 54, 54, 54, 54,
|
132
|
+
54, 54, 54, 54, 54, 89, nil, 89, 89, 89,
|
133
|
+
89, 89, 89, 89, 89, 89, 89, 89, 89, 72,
|
134
|
+
nil, 72, 72, 72, 72, 72, 72, 72, 72, 72,
|
135
|
+
72, 72, 72, 75, nil, 75, 75, 75, 75, 75,
|
136
|
+
75, 75, 75, 75, 75, 75, 75, 76, nil, 76,
|
137
|
+
76, 76, 76, 76, 76, 76, 76, 76, 76, 76,
|
138
|
+
76, 3, nil, 3, 3, 3, 3, 3, 3, 3,
|
139
|
+
3, 3, 3, 3, 3, 57, nil, 57, 57, 57,
|
140
|
+
57, 57, 57, 57, 57, 57, 57, 57, 57, 59,
|
141
|
+
nil, 59, 59, 59, 59, 59, 59, 59, 59, 59,
|
142
|
+
59, 59, 61, nil, 61, 61, 61, 61, 61, 61,
|
143
|
+
61, 61, 62, nil, 62, 62, 62, 62, 62, 62,
|
144
|
+
62, 62, 66, nil, 66, 66, 66, 66, 63, nil,
|
145
|
+
63, 63, 63, 63, 65, nil, 65, 65, 65, 65,
|
146
|
+
64, nil, 64, 64, 64, 64, 68, nil, 68, 68,
|
147
|
+
67, nil, 67, 67 ]
|
124
148
|
|
125
149
|
racc_action_pointer = [
|
126
|
-
|
127
|
-
nil, nil, nil, nil, nil,
|
128
|
-
nil, nil, nil,
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
150
|
+
14, 80, 22, 475, nil, nil, nil, nil, nil, nil,
|
151
|
+
nil, nil, nil, nil, nil, nil, 51, nil, nil, nil,
|
152
|
+
nil, nil, nil, nil, 370, 83, 42, 40, 33, 115,
|
153
|
+
131, 37, 163, 17, 195, 211, 227, 243, 259, 275,
|
154
|
+
291, 323, 307, 339, 179, 147, 370, nil, 32, 67,
|
155
|
+
88, 355, 1, 75, 405, 388, nil, 489, 64, 503,
|
156
|
+
358, 516, 526, 542, 554, 548, 536, 564, 560, -5,
|
157
|
+
-4, nil, 433, nil, 19, 447, 461, -2, nil, 56,
|
158
|
+
nil, nil, nil, nil, nil, 99, 339, 389, nil, 419,
|
159
|
+
nil, 68, 86, nil, nil ]
|
135
160
|
|
136
161
|
racc_action_default = [
|
137
|
-
-1, -
|
138
|
-
-12, -13, -14, -15, -16, -
|
139
|
-
-22, -23, -24, -
|
140
|
-
-
|
141
|
-
-
|
142
|
-
-
|
143
|
-
-
|
144
|
-
-
|
145
|
-
-56, -
|
162
|
+
-1, -59, -2, -3, -6, -7, -8, -9, -10, -11,
|
163
|
+
-12, -13, -14, -15, -16, -17, -59, -19, -20, -21,
|
164
|
+
-22, -23, -24, -25, -48, -59, -46, -59, -59, -59,
|
165
|
+
-59, -59, -5, -59, -59, -59, -59, -59, -59, -59,
|
166
|
+
-59, -59, -59, -59, -59, -59, -59, -26, -59, -59,
|
167
|
+
-45, -59, -59, -59, -59, -59, 95, -4, -28, -33,
|
168
|
+
-34, -35, -36, -37, -38, -39, -40, -41, -42, -43,
|
169
|
+
-44, -18, -31, -29, -59, -49, -47, -59, -51, -53,
|
170
|
+
-56, -57, -58, -27, -30, -59, -59, -59, -54, -32,
|
171
|
+
-50, -59, -59, -52, -55 ]
|
146
172
|
|
147
173
|
racc_goto_table = [
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
nil, nil,
|
152
|
-
|
174
|
+
32, 2, 46, 78, 80, 81, 82, 47, 87, 74,
|
175
|
+
1, 50, nil, nil, nil, 54, 55, nil, 57, nil,
|
176
|
+
59, 60, 61, 62, 63, 64, 65, 66, 67, 68,
|
177
|
+
69, 70, nil, nil, 72, 75, nil, 76, nil, nil,
|
178
|
+
nil, 83, 93, nil, nil, nil, nil, nil, nil, nil,
|
153
179
|
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
154
|
-
nil, nil, nil, nil, nil, nil,
|
155
|
-
nil, nil, nil,
|
180
|
+
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
181
|
+
nil, 89, nil, nil, nil, nil, nil, nil, 86, nil,
|
182
|
+
nil, nil, nil, nil, 32 ]
|
156
183
|
|
157
184
|
racc_goto_check = [
|
158
|
-
4, 2, 3,
|
159
|
-
|
185
|
+
4, 2, 3, 18, 18, 18, 18, 16, 19, 17,
|
186
|
+
1, 3, nil, nil, nil, 3, 3, nil, 3, nil,
|
160
187
|
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
|
161
|
-
nil, nil, 3, 3,
|
162
|
-
|
188
|
+
3, 3, nil, nil, 3, 3, nil, 3, nil, nil,
|
189
|
+
nil, 16, 18, nil, nil, nil, nil, nil, nil, nil,
|
190
|
+
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
163
191
|
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
164
|
-
nil,
|
165
|
-
nil, nil, nil,
|
192
|
+
nil, 3, nil, nil, nil, nil, nil, nil, 2, nil,
|
193
|
+
nil, nil, nil, nil, 4 ]
|
166
194
|
|
167
195
|
racc_goto_pointer = [
|
168
|
-
nil,
|
169
|
-
nil, nil, nil, nil, nil, -17, -
|
196
|
+
nil, 10, 1, -14, -2, nil, nil, nil, nil, nil,
|
197
|
+
nil, nil, nil, nil, nil, nil, -17, -39, -49, -71 ]
|
170
198
|
|
171
199
|
racc_goto_default = [
|
172
200
|
nil, nil, nil, 3, 4, 5, 6, 7, 8, 9,
|
173
|
-
10, 11, 12, 13, 14, nil, nil, nil, nil ]
|
201
|
+
10, 11, 12, 13, 14, 15, nil, nil, nil, nil ]
|
174
202
|
|
175
203
|
racc_reduce_table = [
|
176
204
|
0, 0, :racc_error,
|
177
|
-
0,
|
178
|
-
1,
|
179
|
-
1,
|
180
|
-
3,
|
181
|
-
2,
|
182
|
-
1,
|
183
|
-
1,
|
184
|
-
1,
|
185
|
-
1,
|
186
|
-
1,
|
187
|
-
1,
|
188
|
-
1, 37, :_reduce_none,
|
189
|
-
1, 37, :_reduce_none,
|
190
|
-
1, 37, :_reduce_none,
|
191
|
-
1, 37, :_reduce_none,
|
192
|
-
1, 37, :_reduce_none,
|
193
|
-
3, 37, :_reduce_17,
|
205
|
+
0, 36, :_reduce_1,
|
206
|
+
1, 36, :_reduce_2,
|
207
|
+
1, 37, :_reduce_3,
|
208
|
+
3, 37, :_reduce_4,
|
209
|
+
2, 37, :_reduce_5,
|
210
|
+
1, 37, :_reduce_6,
|
211
|
+
1, 38, :_reduce_none,
|
212
|
+
1, 38, :_reduce_none,
|
213
|
+
1, 38, :_reduce_none,
|
214
|
+
1, 38, :_reduce_none,
|
215
|
+
1, 38, :_reduce_none,
|
194
216
|
1, 38, :_reduce_none,
|
195
217
|
1, 38, :_reduce_none,
|
196
|
-
1,
|
197
|
-
1,
|
198
|
-
1,
|
199
|
-
1,
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
1,
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
3, 41, :
|
211
|
-
|
212
|
-
3,
|
213
|
-
|
214
|
-
3,
|
215
|
-
3,
|
216
|
-
3,
|
217
|
-
3,
|
218
|
-
3,
|
219
|
-
3,
|
220
|
-
|
221
|
-
3,
|
222
|
-
|
223
|
-
3,
|
224
|
-
3,
|
218
|
+
1, 38, :_reduce_none,
|
219
|
+
1, 38, :_reduce_none,
|
220
|
+
1, 38, :_reduce_none,
|
221
|
+
1, 38, :_reduce_none,
|
222
|
+
3, 38, :_reduce_18,
|
223
|
+
1, 39, :_reduce_none,
|
224
|
+
1, 39, :_reduce_none,
|
225
|
+
1, 40, :_reduce_21,
|
226
|
+
1, 40, :_reduce_22,
|
227
|
+
1, 40, :_reduce_23,
|
228
|
+
1, 40, :_reduce_24,
|
229
|
+
1, 40, :_reduce_25,
|
230
|
+
2, 41, :_reduce_26,
|
231
|
+
4, 41, :_reduce_27,
|
232
|
+
3, 41, :_reduce_28,
|
233
|
+
2, 51, :_reduce_29,
|
234
|
+
3, 51, :_reduce_30,
|
235
|
+
1, 52, :_reduce_31,
|
236
|
+
3, 52, :_reduce_32,
|
237
|
+
3, 42, :_reduce_33,
|
238
|
+
3, 42, :_reduce_34,
|
239
|
+
3, 42, :_reduce_35,
|
240
|
+
3, 42, :_reduce_36,
|
241
|
+
3, 42, :_reduce_37,
|
242
|
+
3, 42, :_reduce_38,
|
243
|
+
3, 42, :_reduce_39,
|
244
|
+
3, 42, :_reduce_40,
|
245
|
+
3, 42, :_reduce_41,
|
246
|
+
3, 42, :_reduce_42,
|
247
|
+
3, 42, :_reduce_43,
|
248
|
+
3, 42, :_reduce_44,
|
249
|
+
2, 42, :_reduce_45,
|
250
|
+
1, 43, :_reduce_46,
|
251
|
+
3, 44, :_reduce_47,
|
252
|
+
1, 45, :_reduce_48,
|
225
253
|
3, 46, :_reduce_49,
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
3,
|
254
|
+
3, 53, :_reduce_50,
|
255
|
+
3, 47, :_reduce_51,
|
256
|
+
6, 47, :_reduce_52,
|
257
|
+
0, 54, :_reduce_53,
|
258
|
+
1, 54, :_reduce_54,
|
259
|
+
3, 54, :_reduce_55,
|
260
|
+
3, 48, :_reduce_56,
|
261
|
+
3, 49, :_reduce_57,
|
262
|
+
3, 50, :_reduce_58 ]
|
232
263
|
|
233
|
-
racc_reduce_n =
|
264
|
+
racc_reduce_n = 59
|
234
265
|
|
235
|
-
racc_shift_n =
|
266
|
+
racc_shift_n = 95
|
236
267
|
|
237
268
|
racc_token_table = {
|
238
269
|
false => 0,
|
@@ -250,27 +281,28 @@ racc_token_table = {
|
|
250
281
|
:CONSTANT => 12,
|
251
282
|
:INDENT => 13,
|
252
283
|
:DEDENT => 14,
|
253
|
-
|
254
|
-
"
|
255
|
-
"
|
256
|
-
"
|
257
|
-
"
|
258
|
-
"
|
259
|
-
"
|
260
|
-
"
|
261
|
-
"
|
262
|
-
"
|
263
|
-
"
|
264
|
-
"
|
265
|
-
"
|
266
|
-
"
|
267
|
-
"
|
268
|
-
"
|
269
|
-
"
|
270
|
-
"
|
271
|
-
"
|
272
|
-
|
273
|
-
|
284
|
+
:WHILE => 15,
|
285
|
+
"." => 16,
|
286
|
+
"!" => 17,
|
287
|
+
"*" => 18,
|
288
|
+
"/" => 19,
|
289
|
+
"+" => 20,
|
290
|
+
"-" => 21,
|
291
|
+
">" => 22,
|
292
|
+
">=" => 23,
|
293
|
+
"<" => 24,
|
294
|
+
"<=" => 25,
|
295
|
+
"==" => 26,
|
296
|
+
"!=" => 27,
|
297
|
+
"&&" => 28,
|
298
|
+
"||" => 29,
|
299
|
+
"=" => 30,
|
300
|
+
"," => 31,
|
301
|
+
"(" => 32,
|
302
|
+
")" => 33,
|
303
|
+
";" => 34 }
|
304
|
+
|
305
|
+
racc_nt_base = 35
|
274
306
|
|
275
307
|
racc_use_result_var = true
|
276
308
|
|
@@ -306,6 +338,7 @@ Racc_token_to_s_table = [
|
|
306
338
|
"CONSTANT",
|
307
339
|
"INDENT",
|
308
340
|
"DEDENT",
|
341
|
+
"WHILE",
|
309
342
|
"\".\"",
|
310
343
|
"\"!\"",
|
311
344
|
"\"*\"",
|
@@ -340,6 +373,7 @@ Racc_token_to_s_table = [
|
|
340
373
|
"Def",
|
341
374
|
"Class",
|
342
375
|
"If",
|
376
|
+
"While",
|
343
377
|
"Arguments",
|
344
378
|
"ArgList",
|
345
379
|
"Block",
|
@@ -351,42 +385,42 @@ Racc_debug_parser = false
|
|
351
385
|
|
352
386
|
# reduce 0 omitted
|
353
387
|
|
354
|
-
module_eval(<<'.,.,', 'grammar.y',
|
388
|
+
module_eval(<<'.,.,', 'grammar.y', 50)
|
355
389
|
def _reduce_1(val, _values, result)
|
356
390
|
result = Nodes.new([])
|
357
391
|
result
|
358
392
|
end
|
359
393
|
.,.,
|
360
394
|
|
361
|
-
module_eval(<<'.,.,', 'grammar.y',
|
395
|
+
module_eval(<<'.,.,', 'grammar.y', 51)
|
362
396
|
def _reduce_2(val, _values, result)
|
363
397
|
result = val[0]
|
364
398
|
result
|
365
399
|
end
|
366
400
|
.,.,
|
367
401
|
|
368
|
-
module_eval(<<'.,.,', 'grammar.y',
|
402
|
+
module_eval(<<'.,.,', 'grammar.y', 68)
|
369
403
|
def _reduce_3(val, _values, result)
|
370
404
|
result = Nodes.new(val)
|
371
405
|
result
|
372
406
|
end
|
373
407
|
.,.,
|
374
408
|
|
375
|
-
module_eval(<<'.,.,', 'grammar.y',
|
409
|
+
module_eval(<<'.,.,', 'grammar.y', 69)
|
376
410
|
def _reduce_4(val, _values, result)
|
377
411
|
result = val[0] << val[2]
|
378
412
|
result
|
379
413
|
end
|
380
414
|
.,.,
|
381
415
|
|
382
|
-
module_eval(<<'.,.,', 'grammar.y',
|
416
|
+
module_eval(<<'.,.,', 'grammar.y', 70)
|
383
417
|
def _reduce_5(val, _values, result)
|
384
418
|
result = val[0]
|
385
419
|
result
|
386
420
|
end
|
387
421
|
.,.,
|
388
422
|
|
389
|
-
module_eval(<<'.,.,', 'grammar.y',
|
423
|
+
module_eval(<<'.,.,', 'grammar.y', 71)
|
390
424
|
def _reduce_6(val, _values, result)
|
391
425
|
result = Nodes.new([])
|
392
426
|
result
|
@@ -413,269 +447,285 @@ module_eval(<<'.,.,', 'grammar.y', 70)
|
|
413
447
|
|
414
448
|
# reduce 16 omitted
|
415
449
|
|
416
|
-
|
417
|
-
|
450
|
+
# reduce 17 omitted
|
451
|
+
|
452
|
+
module_eval(<<'.,.,', 'grammar.y', 87)
|
453
|
+
def _reduce_18(val, _values, result)
|
418
454
|
result = val[1]
|
419
455
|
result
|
420
456
|
end
|
421
457
|
.,.,
|
422
458
|
|
423
|
-
# reduce 18 omitted
|
424
|
-
|
425
459
|
# reduce 19 omitted
|
426
460
|
|
427
|
-
|
428
|
-
def _reduce_20(val, _values, result)
|
429
|
-
result = NumberNode.new(val[0])
|
430
|
-
result
|
431
|
-
end
|
432
|
-
.,.,
|
461
|
+
# reduce 20 omitted
|
433
462
|
|
434
|
-
module_eval(<<'.,.,', 'grammar.y',
|
463
|
+
module_eval(<<'.,.,', 'grammar.y', 105)
|
435
464
|
def _reduce_21(val, _values, result)
|
436
|
-
result =
|
465
|
+
result = NumberNode.new(val[0])
|
437
466
|
result
|
438
467
|
end
|
439
468
|
.,.,
|
440
469
|
|
441
|
-
module_eval(<<'.,.,', 'grammar.y',
|
470
|
+
module_eval(<<'.,.,', 'grammar.y', 106)
|
442
471
|
def _reduce_22(val, _values, result)
|
443
|
-
result =
|
472
|
+
result = StringNode.new(val[0])
|
444
473
|
result
|
445
474
|
end
|
446
475
|
.,.,
|
447
476
|
|
448
|
-
module_eval(<<'.,.,', 'grammar.y',
|
477
|
+
module_eval(<<'.,.,', 'grammar.y', 107)
|
449
478
|
def _reduce_23(val, _values, result)
|
450
|
-
result =
|
479
|
+
result = TrueNode.new
|
451
480
|
result
|
452
481
|
end
|
453
482
|
.,.,
|
454
483
|
|
455
|
-
module_eval(<<'.,.,', 'grammar.y',
|
484
|
+
module_eval(<<'.,.,', 'grammar.y', 108)
|
456
485
|
def _reduce_24(val, _values, result)
|
457
|
-
result =
|
486
|
+
result = FalseNode.new
|
458
487
|
result
|
459
488
|
end
|
460
489
|
.,.,
|
461
490
|
|
462
|
-
module_eval(<<'.,.,', 'grammar.y',
|
491
|
+
module_eval(<<'.,.,', 'grammar.y', 109)
|
463
492
|
def _reduce_25(val, _values, result)
|
464
|
-
result =
|
493
|
+
result = NilNode.new
|
465
494
|
result
|
466
495
|
end
|
467
496
|
.,.,
|
468
497
|
|
469
498
|
module_eval(<<'.,.,', 'grammar.y', 121)
|
470
499
|
def _reduce_26(val, _values, result)
|
471
|
-
result = CallNode.new(
|
500
|
+
result = CallNode.new(nil, val[0], val[1])
|
472
501
|
result
|
473
502
|
end
|
474
503
|
.,.,
|
475
504
|
|
476
|
-
module_eval(<<'.,.,', 'grammar.y',
|
505
|
+
module_eval(<<'.,.,', 'grammar.y', 123)
|
477
506
|
def _reduce_27(val, _values, result)
|
478
|
-
result = CallNode.new(val[0], val[2], [])
|
507
|
+
result = CallNode.new(val[0], val[2], val[3])
|
479
508
|
result
|
480
509
|
end
|
481
510
|
.,.,
|
482
511
|
|
483
|
-
module_eval(<<'.,.,', 'grammar.y',
|
512
|
+
module_eval(<<'.,.,', 'grammar.y', 124)
|
484
513
|
def _reduce_28(val, _values, result)
|
485
|
-
result = []
|
514
|
+
result = CallNode.new(val[0], val[2], [])
|
486
515
|
result
|
487
516
|
end
|
488
517
|
.,.,
|
489
518
|
|
490
|
-
module_eval(<<'.,.,', 'grammar.y',
|
519
|
+
module_eval(<<'.,.,', 'grammar.y', 128)
|
491
520
|
def _reduce_29(val, _values, result)
|
492
|
-
result =
|
521
|
+
result = []
|
493
522
|
result
|
494
523
|
end
|
495
524
|
.,.,
|
496
525
|
|
497
|
-
module_eval(<<'.,.,', 'grammar.y',
|
526
|
+
module_eval(<<'.,.,', 'grammar.y', 129)
|
498
527
|
def _reduce_30(val, _values, result)
|
499
|
-
result = val
|
528
|
+
result = val[1]
|
500
529
|
result
|
501
530
|
end
|
502
531
|
.,.,
|
503
532
|
|
504
|
-
module_eval(<<'.,.,', 'grammar.y',
|
533
|
+
module_eval(<<'.,.,', 'grammar.y', 133)
|
505
534
|
def _reduce_31(val, _values, result)
|
506
|
-
result = val
|
535
|
+
result = val
|
507
536
|
result
|
508
537
|
end
|
509
538
|
.,.,
|
510
539
|
|
511
|
-
module_eval(<<'.,.,', 'grammar.y',
|
540
|
+
module_eval(<<'.,.,', 'grammar.y', 134)
|
512
541
|
def _reduce_32(val, _values, result)
|
513
|
-
result =
|
542
|
+
result = val[0] << val[2]
|
514
543
|
result
|
515
544
|
end
|
516
545
|
.,.,
|
517
546
|
|
518
|
-
module_eval(<<'.,.,', 'grammar.y',
|
547
|
+
module_eval(<<'.,.,', 'grammar.y', 145)
|
519
548
|
def _reduce_33(val, _values, result)
|
520
549
|
result = CallNode.new(val[0], val[1], [val[2]])
|
521
550
|
result
|
522
551
|
end
|
523
552
|
.,.,
|
524
553
|
|
525
|
-
module_eval(<<'.,.,', 'grammar.y',
|
554
|
+
module_eval(<<'.,.,', 'grammar.y', 146)
|
526
555
|
def _reduce_34(val, _values, result)
|
527
556
|
result = CallNode.new(val[0], val[1], [val[2]])
|
528
557
|
result
|
529
558
|
end
|
530
559
|
.,.,
|
531
560
|
|
532
|
-
module_eval(<<'.,.,', 'grammar.y',
|
561
|
+
module_eval(<<'.,.,', 'grammar.y', 147)
|
533
562
|
def _reduce_35(val, _values, result)
|
534
563
|
result = CallNode.new(val[0], val[1], [val[2]])
|
535
564
|
result
|
536
565
|
end
|
537
566
|
.,.,
|
538
567
|
|
539
|
-
module_eval(<<'.,.,', 'grammar.y',
|
568
|
+
module_eval(<<'.,.,', 'grammar.y', 148)
|
540
569
|
def _reduce_36(val, _values, result)
|
541
570
|
result = CallNode.new(val[0], val[1], [val[2]])
|
542
571
|
result
|
543
572
|
end
|
544
573
|
.,.,
|
545
574
|
|
546
|
-
module_eval(<<'.,.,', 'grammar.y',
|
575
|
+
module_eval(<<'.,.,', 'grammar.y', 149)
|
547
576
|
def _reduce_37(val, _values, result)
|
548
577
|
result = CallNode.new(val[0], val[1], [val[2]])
|
549
578
|
result
|
550
579
|
end
|
551
580
|
.,.,
|
552
581
|
|
553
|
-
module_eval(<<'.,.,', 'grammar.y',
|
582
|
+
module_eval(<<'.,.,', 'grammar.y', 150)
|
554
583
|
def _reduce_38(val, _values, result)
|
555
584
|
result = CallNode.new(val[0], val[1], [val[2]])
|
556
585
|
result
|
557
586
|
end
|
558
587
|
.,.,
|
559
588
|
|
560
|
-
module_eval(<<'.,.,', 'grammar.y',
|
589
|
+
module_eval(<<'.,.,', 'grammar.y', 151)
|
561
590
|
def _reduce_39(val, _values, result)
|
562
591
|
result = CallNode.new(val[0], val[1], [val[2]])
|
563
592
|
result
|
564
593
|
end
|
565
594
|
.,.,
|
566
595
|
|
567
|
-
module_eval(<<'.,.,', 'grammar.y',
|
596
|
+
module_eval(<<'.,.,', 'grammar.y', 152)
|
568
597
|
def _reduce_40(val, _values, result)
|
569
598
|
result = CallNode.new(val[0], val[1], [val[2]])
|
570
599
|
result
|
571
600
|
end
|
572
601
|
.,.,
|
573
602
|
|
574
|
-
module_eval(<<'.,.,', 'grammar.y',
|
603
|
+
module_eval(<<'.,.,', 'grammar.y', 153)
|
575
604
|
def _reduce_41(val, _values, result)
|
576
605
|
result = CallNode.new(val[0], val[1], [val[2]])
|
577
606
|
result
|
578
607
|
end
|
579
608
|
.,.,
|
580
609
|
|
581
|
-
module_eval(<<'.,.,', 'grammar.y',
|
610
|
+
module_eval(<<'.,.,', 'grammar.y', 154)
|
582
611
|
def _reduce_42(val, _values, result)
|
583
612
|
result = CallNode.new(val[0], val[1], [val[2]])
|
584
613
|
result
|
585
614
|
end
|
586
615
|
.,.,
|
587
616
|
|
588
|
-
module_eval(<<'.,.,', 'grammar.y',
|
617
|
+
module_eval(<<'.,.,', 'grammar.y', 155)
|
589
618
|
def _reduce_43(val, _values, result)
|
590
619
|
result = CallNode.new(val[0], val[1], [val[2]])
|
591
620
|
result
|
592
621
|
end
|
593
622
|
.,.,
|
594
623
|
|
595
|
-
module_eval(<<'.,.,', 'grammar.y',
|
624
|
+
module_eval(<<'.,.,', 'grammar.y', 156)
|
596
625
|
def _reduce_44(val, _values, result)
|
597
|
-
result =
|
626
|
+
result = CallNode.new(val[0], val[1], [val[2]])
|
598
627
|
result
|
599
628
|
end
|
600
629
|
.,.,
|
601
630
|
|
602
|
-
module_eval(<<'.,.,', 'grammar.y',
|
631
|
+
module_eval(<<'.,.,', 'grammar.y', 157)
|
603
632
|
def _reduce_45(val, _values, result)
|
604
|
-
result =
|
633
|
+
result = CallNode.new(val[1], val[0], [])
|
605
634
|
result
|
606
635
|
end
|
607
636
|
.,.,
|
608
637
|
|
609
|
-
module_eval(<<'.,.,', 'grammar.y',
|
638
|
+
module_eval(<<'.,.,', 'grammar.y', 162)
|
610
639
|
def _reduce_46(val, _values, result)
|
611
|
-
result =
|
640
|
+
result = GetConstantNode.new(val[0])
|
612
641
|
result
|
613
642
|
end
|
614
643
|
.,.,
|
615
644
|
|
616
|
-
module_eval(<<'.,.,', 'grammar.y',
|
645
|
+
module_eval(<<'.,.,', 'grammar.y', 166)
|
617
646
|
def _reduce_47(val, _values, result)
|
618
|
-
result =
|
647
|
+
result = SetConstantNode.new(val[0], val[2])
|
619
648
|
result
|
620
649
|
end
|
621
650
|
.,.,
|
622
651
|
|
623
|
-
module_eval(<<'.,.,', 'grammar.y',
|
652
|
+
module_eval(<<'.,.,', 'grammar.y', 170)
|
624
653
|
def _reduce_48(val, _values, result)
|
625
|
-
result = val[
|
654
|
+
result = GetLocalNode.new(val[0])
|
626
655
|
result
|
627
656
|
end
|
628
657
|
.,.,
|
629
658
|
|
630
|
-
module_eval(<<'.,.,', 'grammar.y',
|
659
|
+
module_eval(<<'.,.,', 'grammar.y', 174)
|
631
660
|
def _reduce_49(val, _values, result)
|
632
|
-
result =
|
661
|
+
result = SetLocalNode.new(val[0], val[2])
|
633
662
|
result
|
634
663
|
end
|
635
664
|
.,.,
|
636
665
|
|
637
|
-
module_eval(<<'.,.,', 'grammar.y',
|
666
|
+
module_eval(<<'.,.,', 'grammar.y', 186)
|
638
667
|
def _reduce_50(val, _values, result)
|
639
|
-
result =
|
668
|
+
result = val[1]
|
640
669
|
result
|
641
670
|
end
|
642
671
|
.,.,
|
643
672
|
|
644
|
-
module_eval(<<'.,.,', 'grammar.y',
|
673
|
+
module_eval(<<'.,.,', 'grammar.y', 192)
|
645
674
|
def _reduce_51(val, _values, result)
|
646
|
-
result = []
|
675
|
+
result = DefNode.new(val[1], [], val[2])
|
647
676
|
result
|
648
677
|
end
|
649
678
|
.,.,
|
650
679
|
|
651
|
-
module_eval(<<'.,.,', 'grammar.y',
|
680
|
+
module_eval(<<'.,.,', 'grammar.y', 194)
|
652
681
|
def _reduce_52(val, _values, result)
|
653
|
-
result = val
|
682
|
+
result = DefNode.new(val[1], val[3], val[5])
|
654
683
|
result
|
655
684
|
end
|
656
685
|
.,.,
|
657
686
|
|
658
|
-
module_eval(<<'.,.,', 'grammar.y',
|
687
|
+
module_eval(<<'.,.,', 'grammar.y', 198)
|
659
688
|
def _reduce_53(val, _values, result)
|
660
|
-
result =
|
689
|
+
result = []
|
661
690
|
result
|
662
691
|
end
|
663
692
|
.,.,
|
664
693
|
|
665
|
-
module_eval(<<'.,.,', 'grammar.y',
|
694
|
+
module_eval(<<'.,.,', 'grammar.y', 199)
|
666
695
|
def _reduce_54(val, _values, result)
|
667
|
-
result =
|
696
|
+
result = val
|
668
697
|
result
|
669
698
|
end
|
670
699
|
.,.,
|
671
700
|
|
672
|
-
module_eval(<<'.,.,', 'grammar.y',
|
701
|
+
module_eval(<<'.,.,', 'grammar.y', 200)
|
673
702
|
def _reduce_55(val, _values, result)
|
703
|
+
result = val[0] << val[2]
|
704
|
+
result
|
705
|
+
end
|
706
|
+
.,.,
|
707
|
+
|
708
|
+
module_eval(<<'.,.,', 'grammar.y', 206)
|
709
|
+
def _reduce_56(val, _values, result)
|
710
|
+
result = ClassNode.new(val[1], val[2])
|
711
|
+
result
|
712
|
+
end
|
713
|
+
.,.,
|
714
|
+
|
715
|
+
module_eval(<<'.,.,', 'grammar.y', 211)
|
716
|
+
def _reduce_57(val, _values, result)
|
674
717
|
result = IfNode.new(val[1], val[2])
|
675
718
|
result
|
676
719
|
end
|
677
720
|
.,.,
|
678
721
|
|
722
|
+
module_eval(<<'.,.,', 'grammar.y', 215)
|
723
|
+
def _reduce_58(val, _values, result)
|
724
|
+
result = WhileNode.new(val[1], val[2])
|
725
|
+
result
|
726
|
+
end
|
727
|
+
.,.,
|
728
|
+
|
679
729
|
def _reduce_none(val, _values, result)
|
680
730
|
val[0]
|
681
731
|
end
|
@@ -47,3 +47,41 @@ Constants["Number"].def :/ do |receiver,arguments|
|
|
47
47
|
result = receiver.ruby_value / arguments.first.ruby_value
|
48
48
|
Constants["Number"].new_with_value(result)
|
49
49
|
end
|
50
|
+
|
51
|
+
Constants["Number"].def :== do |receiver,arguments|
|
52
|
+
result = receiver.ruby_value == arguments.first.ruby_value
|
53
|
+
Constants["Number"].new_with_value(result)
|
54
|
+
end
|
55
|
+
|
56
|
+
Constants["Number"].def :!= do |receiver,arguments|
|
57
|
+
result = receiver.ruby_value != arguments.first.ruby_value
|
58
|
+
Constants["Number"].new_with_value(result)
|
59
|
+
end
|
60
|
+
|
61
|
+
Constants["Number"].def :>= do |receiver,arguments|
|
62
|
+
result = receiver.ruby_value >= arguments.first.ruby_value
|
63
|
+
Constants["Number"].new_with_value(result)
|
64
|
+
end
|
65
|
+
|
66
|
+
Constants["Number"].def :<= do |receiver,arguments|
|
67
|
+
result = receiver.ruby_value <= arguments.first.ruby_value
|
68
|
+
Constants["Number"].new_with_value(result)
|
69
|
+
end
|
70
|
+
|
71
|
+
Constants["Number"].def :> do |receiver,arguments|
|
72
|
+
result = receiver.ruby_value > arguments.first.ruby_value
|
73
|
+
Constants["Number"].new_with_value(result)
|
74
|
+
end
|
75
|
+
|
76
|
+
Constants["Number"].def :< do |receiver,arguments|
|
77
|
+
result = receiver.ruby_value < arguments.first.ruby_value
|
78
|
+
Constants["Number"].new_with_value(result)
|
79
|
+
end
|
80
|
+
|
81
|
+
Constants["TrueClass"].def :! do |receiver,arguments|
|
82
|
+
Constants["false"]
|
83
|
+
end
|
84
|
+
|
85
|
+
Constants["FalseClass"].def :! do |receiver,arguments|
|
86
|
+
Constants["true"]
|
87
|
+
end
|
data/lib/turmali/version.rb
CHANGED