antlr4-native 2.2.1 → 2.3.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 417a38bde6ca6dfdeca982ed80f0258c00c18feeda5cfecbaab7a5784e941501
4
- data.tar.gz: 99531b3de905a08734dc2f421dc8b4e488850ab0021a6619c0581c6a810590d7
3
+ metadata.gz: e0ba82bae327f0b02ac099beab9b01d8efef600b21dd1f0bac9438303af8d9fc
4
+ data.tar.gz: f840a00ac13adf1282c77fc2b2376da1b9c986cc32d9affa2232ab0d01c6ae57
5
5
  SHA512:
6
- metadata.gz: bad5784b07eb34c221c4a1a7a8311dd9c6998a837c5b5f13605564367aa15269055c3046e4894d531b4e9512467200896f0eb0495f08f46972593367d1143012
7
- data.tar.gz: a0f02bfbbbff0fb8d06849623f8ced4046ebb2feb28a1f21d48bd03f2d017887c41a289777f30f4016205d01a49e3c77d8df9a83352a9da6b05ba43dc81148b3
6
+ metadata.gz: a9aec0e46b565763c2e77c6e7af5108e24b7c348afda4d0073a5f99a52813feeb8204b8a554ed3dc500898aa4bb6a023c5646d5f0965c7d0bb25f2acb831889a
7
+ data.tar.gz: 508ed703bf98e7584c998cbed39b73f788a99cf5b65469b9c82d0adba5467c6bc1bed458ad26bde81dc5d32a73ef755a89a9516c9aa36ee5a550a3516dd30a7f
@@ -15,5 +15,5 @@ Gem::Specification.new do |s|
15
15
  s.require_path = 'lib'
16
16
  s.files = Dir['{lib,spec,vendor}/**/*', 'Gemfile', 'README.md', 'Rakefile', 'antlr4-native.gemspec']
17
17
 
18
- s.add_runtime_dependency "rice", "~> 4.0"
18
+ s.add_runtime_dependency "rice", "~> 4.11"
19
19
  end
@@ -56,7 +56,7 @@ module Antlr4Native
56
56
  class To_Ruby<#{parser_ns}::#{name}*> {
57
57
  public:
58
58
  VALUE convert(#{parser_ns}::#{name}* const &x) {
59
- if (!x) return Nil;
59
+ if (!x) return Qnil;
60
60
  return Data_Object<#{parser_ns}::#{name}>(x, false, #{proxy_class_variable});
61
61
  }
62
62
  };
@@ -65,7 +65,7 @@ module Antlr4Native
65
65
  class To_Ruby<#{name}Proxy*> {
66
66
  public:
67
67
  VALUE convert(#{name}Proxy* const &x) {
68
- if (!x) return Nil;
68
+ if (!x) return Qnil;
69
69
  return Data_Object<#{name}Proxy>(x, false, #{proxy_class_variable});
70
70
  }
71
71
  };
@@ -114,11 +114,11 @@ module Antlr4Native
114
114
 
115
115
  for (auto child : getChildren()) {
116
116
  if (ctx == detail::From_Ruby<ContextProxy>().convert(child.value()).getOriginal()) {
117
- return child;
117
+ return Rice::Object(child);
118
118
  }
119
119
  }
120
120
 
121
- return Nil;
121
+ return Qnil;
122
122
  }
123
123
  END
124
124
  end
@@ -97,7 +97,7 @@ module Antlr4Native
97
97
  class To_Ruby<Token*> {
98
98
  public:
99
99
  VALUE convert(Token* const &x) {
100
- if (!x) return Nil;
100
+ if (!x) return Qnil;
101
101
  return Data_Object<Token>(x, false, rb_cToken);
102
102
  }
103
103
  };
@@ -106,7 +106,7 @@ module Antlr4Native
106
106
  class To_Ruby<tree::ParseTree*> {
107
107
  public:
108
108
  VALUE convert(tree::ParseTree* const &x) {
109
- if (!x) return Nil;
109
+ if (!x) return Qnil;
110
110
  return Data_Object<tree::ParseTree>(x, false, rb_cParseTree);
111
111
  }
112
112
  };
