brotorift 0.4.3 → 0.4.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/compiler.rb +3 -9
- data/lib/runtime.rb +0 -21
- metadata +15 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b35c5012c15f8bb488f1544b7ff131d8d3464fe2b5ce0c859139ffd3065bc92e
|
4
|
+
data.tar.gz: 9f645f7f92fba074526292136e4bc72fb4b6f66376e5f026201d9411c7a5d8cc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 53aa0520a38cde0a6a62367eccf92cf956c1ed0bc20a94a5a3e152be2fdacbf00fa5b112aa4efa7471f25d1ad9a90373051b6b77b2d6c4551bbf8ada7d2ef3d9
|
7
|
+
data.tar.gz: f7c8fd3dbd53e738389730af88e6f5e0af45d1761e3e903be34d6720c75c08052ae3bbe64d855e83feed8348c5222ea2ae26851638dc2ede078e39fcdd8dbae3
|
data/lib/compiler.rb
CHANGED
@@ -24,10 +24,6 @@ class Compiler
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def compile filename
|
27
|
-
@runtime = self.compile_file filename
|
28
|
-
end
|
29
|
-
|
30
|
-
def compile_file filename
|
31
27
|
content = File.read filename, encoding: 'utf-8'
|
32
28
|
tokens = Lexer::lex content, filename
|
33
29
|
begin
|
@@ -36,9 +32,8 @@ class Compiler
|
|
36
32
|
add_error UnexpectedTokenError.new e.current
|
37
33
|
return
|
38
34
|
end
|
39
|
-
runtime = Runtime.new filename
|
40
|
-
self.compile_ast runtime, ast
|
41
|
-
runtime
|
35
|
+
@runtime = Runtime.new filename if @runtime == nil
|
36
|
+
self.compile_ast @runtime, ast
|
42
37
|
end
|
43
38
|
|
44
39
|
def compile_ast runtime, ast
|
@@ -71,8 +66,7 @@ class Compiler
|
|
71
66
|
add_error IncludeFileNotFoundError.new filename, include_ast.position
|
72
67
|
return
|
73
68
|
end
|
74
|
-
|
75
|
-
@runtime.add_include include_runtime
|
69
|
+
self.compile filename
|
76
70
|
end
|
77
71
|
|
78
72
|
def compile_enum enum_ast
|
data/lib/runtime.rb
CHANGED
@@ -193,7 +193,6 @@ class Runtime
|
|
193
193
|
attr_reader :structs
|
194
194
|
attr_reader :directions
|
195
195
|
attr_reader :sequences
|
196
|
-
attr_reader :includes
|
197
196
|
|
198
197
|
def initialize filename
|
199
198
|
@filename = filename
|
@@ -203,7 +202,6 @@ class Runtime
|
|
203
202
|
@structs = {}
|
204
203
|
@directions = []
|
205
204
|
@sequences = {}
|
206
|
-
@includes = []
|
207
205
|
|
208
206
|
self.init_builtins
|
209
207
|
end
|
@@ -256,11 +254,6 @@ class Runtime
|
|
256
254
|
type_def = @structs[name]
|
257
255
|
return type_def, self if type_def != nil
|
258
256
|
|
259
|
-
@includes.each do |i|
|
260
|
-
type_def = i.get_type name
|
261
|
-
return type_def, i if type_def != nil
|
262
|
-
end
|
263
|
-
|
264
257
|
return nil, self
|
265
258
|
end
|
266
259
|
|
@@ -272,11 +265,6 @@ class Runtime
|
|
272
265
|
dir = @directions.find { |d| d.client == client and d.server == server and d.direction == direction }
|
273
266
|
return dir if dir != nil
|
274
267
|
|
275
|
-
@includes.each do |i|
|
276
|
-
dir = i.get_direction client, direction, server
|
277
|
-
return dir if dir != nil
|
278
|
-
end
|
279
|
-
|
280
268
|
return nil
|
281
269
|
end
|
282
270
|
|
@@ -288,18 +276,9 @@ class Runtime
|
|
288
276
|
sequence = @sequences[name]
|
289
277
|
return sequence if sequence != nil
|
290
278
|
|
291
|
-
@includes.each do |i|
|
292
|
-
sequence = i.get_sequence name
|
293
|
-
return sequence if sequence != nil
|
294
|
-
end
|
295
|
-
|
296
279
|
return nil
|
297
280
|
end
|
298
281
|
|
299
|
-
def add_include runtime
|
300
|
-
@includes.push runtime
|
301
|
-
end
|
302
|
-
|
303
282
|
def get_node_directions node, side
|
304
283
|
node_directions = {}
|
305
284
|
@directions.each do |direction|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: brotorift
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Ren
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '3.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: filigree
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - '='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 0.2.0
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 0.2.0
|
41
55
|
description: Brotorift generator
|
42
56
|
email: lcdcdr2004@gmail.com
|
43
57
|
executables:
|