config/config
Havoc Pennington 683e72cbbe Clean up code and semantics around self-referential handling
The basic idea in this patch is to unify on the "replacer"
(modifying the tree in which we lookup substitutions)
mechanism for detecting cycles.

Drop the "traverse" method, instead keeping a trace of expressions
we've passed through for nice error messages.

There is now only one internal checked exception possible,
NotPossibleToResolve which is thrown when a cycle is detected;
this checked exception is always caught by ConfigReference
so cannot "escape" from the library. The exception exists
because we want to get the traceString debug info out
of the spot that detected the cycle, if we didn't want that
debug info we could just return null as usual for undefined.

As part of simplifying this (which should also simplify the
spec), resolutions which require double-traverse of the same
reference are no longer supported:
   a=1, b=${a}, a=${b}

Also, cycles now always throw UnresolvedSubstitution rather
than BadValue. This was needed for consistency since
conceptually a single a=${a} is going to "look back" earlier
in the merge stack, discover there is no earlier value of a,
and fail; it should be the same exception as a=${a},a={b:1},
and in both cases referring to these cycles via ${?} should
hide the exception.
2012-04-05 09:39:39 -04:00
..
src Clean up code and semantics around self-referential handling 2012-04-05 09:39:39 -04:00
build.sbt switch from lift-json 2.4-SNAPSHOT to 2.4 2012-02-24 16:53:54 -05:00