Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rolling TemplateFileSourceInfo and ParentSourceInfo into one.
- Loading branch information
Showing
6 changed files
with
40 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 0 additions & 33 deletions
33
stencil/src/net/stencilproject/template/ParentSourceInfo.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 29 additions & 9 deletions
38
stencil/src/net/stencilproject/template/TemplateFileSourceInfo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,42 @@ | ||
package net.stencilproject.template; | ||
|
||
/** | ||
* Keeps track of a template file and a source info. | ||
*/ | ||
class TemplateFileSourceInfo { | ||
private final TemplateFile templateFile; | ||
class TemplateFileSourceInfo implements SourceInfo { | ||
private final TemplateFile file; | ||
private final SourceInfo parent; | ||
private final int line; | ||
private final int column; | ||
|
||
public TemplateFileSourceInfo(TemplateFile templateFile, SourceInfo parent) { | ||
this.templateFile = templateFile; | ||
public TemplateFileSourceInfo(TemplateFile file) { | ||
this.file = file; | ||
this.parent = null; | ||
this.line = SourceInfo.NO_LINE; | ||
this.column = SourceInfo.NO_COLUMN; | ||
} | ||
|
||
public TemplateFileSourceInfo(TemplateFile file, SourceInfo parent, int line, int column) { | ||
this.file = file; | ||
this.parent = parent; | ||
this.line = line; | ||
this.column = column; | ||
} | ||
|
||
@Override | ||
public int getColumn() { | ||
return column; | ||
} | ||
|
||
@Override | ||
public int getLine() { | ||
return line; | ||
} | ||
|
||
@Override | ||
public SourceInfo getParent() { | ||
return parent; | ||
} | ||
|
||
public TemplateFile getTemplateFile() { | ||
return templateFile; | ||
@Override | ||
public TemplateFile getSource() { | ||
return file; | ||
} | ||
} |