@@ -115,7 +115,7 @@ module Antlr4Native
115
115
  class To_Ruby<tree::TerminalNode*> {
116
116
  public:
117
117
  VALUE convert(tree::TerminalNode* const &x) {
118
- if (!x) return Nil;
118
+ if (!x) return Qnil;
119
119
  return Data_Object<tree::TerminalNode>(x, false, rb_cTerminalNode);
120
120
  }
121
121
  };
@@ -153,7 +153,7 @@ module Antlr4Native
153
153
  for (auto it = orig -> children.begin(); it != orig -> children.end(); it ++) {
154
154
  Object parseTree = ContextProxy::wrapParseTree(*it);
155
155
 
156
- if (parseTree != Nil) {
156
+ if (!parseTree.is_nil()) {
157
157
  children.push(parseTree);
158
158
  }
159
159
  }
@@ -162,7 +162,7 @@ module Antlr4Native
162
162
  }
163
163
 
164
164
  Object getParent() {
165
- return orig == nullptr ? Nil : ContextProxy::wrapParseTree(orig -> parent);
165
+ return orig == nullptr ? Rice::Object(Qnil) : ContextProxy::wrapParseTree(orig -> parent);
166
166
  }
167
167
 
168
168
  size_t childCount() {
@@ -300,13 +300,26 @@ module Antlr4Native
300
300
  };
301
301
 
302
302
  namespace Rice::detail {
303
+ template <>
304
+ struct Type<ParserProxy*> {
305
+ static bool verify() {
306
+ return true;
307
+ }
308
+ };
309
+
303
310
  template <>
304
311
  class To_Ruby<ParserProxy*> {
305
312
  public:
313
+ To_Ruby() = default;
314
+
315
+ explicit To_Ruby(Arg* arg) : arg_(arg) {}
316
+
306
317
  VALUE convert(ParserProxy* const &x) {
307
- if (!x) return Nil;
318
+ if (!x) return Qnil;
308
319
  return Data_Object<ParserProxy>(x, false, rb_cParser);
309
320
  }
321
+ private:
322
+ Arg* arg_ = nullptr;
310
323
  };
311
324
  }
312
325
  END
@@ -372,7 +385,7 @@ module Antlr4Native
372
385
  TerminalNodeProxy proxy(node);
373
386
  return detail::To_Ruby<TerminalNodeProxy>().convert(proxy);
374
387
  } else {
375
- return Nil;
388
+ return Qnil;
376
389
  }
377
390
  }
378
391
  END
@@ -1,3 +1,3 @@
1
1
  module Antlr4Native
2
- VERSION = '2.2.1'
2
+ VERSION = '2.3.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: antlr4-native
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.1
4
+ version: 2.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cameron Dutro
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2023-10-13 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: rice
@@ -16,14 +15,14 @@ dependencies:
16
15
  requirements:
17
16
  - - "~>"
18
17
  - !ruby/object:Gem::Version
19
- version: '4.0'
18
+ version: '4.11'
20
19
  type: :runtime
21
20
  prerelease: false
22
21
  version_requirements: !ruby/object:Gem::Requirement
23
22
  requirements:
24
23
  - - "~>"
25
24
  - !ruby/object:Gem::Version
26
- version: '4.0'
25
+ version: '4.11'
27
26
  description: Create a Ruby native extension from any ANTLR4 grammar.
28
27
  email:
29
28
  - camertron@gmail.com
@@ -56,7 +55,6 @@ files:
56
55
  homepage: http://github.com/camertron/antlr4-native-rb
57
56
  licenses: []
58
57
  metadata: {}
59
- post_install_message:
60
58
  rdoc_options: []
61
59
  require_paths:
62
60
  - lib
@@ -71,8 +69,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
71
69
  - !ruby/object:Gem::Version
72
70
  version: '0'
73
71
  requirements: []
74
- rubygems_version: 3.4.5
75
- signing_key:
72
+ rubygems_version: 3.6.7
76
73
  specification_version: 4
77
74
  summary: Create a Ruby native extension from any ANTLR4 grammar.
78
75
  test_files: []