Skip to content
Browse files

Make parsing and scanning works even for modules without path (e.g. t…

…ests and compare)
  • Loading branch information...
1 parent 742fc82 commit c4567f03a930e2e41a664fa91acd1f30c883128b @jakobc jakobc committed Mar 14, 2013
View
5 org.erlide.model/src/org/erlide/model/internal/erlang/ErlModule.java
@@ -530,9 +530,6 @@ public void createScanner() {
private IErlScanner getNewScanner() {
final String filePath = getFilePath();
- if (filePath == null) {
- return null;
- }
final String text = getInitialText();
return ErlModelManager.getErlangModel().getToolkit()
.createScanner(scannerName, text, filePath, logging);
@@ -729,6 +726,8 @@ public String createScannerName() {
return createScannerNameFromResource(res);
} else if (getFilePath() != null) {
return "mod" + getFilePath().hashCode() + "__" + getName();
+ } else if (getName() != null) {
+ return "mod" + hashCode() + "_" + getName();
}
// This is not used more than temporarily, so it's OK to have
// a name that's temporary, as long as it's unique
View
3 org.erlide.model/src/org/erlide/model/internal/erlang/ErlParser.java
@@ -88,7 +88,8 @@ public boolean parse(final IErlModule module, final String scannerName,
if (initialParse) {
final String stateDir = ModelPlugin.getDefault().getStateLocation()
.toString();
- res = ErlideNoparse.initialParse(backend, scannerName, path,
+ final String pathNotNull = path == null ? "" : path;
+ res = ErlideNoparse.initialParse(backend, scannerName, pathNotNull,
initialText, stateDir, updateSearchServer);
} else {
res = ErlideNoparse.reparse(backend, scannerName,
View
3 org.erlide.model/src/org/erlide/model/internal/erlang/ErlScanner.java
@@ -28,7 +28,8 @@ public ErlScanner(final String name) {
@Override
public void initialScan(final String initialText, final String path,
final boolean logging) {
- ErlideScanner.initialScan(name, path, initialText, logging);
+ final String pathNotNull = path == null ? "" : path;
+ ErlideScanner.initialScan(name, pathNotNull, initialText, logging);
}
@Override

0 comments on commit c4567f0

Please sign in to comment.
Something went wrong with that request. Please try again.