[Swift-commit] r8072 - trunk/src/org/griphyn/vdl/util

hategan at ci.uchicago.edu hategan at ci.uchicago.edu
Sat Jul 26 17:36:10 CDT 2014


Author: hategan
Date: 2014-07-26 17:36:10 -0500 (Sat, 26 Jul 2014)
New Revision: 8072

Modified:
   trunk/src/org/griphyn/vdl/util/SwiftConfig.java
Log:
proper indices for included files

Modified: trunk/src/org/griphyn/vdl/util/SwiftConfig.java
===================================================================
--- trunk/src/org/griphyn/vdl/util/SwiftConfig.java	2014-07-26 22:32:13 UTC (rev 8071)
+++ trunk/src/org/griphyn/vdl/util/SwiftConfig.java	2014-07-26 22:36:10 UTC (rev 8072)
@@ -134,10 +134,13 @@
     private static class IncluderWrapper implements ConfigIncluder {
         private final ConfigIncluder d;
         private final List<String> loadedFiles;
+        private final List<String> loadedFileIndices;
+        private int index;
         
-        public IncluderWrapper(ConfigIncluder d, List<String> loadedFiles) {
+        public IncluderWrapper(ConfigIncluder d, List<String> loadedFiles, List<String> loadedFileIndices) {
             this.d = d;
             this.loadedFiles = loadedFiles;
+            this.loadedFileIndices = loadedFileIndices;
         }
 
         @Override
@@ -155,6 +158,7 @@
                 b = what.indexOf("${");
             }
             loadedFiles.add(new File(what).getAbsolutePath());
+            loadedFileIndices.add(String.valueOf(++index));
             return ConfigFactory.parseFile(new File(what)).root();
         }
 
@@ -189,7 +193,7 @@
         List<String> loadedFileIndices = new ArrayList<String>();
         
         ConfigParseOptions opt = ConfigParseOptions.defaults();
-        opt = opt.setIncluder(new IncluderWrapper(opt.getIncluder(), loadedFiles)).
+        opt = opt.setIncluder(new IncluderWrapper(opt.getIncluder(), loadedFiles, loadedFileIndices)).
             setSyntax(ConfigSyntax.CONF).setAllowMissing(false);
         
         Config conf;




More information about the Swift-commit mailing list