brotorift 0.5.1 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/brotorift.rb +1 -1
- data/lib/compiler.rb +5 -5
- 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: 5181a74967a5d95af2c2829807fe6fcf5447586425fa9ae1226d6191e1e7400e
|
4
|
+
data.tar.gz: c9cb0b6e4a56c22f2b6b4e2778503cb76beefb710959e15010318adf2ee016ff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3d49fe52524468be8046c0c9c899403845b2c93ae66ade0eb53eaee4213cb76a3fca0ad346f0d39a80bbc5e4886cc008db93367c62a633dfad1812ba18dcb317
|
7
|
+
data.tar.gz: ba1a6bc55a6dd65601b759e3587a25e4d49d1db8f6c5a0fd00a76e531a2633898b9e94d6279888f7956877addec892f5b8d666bf0ad8877845417c749acde7b5
|
data/lib/brotorift.rb
CHANGED
data/lib/compiler.rb
CHANGED
@@ -23,7 +23,7 @@ class Compiler
|
|
23
23
|
@message_id = 0
|
24
24
|
end
|
25
25
|
|
26
|
-
def compile filename
|
26
|
+
def compile filename, read_version
|
27
27
|
content = File.read filename, encoding: 'utf-8'
|
28
28
|
tokens = Lexer::lex content, filename
|
29
29
|
begin
|
@@ -33,12 +33,12 @@ class Compiler
|
|
33
33
|
return
|
34
34
|
end
|
35
35
|
@runtime = Runtime.new filename if @runtime == nil
|
36
|
-
self.compile_ast @runtime, ast
|
36
|
+
self.compile_ast @runtime, ast, read_version
|
37
37
|
end
|
38
38
|
|
39
|
-
def compile_ast runtime, ast
|
39
|
+
def compile_ast runtime, ast, read_version
|
40
40
|
@runtime = runtime
|
41
|
-
@runtime.version = ast.version
|
41
|
+
@runtime.version = ast.version if read_version
|
42
42
|
ast.decls.each do |decl|
|
43
43
|
begin
|
44
44
|
case decl
|
@@ -69,7 +69,7 @@ class Compiler
|
|
69
69
|
add_error IncludeFileNotFoundError.new filename, include_ast.position
|
70
70
|
return
|
71
71
|
end
|
72
|
-
self.compile full_path
|
72
|
+
self.compile full_path, false
|
73
73
|
end
|
74
74
|
|
75
75
|
def compile_enum enum_ast
|