expressir 1.2.3-x86_64-darwin → 1.2.4-x86_64-darwin

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 43113ee60a488f3ecfa0e90d2c1af561f4076bd1eaee4ba000808e1c65727d76
4
- data.tar.gz: 967f31105a4e539cb21fc65c3d73072e8464a26eaf176ca5e893b46f8cb5fe2a
3
+ metadata.gz: 596253e028087e7bd843297fd101f9a8787688753d8b4c8482e00e64c823e4c8
4
+ data.tar.gz: 0e752d5ab11ba75e8286511346d4c40649e6fff4f4b1aa0b7ed8cfc95502873e
5
5
  SHA512:
6
- metadata.gz: e37b20cd650e686069d4866693714cac5bcf83fdd973b48df3fa5d58e710852ecb63af2339f60889f979f7b97e56d2bdd9ddabd5186f04ea3225d4d589b327b1
7
- data.tar.gz: 7e579d15c7fbdf64e0ae0d8ee6f0b3e3865a96661825084fe3ea1f7fa5932862c41052a3dfaeb1365d1b2a15b66705653f73427507da9364b275e6c037148c63
6
+ metadata.gz: 81c916894ca43b0445bd17e6ad9ba3a73aa68b16c3d0875f3fd193eb7e1eca3e49388f3743d0ed57672d0d67b5cf8b5f87c9a5c9c1ace54f52a46f2136e22b3c
7
+ data.tar.gz: 542550cac5af1a44c39c4a638888559e55a194832e025a22e6b6614584eb349950172d2ebef80be4b460dcdcf4024f77fcbb226de65614706c9d0b933e60d4d2
@@ -8,7 +8,7 @@ on:
8
8
  jobs:
9
9
  rake:
10
10
  name: test on ruby-${{ matrix.ruby }} ${{ matrix.os }}
11
- runs-on: ${{ matrix.os }}
11
+ runs-on: ${{ matrix.os }}
12
12
  continue-on-error: ${{ matrix.experimental }}
13
13
  strategy:
14
14
  fail-fast: false
@@ -28,52 +28,64 @@ jobs:
28
28
  experimental: true
29
29
 
30
30
  steps:
31
- - uses: actions/checkout@v2
31
+ - name: Checkout
32
+ uses: actions/checkout@v2
32
33
  with:
33
34
  submodules: recursive
34
35
 
35
- - if: matrix.os == 'macos-latest'
36
+ - name: Setup packages
37
+ if: startsWith(matrix.os, 'macos')
36
38
  run: brew install autoconf automake libtool
37
39
 
38
- - uses: ruby/setup-ruby@v1
40
+ - name: Install Ruby
41
+ uses: ruby/setup-ruby@v1
39
42
  with:
40
43
  ruby-version: ${{ matrix.ruby }}
41
44
  bundler-cache: true
42
45
 
43
- - uses: actions/cache@v2
46
+ - name: Process cache
47
+ uses: actions/cache@v2
48
+ id: cache
44
49
  with:
45
50
  path: lib/expressir/express/express_parser.*
46
51
  key: v4-${{ runner.os }}-${{ matrix.ruby }}-${{ hashFiles('ext/express-parser/extconf.rb', 'ext/express-parser/antlrgen/**', 'ext/express-parser/express_parser.cpp', '.git/modules/ext/express-parser/antlr4-upstream/HEAD') }}
47
52
 
48
- - if: hashFiles('lib/expressir/express/express_parser.*') == ''
53
+ - name: Build native extension
54
+ if: steps.cache.outputs.cache-hit != 'true'
49
55
  run: bundle exec rake compile
50
56
 
51
- - run: bundle exec rake
57
+ - name: Run tests
58
+ run: bundle exec rake
52
59
 
53
60
  # test release workflow
54
61
  pack:
55
- runs-on: ubuntu-18.04
62
+ runs-on: ubuntu-latest
56
63
  strategy:
57
64
  fail-fast: false
58
65
  matrix:
59
66
  host: [ linux, windows, darwin ]
60
67
  steps:
61
- - uses: actions/checkout@v2
68
+ - name: Checkout
69
+ uses: actions/checkout@v2
62
70
  with:
63
71
  submodules: recursive
64
72
 
65
- - uses: ruby/setup-ruby@v1
73
+ - name: Setup Ruby
74
+ uses: ruby/setup-ruby@v1
66
75
  with:
67
76
  ruby-version: '3.0'
68
77
  # bundler-cache: true important to not use cache because it leads to "cannot find -lrice"
69
78
  # more info https://github.com/lutaml/expressir/runs/2097658383?check_suite_focus=true#step:7:2126
70
79
 
71
- - run: bundle install --jobs 4 --retry 3
80
+ - name: Bundle
81
+ run: bundle install --jobs 4 --retry 3
72
82
 
