brotorift 0.4.4 → 0.4.5
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 +8 -5
- data/lib/generators/elixir_server_generator.rb +4 -1
- data/lib/generators/unity_client_generator.rb +4 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 56fe846d536851843daf4ea29ae6008d7a7ec4c56cf5042ae8a490d43b1f3090
|
4
|
+
data.tar.gz: fa127162d9209be518ad43fbad966196e9a2b960ccbe0f6c607743d738766291
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2494c9384ced85c380a65235fe753b820c54158a024795b5f0d4604448ffdeea1a30e02ba7e736408e9580c12595003fe390151da4b6ae932b6e6ac8cf78a506
|
7
|
+
data.tar.gz: 7dfec5bc7385195c1809785cd43585a788d6eb1a93767274e4760a98bdce1b06244348369b1216627585f1e585bd1f3c24233537248cf7aeea4f428d53fde78c
|
data/lib/compiler.rb
CHANGED
@@ -61,12 +61,14 @@ class Compiler
|
|
61
61
|
end
|
62
62
|
|
63
63
|
def compile_include include_ast
|
64
|
+
dir = File.dirname @runtime.filename
|
64
65
|
filename = include_ast.filename + '.brotorift'
|
65
|
-
|
66
|
+
full_path = File.join dir, filename
|
67
|
+
if not File.exists? full_path
|
66
68
|
add_error IncludeFileNotFoundError.new filename, include_ast.position
|
67
69
|
return
|
68
70
|
end
|
69
|
-
self.compile
|
71
|
+
self.compile full_path
|
70
72
|
end
|
71
73
|
|
72
74
|
def compile_enum enum_ast
|
@@ -126,10 +128,11 @@ class Compiler
|
|
126
128
|
@message_base_id += 1000
|
127
129
|
@message_id = 0
|
128
130
|
|
129
|
-
|
130
|
-
|
131
|
+
direction_def = @runtime.get_direction client, direction_ast.direction, server
|
132
|
+
if direction_def == nil
|
133
|
+
direction_def = DirectionDef.new direction_ast, client, server
|
134
|
+
end
|
131
135
|
|
132
|
-
direction_def = DirectionDef.new direction_ast, client, server
|
133
136
|
direction_ast.messages.each do |message_ast|
|
134
137
|
self.check_case 'message', :upper, message_ast
|
135
138
|
self.check_unique 'message', direction_def.messages[message_ast.name], message_ast
|
@@ -427,7 +427,10 @@ class ElixirServerGenerator < Generator
|
|
427
427
|
template = File.read erb_file
|
428
428
|
erb = ERB.new template
|
429
429
|
content = erb.result binding
|
430
|
-
|
430
|
+
|
431
|
+
output_dir = File.dirname runtime.filename
|
432
|
+
output_path = File.join output_dir, "#{node.elixir_name}.ex"
|
433
|
+
File.write output_path, content
|
431
434
|
end
|
432
435
|
end
|
433
436
|
|
@@ -184,7 +184,10 @@ class UnityClientGenerator < Generator
|
|
184
184
|
template = File.read erb_file
|
185
185
|
erb = ERB.new template
|
186
186
|
content = erb.result binding
|
187
|
-
|
187
|
+
|
188
|
+
output_dir = File.dirname runtime.filename
|
189
|
+
output_path = File.join output_dir, "#{node.name}.cs"
|
190
|
+
File.write output_path, content
|
188
191
|
end
|
189
192
|
end
|
190
193
|
|