Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/org/rascalmpl/uri/URIResolverRegistry.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ private URIResolverRegistry() {
loadServices();
}


/**
* Use with care! This (expensive) reinitialization method clears all caches of all resolvers by
* reloading them from scratch.
Expand Down Expand Up @@ -463,6 +462,9 @@ public void unregisterLogical(String scheme, String auth) {
private static final Pattern splitScheme = Pattern.compile("^([^\\+]*)\\+");

private ISourceLocationInput getInputResolver(String scheme) {
if (scheme.equals(URIUtil.unknownLocation().getScheme())) {
return null;
}
ISourceLocationInput result = inputResolvers.get(scheme);
if (result == null) {
Matcher m = splitScheme.matcher(scheme);
Expand All @@ -481,6 +483,9 @@ private ISourceLocationInput getInputResolver(String scheme) {
}

private IClassloaderLocationResolver getClassloaderResolver(String scheme) {
if (scheme.equals(URIUtil.unknownLocation().getScheme())) {
return null;
}
IClassloaderLocationResolver result = classloaderResolvers.get(scheme);
if (result == null) {
Matcher m = splitScheme.matcher(scheme);
Expand All @@ -496,6 +501,9 @@ private IClassloaderLocationResolver getClassloaderResolver(String scheme) {
}

private ISourceLocationOutput getOutputResolver(String scheme) {
if (scheme.equals(URIUtil.unknownLocation().getScheme())) {
return null;
}
ISourceLocationOutput result = outputResolvers.get(scheme);
if (result == null) {
Matcher m = splitScheme.matcher(scheme);
Expand Down
4 changes: 0 additions & 4 deletions src/org/rascalmpl/uri/URIUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -508,8 +508,4 @@ else if (index != -1) {

return URIUtil.changePath(location, path);
}

public static URI invalidURI() {
return rootScheme("invalid");
}
}
2 changes: 1 addition & 1 deletion test/org/rascalmpl/test/repl/JlineParserTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ private ParsedLine completeParser(String input) {
}

private ParsedLine completeParser(String input, int cursor) {
var parser = new RascalLineParser(l -> { throw new ParseError("rascal parser not supported in the test yet", URIUtil.invalidURI(), 0, 0, 0, 0, 0, 0); });
var parser = new RascalLineParser(l -> { throw new ParseError("rascal parser not supported in the test yet", URIUtil.unknownLocation().getURI(), 0, 0, 0, 0, 0, 0); });

return parser.parse(input, cursor, ParseContext.COMPLETE);
}
Expand Down
Loading