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 +4 -4
- data/ext/asn1_parser/antlrgen/ASN1Parser.cpp +3 -2
- data/ext/asn1_parser/antlrgen/ASN1Parser.h +1 -0
- data/lib/asn1_parser/version.rb +1 -1
- data/lib/asn1_parser.rb +5 -0
- data/spec/parser/img4_spec.rb +13 -0
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f30537597a4204a0d784c132cbde4e720e57db8f3da6c372c27e948a1fc633eb
|
|
4
|
+
data.tar.gz: 1ee70a8dd02b2d95f403275c8f96218941c5ac08760604911b15afe2419a4367
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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(),
|
|
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(),
|
|
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;
|
data/lib/asn1_parser/version.rb
CHANGED
data/lib/asn1_parser.rb
CHANGED
|
@@ -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.
|
|
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: []
|