asn_parser 1.0.6 → 1.0.8

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: b7a82bf179aece367294da268bfdbab781b09009aeaabf98c7acfa81ebeac76e
4
- data.tar.gz: 02eb25c3fc4f9e0a3b63ab0b123270e65769667cfab28d94b1cb7e7aa5c0d31a
3
+ metadata.gz: f30537597a4204a0d784c132cbde4e720e57db8f3da6c372c27e948a1fc633eb
4
+ data.tar.gz: 1ee70a8dd02b2d95f403275c8f96218941c5ac08760604911b15afe2419a4367
5
5
  SHA512:
6
- metadata.gz: dedeae37baec5a7215a8824535efaf29f415666ad74ed13cae5bea38eea534afebb0420c53d647863aecbd82956f7c2941478be319dded16a99ead400abc2d04
7
- data.tar.gz: 5190d869ad803d253c6d2b31075faa31154fb822c3e73be6e28b78dc133b1cff8ab96f69a38959ea402cbf6653120a5e7e7b54a8f269465f406d0467cf25b122
6
+ metadata.gz: 9ca1523a122b6cc609b0999cc07f7a9e48b96e666b3fb3225d2a2188e1b3e70d90fc7bc5c193495de607f22cc66d33edcaaffabe02d5acd513e77bee59c21ea4
7
+ data.tar.gz: af69a7afbeb932f244b89b686304e502acadb0be845c67d96e340be027e7c4958142e238970795ac72bac18b3bd98edf2bad9466b09827607552e99271ab1dfe
@@ -938,6 +938,7 @@ antlr4::atn::SerializedATNView ASN1Parser::getSerializedATN() const {
938
938
 
939
939
 
940
940
  const std::regex ASN1Parser::word_pattern(".*[a-z]+.*");
941
+ const std::regex ASN1Parser::number_pattern(".*[0-9]+.*");
941
942
 
942
943
 
943
944
  //----------------- ModuleDefinitionContext ------------------------------------------------------------------
@@ -20478,7 +20479,7 @@ ASN1Parser::WordContext* ASN1Parser::word() {
20478
20479
  enterOuterAlt(_localctx, 1);
20479
20480
  setState(1878);
20480
20481
 
20481
- if (!( !std::regex_match(_input->LT(1)->getText(), word_pattern) && !std::regex_match(_input->LT(1)->getText(), word_pattern) )) throw FailedPredicateException(this, " !std::regex_match(_input->LT(1)->getText(), word_pattern) && !std::regex_match(_input->LT(1)->getText(), word_pattern) ");
20482
+ if (!( !std::regex_match(_input->LT(1)->getText(), word_pattern) && !std::regex_match(_input->LT(1)->getText(), number_pattern) )) throw FailedPredicateException(this, " !std::regex_match(_input->LT(1)->getText(), word_pattern) && !std::regex_match(_input->LT(1)->getText(), number_pattern) ");
20482
20483
  setState(1879);
20483
20484
  match(ASN1Parser::ReferenceItem);
20484
20485
 
@@ -23014,7 +23015,7 @@ bool ASN1Parser::objectclassreferenceSempred(ObjectclassreferenceContext *_local
23014
23015
 
23015
23016
  bool ASN1Parser::wordSempred(WordContext *_localctx, size_t predicateIndex) {
23016
23017
  switch (predicateIndex) {
23017
- case 4: return !std::regex_match(_input->LT(1)->getText(), word_pattern) && !std::regex_match(_input->LT(1)->getText(), word_pattern) ;
23018
+ case 4: return !std::regex_match(_input->LT(1)->getText(), word_pattern) && !std::regex_match(_input->LT(1)->getText(), number_pattern) ;
23018
23019
 
23019
23020
  default:
23020
23021
  break;
@@ -152,6 +152,7 @@ public:
152
152
 
153
153
  public:
154
154
  static const std::regex word_pattern;
155
+ static const std::regex number_pattern;
155
156
 
156
157
 
157
158
  class ModuleDefinitionContext;
@@ -1,3 +1,3 @@
1
1
  module ASN1Parser
2
- VERSION = '1.0.6'.freeze
2
+ VERSION = '1.0.8'.freeze
3
3
  end
data/lib/asn1_parser.rb CHANGED
@@ -1,3 +1,8 @@
1
1
  # load the native extension
2
2
  require 'asn1_parser/version'
3
3
  require_relative 'asn1_parser/asn1_parser'
4
+
5
+ # The Native ANTLR File Parser
6
+ class ASN1Parser::Parser
7
+ alias module_definition moduleDefinition
8
+ end
@@ -0,0 +1,13 @@
1
+ require 'spec_helper'
2
+
3
+ FILE_PATH = File.join(__dir__, '../fixtures/img4.asn1')
4
+
5
+ RSpec.describe ASN1Parser::Parser do
6
+ let(:parser) { described_class.parse_file(FILE_PATH).module_definition }
7
+
8
+ it 'should have a module definition' do
9
+ children = parser.children
10
+ puts children
11
+ expect(parser.children[0]).to_not be_nil
12
+ end
13
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asn_parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.6
4
+ version: 1.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rick Mark
@@ -426,6 +426,7 @@ files:
426
426
  - lib/asn1_parser/version.rb
427
427
  - lib/asn_parser.rb
428
428
  - spec/parser/fixtures_spec.rb
429
+ - spec/parser/img4_spec.rb
429
430
  - spec/spec_helper.rb
430
431
  homepage: https://github.com/rickmark/rasn2_parser
431
432
  licenses: []