Mercurial > hg > graal-jvmci-8
comparison graal/com.oracle.truffle.api/src/com/oracle/truffle/api/source/SourceLineLocation.java @ 13564:35f637594acc
Truffle: refinements in the management of source information: a new marker interface for empty SourceSections and fix a bug that kept modified source files from being reloaded.
author | Michael Van De Vanter <michael.van.de.vanter@oracle.com> |
---|---|
date | Tue, 07 Jan 2014 18:21:20 -0800 |
parents | 69d2e4baa215 |
children | 288c23143d47 |
comparison
equal
deleted
inserted
replaced
13563:fb846424299f | 13564:35f637594acc |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * | 4 * |
5 * This code is free software; you can redistribute it and/or modify it | 5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as | 6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this | 7 * published by the Free Software Foundation. Oracle designates this |
36 private final Source source; | 36 private final Source source; |
37 private final int line; | 37 private final int line; |
38 | 38 |
39 public SourceLineLocation(Source source, int line) { | 39 public SourceLineLocation(Source source, int line) { |
40 assert source != null; | 40 assert source != null; |
41 assert source != SourceSection.NULL; | |
42 this.source = source; | 41 this.source = source; |
43 this.line = line; | 42 this.line = line; |
43 } | |
44 | |
45 public SourceLineLocation(SourceSection sourceSection) { | |
46 this(sourceSection.getSource(), sourceSection.getStartLine()); | |
44 } | 47 } |
45 | 48 |
46 public Source getSource() { | 49 public Source getSource() { |
47 return source; | 50 return source; |
48 } | 51 } |