Mercurial > hg > truffle
changeset 22470:64d5619ebbce
Truffle/SourceSection: change the default name for "unknown" to a public static for comparisions.
author | Michael Van De Vanter <michael.van.de.vanter@oracle.com> |
---|---|
date | Sun, 06 Dec 2015 20:12:43 -0800 |
parents | ff91249da77d |
children | a6c162686d81 f9f97ca1d66d |
files | truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/source/SourceSection.java |
diffstat | 1 files changed, 7 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/source/SourceSection.java Sun Dec 06 20:10:47 2015 -0800 +++ b/truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/source/SourceSection.java Sun Dec 06 20:12:43 2015 -0800 @@ -37,6 +37,12 @@ * @see #createUnavailable */ public final class SourceSection { + + /** + * The identifier stored when source information is unavailable. + */ + public static String UNKNOWN = "<unknown>"; + private final Source source; private final String identifier; private final int startLine; @@ -262,6 +268,6 @@ * @return source section which is mostly <em>empty</em> */ public static SourceSection createUnavailable(String kind, String name) { - return new SourceSection(kind, null, name == null ? "<unknown>" : name, -1, -1, -1, -1); + return new SourceSection(kind, null, name == null ? UNKNOWN : name, -1, -1, -1, -1); } }