Merge "features-test to test that features load correctly."
authorRobert Varga <rovarga@cisco.com>
Mon, 18 Aug 2014 15:14:54 +0000 (15:14 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Mon, 18 Aug 2014 15:14:54 +0000 (15:14 +0000)
common/util/src/main/java/org/opendaylight/yangtools/util/MapAdaptor.java
yang/yang-parser-impl/src/main/antlr/YangParser.g4

index d1d8b75806d1d54fcc684230680872b5a147580a..301153afe00fdaec5723d895b76b17271d430444 100644 (file)
@@ -7,6 +7,10 @@
  */
 package org.opendaylight.yangtools.util;
 
+import com.google.common.base.Preconditions;
+import com.google.common.collect.Iterables;
+import com.romix.scala.collection.concurrent.TrieMap;
+
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.Map;
@@ -15,10 +19,6 @@ import java.util.Map.Entry;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.google.common.base.Preconditions;
-import com.google.common.collect.Iterables;
-import com.romix.scala.collection.concurrent.TrieMap;
-
 /**
  * A simple layer on top of maps, which performs snapshot mediation and optimization of
  * what the underlying implementation is.
@@ -146,7 +146,7 @@ public final class MapAdaptor {
         if (useSingleton && size == 1) {
             final Entry<K, V> e = Iterables.getOnlyElement(input.entrySet());
             final Map<K, V> ret = Collections.singletonMap(e.getKey(), e.getValue());
-            LOG.trace("Reducing input () to singleton map {}", input, ret);
+            LOG.trace("Reducing input {} to singleton map {}", input, ret);
             return ret;
         }
 
index c7054fbc9f41120bdf92f96f52942b99444a63f4..eea920abc01891933f2ac273662e88aa780adfec 100644 (file)
@@ -34,6 +34,7 @@ unknown_statement : (YIN_ELEMENT_KEYWORD | YANG_VERSION_KEYWORD | WHEN_KEYWORD |
                     ANYXML_KEYWORD | IDENTIFIER) string? (SEMICOLON | (LEFT_BRACE (unknown_statement | identifier_stmt)* RIGHT_BRACE)*);
 
 stmtend : (SEMICOLON) | (LEFT_BRACE identifier_stmt? RIGHT_BRACE);
+stmtsep : IDENTIFIER string? (stmtend | (LEFT_BRACE unknown_statement* RIGHT_BRACE));
 deviate_replace_stmt : DEVIATE_KEYWORD string /* REPLACE_KEYWORD */ (SEMICOLON | (LEFT_BRACE (identifier_stmt |type_stmt | units_stmt | default_stmt | config_stmt | mandatory_stmt | min_elements_stmt | max_elements_stmt )* RIGHT_BRACE));
 deviate_delete_stmt : DEVIATE_KEYWORD string /* DELETE_KEYWORD */ (SEMICOLON | (LEFT_BRACE (identifier_stmt |units_stmt | must_stmt | unique_stmt | default_stmt )* RIGHT_BRACE));
 deviate_add_stmt : DEVIATE_KEYWORD string /*ADD_KEYWORD*/ (SEMICOLON | (LEFT_BRACE (identifier_stmt |units_stmt | must_stmt | unique_stmt | default_stmt | config_stmt | mandatory_stmt  | min_elements_stmt  | max_elements_stmt )* RIGHT_BRACE));
@@ -131,10 +132,10 @@ import_stmt : IMPORT_KEYWORD string LEFT_BRACE  prefix_stmt  (revision_date_stmt
 yang_version_stmt : YANG_VERSION_KEYWORD string stmtend;
 data_def_stmt : container_stmt | leaf_stmt | leaf_list_stmt | list_stmt | choice_stmt | anyxml_stmt | uses_stmt;
 body_stmts : (( identifier_stmt| extension_stmt | feature_stmt | identity_stmt | typedef_stmt | grouping_stmt | data_def_stmt | augment_stmt | rpc_stmt | notification_stmt | deviation_stmt) )*;
-revision_stmts : (revision_stmt )*;
-linkage_stmts : (import_stmt | include_stmt )*;
-meta_stmts : (organization_stmt | contact_stmt | description_stmt | reference_stmt )*;
-submodule_header_stmts : (yang_version_stmt | belongs_to_stmt)+ ;
-module_header_stmts :   (yang_version_stmt | namespace_stmt | prefix_stmt)+ ;
+revision_stmts :  (revision_stmt )* (stmtsep)*;
+linkage_stmts : (import_stmt stmtsep? | include_stmt stmtsep?)*;
+meta_stmts : (organization_stmt stmtsep? | contact_stmt stmtsep? | description_stmt stmtsep? | reference_stmt stmtsep?)*;
+submodule_header_stmts : (yang_version_stmt stmtsep? | belongs_to_stmt stmtsep?)+ ;
+module_header_stmts :  (yang_version_stmt stmtsep? | namespace_stmt stmtsep? | prefix_stmt stmtsep?)+ ;
 submodule_stmt : SUBMODULE_KEYWORD string LEFT_BRACE  submodule_header_stmts linkage_stmts meta_stmts revision_stmts body_stmts RIGHT_BRACE;
-module_stmt : MODULE_KEYWORD string LEFT_BRACE  module_header_stmts linkage_stmts meta_stmts revision_stmts body_stmts RIGHT_BRACE;
+module_stmt : MODULE_KEYWORD string LEFT_BRACE stmtsep? module_header_stmts linkage_stmts meta_stmts revision_stmts body_stmts RIGHT_BRACE;
\ No newline at end of file