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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/brotorift.rb +1 -1
  3. data/lib/compiler.rb +5 -5
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f8dd2908d1aaf2325114a587b14657d7199a7ba5db291c58bd3d935d9671eec5
4
- data.tar.gz: f9c6d28421e7b7fb49721df7947a2e300b81fb3446ba7e96ddfda3731434887a
3
+ metadata.gz: 5181a74967a5d95af2c2829807fe6fcf5447586425fa9ae1226d6191e1e7400e
4
+ data.tar.gz: c9cb0b6e4a56c22f2b6b4e2778503cb76beefb710959e15010318adf2ee016ff
5
5
  SHA512:
6
- metadata.gz: 4cee1927befbfcdfa63c01709926be18794293a4dc602bf7b6cb97899cdfae261135eaa6d59ec3a4c3959104d5969f90cbd73850c7c89cf694b1ac45ffe05b2d
7
- data.tar.gz: 436bad9efd9fd12c515f4148810eed58c9a7d81cc13a6d6f57b9cd400886fc798684701f8ecefcfeb8d06b2d751c71b45174adfdeefe6b695d194116d3fedccc
6
+ metadata.gz: 3d49fe52524468be8046c0c9c899403845b2c93ae66ade0eb53eaee4213cb76a3fca0ad346f0d39a80bbc5e4886cc008db93367c62a633dfad1812ba18dcb317
7
+ data.tar.gz: ba1a6bc55a6dd65601b759e3587a25e4d49d1db8f6c5a0fd00a76e531a2633898b9e94d6279888f7956877addec892f5b8d666bf0ad8877845417c749acde7b5
data/lib/brotorift.rb CHANGED
@@ -91,7 +91,7 @@ class Brotorift
91
91
  def run file_name
92
92
  load_generators
93
93
  compiler = Compiler.new
94
- compiler.compile file_name
94
+ compiler.compile file_name, true
95
95
  if compiler.errors.length > 0
96
96
  print_compile_errors compiler.errors
97
97
  exit 1
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
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.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Ren