10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26 package jdk.nashorn.api.tree;
27
28 import jdk.nashorn.internal.parser.Token;
29 import jdk.nashorn.internal.runtime.ParserException;
30 import jdk.nashorn.internal.runtime.Source;
31
32 final class DiagnosticImpl implements Diagnostic {
33 private final ParserException exp;
34 private final Kind kind;
35
36 DiagnosticImpl(final ParserException exp, final Kind kind) {
37 this.exp = exp;
38 this.kind = kind;
39 }
40
41 @Override
42 public Kind getKind() {
43 return kind;
44 }
45
46 @Override
47 public long getPosition() {
48 return exp.getPosition();
49 }
50
|
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26 package jdk.nashorn.api.tree;
27
28 import jdk.nashorn.internal.parser.Token;
29 import jdk.nashorn.internal.runtime.ParserException;
30
31 final class DiagnosticImpl implements Diagnostic {
32 private final ParserException exp;
33 private final Kind kind;
34
35 DiagnosticImpl(final ParserException exp, final Kind kind) {
36 this.exp = exp;
37 this.kind = kind;
38 }
39
40 @Override
41 public Kind getKind() {
42 return kind;
43 }
44
45 @Override
46 public long getPosition() {
47 return exp.getPosition();
48 }
49
|