Skip to content

Commit 1a32824

Browse files
committed
forgot to implement the degenerate parse error
1 parent 9741013 commit 1a32824

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/org/rascalmpl/exceptions/RuntimeExceptionFactory.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ public class RuntimeExceptionFactory {
9898

9999
// NotImplemented
100100
public static final Type ParseError = TF.constructor(TS, Exception, "ParseError", TF.sourceLocationType(), "location");
101+
102+
// this comes from lang::json::IO
101103
public static final Type NoOffsetParseError = TF.constructor(TS, Exception, "NoOffsetParseError", TF.sourceLocationType(), "location", TF.integerType(), "line", TF.integerType(), "column");
102104

103105
public static final Type PathNotFound = TF.constructor(TS,Exception,"PathNotFound",TF.sourceLocationType(), "location");
@@ -686,11 +688,11 @@ public static Throw jsonParseError(ISourceLocation loc, String cause, String pat
686688
}
687689

688690
public static Throw jsonParseError(ISourceLocation file, int line, int col, String cause, String path) {
689-
// TODO Auto-generated method stub
690-
throw new UnsupportedOperationException("Unimplemented method 'jsonParseError'");
691+
return new Throw(VF.constructor(NoOffsetParseError, file, VF.integer(line), VF.integer(col))
692+
.asWithKeywordParameters().setParameter("reason", VF.string(cause))
693+
.asWithKeywordParameters().setParameter("path", VF.string(path)));
691694
}
692695

693-
694696
public static Throw parseError(ISourceLocation loc, AbstractAST ast, StackTrace trace) {
695697
return new Throw(VF.constructor(ParseError, loc), ast != null ? ast.getLocation() : null, trace);
696698
}

src/org/rascalmpl/library/lang/json/internal/JsonValueReader.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1102,7 +1102,6 @@ public IValue read(JsonReader in, Type expected) throws IOException {
11021102

11031103
// we can't track accurately because we don't have a handle to the raw buffer under `in`
11041104
this.stopTracking = true;
1105-
11061105
var dispatch = new ExpectedTypeDispatcher(in);
11071106

11081107
try {

0 commit comments

Comments
 (0)