Make semicolons required in IMPORTS and EXPORTS.
authorKim Grasman <kim.grasman@gmail.com>
Fri, 20 Sep 2013 20:30:04 +0000 (22:30 +0200)
committerKim Grasman <kim.grasman@gmail.com>
Fri, 20 Sep 2013 20:30:04 +0000 (22:30 +0200)
asn1ate/parser.py
testdata/import_export.asn

index c4e65e0..046d6a9 100644 (file)
@@ -300,8 +300,7 @@ def _build_asn1_grammar():
     symbols_from_module = symbol_list + Suppress(FROM) + global_module_reference
     symbols_from_module_list = OneOrMore(symbols_from_module)
     symbols_imported = Optional(symbols_from_module_list)
-    imports = Optional(EXPORTS + symbol_list + Suppress(Optional(';'))) + Optional(IMPORTS + symbols_imported + Suppress(Optional(';'))) 
-
+    imports = Optional(EXPORTS + symbol_list + Suppress(';')) + Optional(IMPORTS + symbols_imported + Suppress(';')) 
 
     module_body = (imports + assignment_list) | empty
     module_defaults = Suppress(tag_default + extension_default)  # we don't want these in the AST
index ec9f81a..94319f2 100644 (file)
@@ -2,9 +2,9 @@ MyASN1Module DEFINITIONS ::=
 
 BEGIN
 
-EXPORTS EVERYTHING
+EXPORTS EVERYTHING;
 
-IMPORTS DataType FROM OtherASN1Module
+IMPORTS DataType FROM OtherASN1Module;
 
 MyType ::= INTEGER