Browse files

Fixed the module identifier resolution algorithm.

  • Loading branch information...
1 parent 00be3be commit 5eedc1b508c7b67bb005748813827c6c5326267e @kriskowal kriskowal committed May 31, 2011
Showing with 9 additions and 10 deletions.
  1. +9 −10 modules/specification.md
View
19 modules/specification.md
@@ -116,20 +116,19 @@ Module Identifiers
1. Top-level identifiers are resolved relative to ``""``.
1. The ``require`` function in each module resolves relative
identifiers from the corresponding ``module.id``.
-1. To resolve a module identifier,
- 1. an array of terms must be initialized to an empty array.
- 1. For each ordered term in some ordered module identifiers, from
- left to right,
- 1. no action is taken for ``"."`` terms,
- 1. a term is popped off the end of the array for ``".."``
- terms, and
- 1. the term is pushed on the end of the array for all other
- terms.
+1. To resolve any path of module identifiers,
+ 1. An array of terms must be initialized to an empty array.
+ 1. For each module identifier in the path of identifiers,
+ 1. Pop off the last term in the array, provided one exists.
+ 1. For each term in a module identifier in order,
+ 1. Take no action if the term is ``"."``.
+ 1. Pop a term off the end of the array if the term is
+ ``".."``.
+ 1. Push the term on the end of the array otherwise.
1. The array of terms must be joined with forward slashes, ``"/"``
to construct the resulting "resolved" identifier.
-
Unspecified
===========

0 comments on commit 5eedc1b

Please sign in to comment.