# Copyright 2005-2007 Kevin Reid, under the terms of the MIT X license # found at http://www.opensource.org/licenses/mit-license.html ................ ? def defineException := # value: ? def makeParseError := defineException( > ["org.cubik.cle.parser.makeLALR1Parser$ParseError"], > def pePrinter implements DeepFrozen { > to run(tw :TextWriter, [=> found, => expected]) :void { > tw.write("expected one of ") > tw.quote(expected.getElements()) > tw.write(", got ") > tw.quote(found) > }}) # value: ? def e := makeParseError(["found" => "{", "expected" => [";"].asSet()]) # value: problem: expected one of [";"], got "{" ? e.getExpected() # value: [";"].asSet() ? def defineExceptionGuard := # value: ? def ParseError := defineExceptionGuard(["org.cubik.cle.parser.makeLALR1Parser$ParseError"]) # value: ParseError ? "foo" :ParseError # problem: the String "foo" doesn't coerce to an E-structure-exception XXX possible error change later ? e :ParseError # value: problem: expected one of [";"], got "{" ? e.getFound() # value: "{" ? defineException([], def _(_,_):void{})([].asMap()) :ParseError # problem: <__main$_> is not DeepFrozen