73
- # build gem WITHOUT pre-built native extension
74
- - run: gem build expressir.gemspec
83
+ - name: Build gem without native extension
84
+ if: matrix.host == 'linux'
85
+ run: gem build expressir.gemspec
75
86
 
76
- - if: matrix.host == 'linux'
87
+ - name: Package gem without native extension
88
+ if: matrix.host == 'linux'
77
89
  uses: actions/upload-artifact@v2
78
90
  with:
79
91
  name: pkg-ruby
@@ -87,10 +99,11 @@ jobs:
87
99
  sudo swapon /compile.swap
88
100
  sudo swapon --all --verbose
89
101
 
90
- # build gem WITH pre-built native extension
91
- - run: bundle exec rake gem:${{ matrix.host }}
102
+ - name: Build gem with native extension
103
+ run: bundle exec rake gem:${{ matrix.host }}
92
104
 
93
- - uses: actions/upload-artifact@v2
105
+ - name: Package gem with native extension
106
+ uses: actions/upload-artifact@v2
94
107
  with:
95
108
  name: pkg-${{ matrix.host }}
96
109
  path: pkg/*.gem
data/.gitignore CHANGED
@@ -15,3 +15,4 @@
15
15
  .rspec_status
16
16
 
17
17
  /ext/express-parser/rice-embed
18
+ /lib/expressir/express/express_parser.so
@@ -33,23 +33,26 @@ module Expressir
33
33
  def self.from_file(file, skip_references: nil, include_source: nil)
34
34
  input = File.read(file)
35
35
 
36
- parser = ::ExpressParser::Parser.parse(input)
36
+ # An important note re memory management
37
+ # parse, syntax, visitor methods return complex tree structures created in netive (C++) extension
38
+ # visit method references nodes and leaves of this structures but it is totally untransparent for Ruby GarbageCllector
39
+ # so in this class we keep those C++ structure marked for GC so theu are not freed
40
+ @parser = ::ExpressParser::Parser.parse(input)
41
+ @parse_tree = @parser.syntax()
37
42
 
38
- parse_tree = parser.syntax()
43
+ @visitor = Visitor.new(@parser.tokens, include_source: include_source)
44
+ @repository = @visitor.visit(@parse_tree)
39
45
 
40
- visitor = Visitor.new(parser.tokens, include_source: include_source)
41
- repository = visitor.visit(parse_tree)
42
-
43
- repository.schemas.each do |schema|
46
+ @repository.schemas.each do |schema|
44
47
  schema.file = file.to_s
45
48
  end
46
49
 
47
50
  unless skip_references
48
- resolve_references_model_visitor = ResolveReferencesModelVisitor.new
49
- resolve_references_model_visitor.visit(repository)
51
+ @resolve_references_model_visitor = ResolveReferencesModelVisitor.new
52
+ @resolve_references_model_visitor.visit(@repository)
50
53
  end
51
54
 
52
- repository
55
+ @repository
53
56
  end
54
57
 
55
58
  # Parses Express files into an Express model
@@ -65,16 +68,16 @@ module Expressir
65
68
  repository.schemas
66
69
  end.flatten
67
70
 
68
- repository = Model::Repository.new(
71
+ @repository = Model::Repository.new(
69
72
  schemas: schemas
70
73
  )
71
74
 
72
- unless skip_references
73
- resolve_references_model_visitor = ResolveReferencesModelVisitor.new
74
- resolve_references_model_visitor.visit(repository)
75
+ unless @skip_references
76
+ @resolve_references_model_visitor = ResolveReferencesModelVisitor.new
77
+ @resolve_references_model_visitor.visit(@repository)
75
78
  end
76
79
 
77
- repository
80
+ @repository
78
81
  end
79
82
  end
80
83
  end
@@ -138,7 +138,9 @@ module Expressir
138
138
  end
139
139
 
140
140
  def attach_remarks(ctx, node)
141
- remark_tokens = get_tokens(ctx).select{|x| x.channel == REMARK_CHANNEL}
141
+ remark_tokens = get_tokens(ctx)
142
+ remark_tokens = remark_tokens.select{ |x| x.channel == REMARK_CHANNEL
143
+ }
142
144
 
143
145
  # skip already attached remarks
144
146
  remark_tokens = remark_tokens.select{|x| !@attached_remark_tokens.include?(x)}
@@ -1,3 +1,3 @@
1
1
  module Expressir
2
- VERSION = "1.2.3".freeze
2
+ VERSION = "1.2.4".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: expressir
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.3
4
+ version: 1.2.4
5
5
  platform: x86_64-darwin
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-04-18 00:00:00.000000000 Z
11
+ date: 2022-05-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor