Skip to content
This repository
Browse code

encapsulate creating module file name in a function

  • Loading branch information...
commit d974f5cbae08153aa0533d1fc8d6d1502b2c7a8e 1 parent 2a7802c
NotFound authored June 25, 2012
8  winxedst1.winxed
@@ -1827,6 +1827,11 @@ function toIdentifierList(var tlist)
1827 1827
     return list;
1828 1828
 }
1829 1829
 
  1830
+function toModuleFilename(var tlist)
  1831
+{
  1832
+    return "\"" + join("/", toIdentifierList(tlist)) + ".pbc\"";
  1833
+}
  1834
+
1830 1835
 //*********************************************
1831 1836
 //               CommonBase
1832 1837
 //*********************************************
@@ -9249,8 +9254,7 @@ function parsensUsing(var start, var tk, var ns)
9249 9254
         var names = parseListOrEmpty(tk, null, parseIdentifier, ";");
9250 9255
         if (names != null)
9251 9256
             ns.addextern(module, names);
9252  
-        string reqmodule = "\"" + join("/", module) + ".pbc\"";
9253  
-        ns.addload(reqmodule);
  9257
+        ns.addload(toModuleFilename(module));
9254 9258
         break;
9255 9259
       default:
9256 9260
         Expected("string literal or identifier", t);
8  winxedst2.winxed
@@ -2232,6 +2232,11 @@ function toIdentifierList(var tlist)
2232 2232
     return list;
2233 2233
 }
2234 2234
 
  2235
+function toModuleFilename(var tlist)
  2236
+{
  2237
+    return "\"" + join("/", toIdentifierList(tlist)) + ".pbc\"";
  2238
+}
  2239
+
2235 2240
 //*********************************************
2236 2241
 //               CommonBase
2237 2242
 //*********************************************
@@ -12445,8 +12450,7 @@ function parsensUsing(var start, var tk, var ns)
12445 12450
         var names = parseListOrEmpty(tk, null, parseIdentifier, ";");
12446 12451
         if (names != null)
12447 12452
             ns.addextern(module, names);
12448  
-        string reqmodule = "\"" + join("/", module) + ".pbc\"";
12449  
-        ns.addload(reqmodule);
  12453
+        ns.addload(toModuleFilename(module));
12450 12454
         break;
12451 12455
       default:
12452 12456
         Expected("string literal or identifier", t);

0 notes on commit d974f5c

Please sign in to comment.
Something went wrong with that request. Please try again.