Fix restricted integer type.
authorKim Grasman <kim.grasman@gmail.com>
Wed, 28 Aug 2013 12:57:28 +0000 (14:57 +0200)
committerKim Grasman <kim.grasman@gmail.com>
Wed, 28 Aug 2013 12:57:28 +0000 (14:57 +0200)
asn1ate/parser.py
testdata/builtin_types.asn

index 8bbb7ae..1eb2163 100644 (file)
@@ -266,7 +266,7 @@ def _build_asn1_grammar():
     simple_type = (boolean_type | null_type | octetstring_type | characterstring_type | real_type | plain_integer_type | object_identifier_type) + Optional(constraint)
     constructed_type = choice_type | sequence_type | set_type
     value_list_type = restricted_integer_type | enumerated_type
-    builtin_type = tagged_type | simple_type | constructed_type | sequenceof_type | setof_type | value_list_type | bitstring_type
+    builtin_type = value_list_type | tagged_type | simple_type | constructed_type | sequenceof_type | setof_type | bitstring_type
 
     type_ << (builtin_type | referenced_type)
 
index 305cb3b..b5b5a51 100644 (file)
@@ -6,6 +6,11 @@ BEGIN
   Int ::= INTEGER
   Real ::= REAL
 
+  RestrictedInteger ::= INTEGER {
+    v1(1),
+    v2(2)
+  }
+
   -- Enumerated types
   BitString ::= BIT STRING {
     a(1),