Java Code Examples for jdk.nashorn.internal.ir.Expression#getFinish()
The following examples show how to use
jdk.nashorn.internal.ir.Expression#getFinish() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: JSONParser.java From openjdk-8-source with GNU General Public License v2.0 | 6 votes |
/** * Parse a property assignment from the token stream * @return the property assignment as a Node */ private PropertyNode propertyAssignment() { // Capture firstToken. final long propertyToken = token; LiteralNode<?> name = null; if (type == STRING) { name = getStringLiteral(); } else if (type == ESCSTRING) { name = getLiteral(); } if (name != null) { expect(COLON); final Expression value = jsonLiteral(); return new PropertyNode(propertyToken, value.getFinish(), name, value, null, null); } // Raise an error. throw error(AbstractParser.message("expected", "string", type.getNameOrType())); }
Example 2
Source File: JSONParser.java From openjdk-8 with GNU General Public License v2.0 | 6 votes |
/** * Parse a property assignment from the token stream * @return the property assignment as a Node */ private PropertyNode propertyAssignment() { // Capture firstToken. final long propertyToken = token; LiteralNode<?> name = null; if (type == STRING) { name = getStringLiteral(); } else if (type == ESCSTRING) { name = getLiteral(); } if (name != null) { expect(COLON); final Expression value = jsonLiteral(); return new PropertyNode(propertyToken, value.getFinish(), name, value, null, null); } // Raise an error. throw error(AbstractParser.message("expected", "string", type.getNameOrType())); }
Example 3
Source File: JSONParser.java From nashorn with GNU General Public License v2.0 | 6 votes |
/** * Parse a property assignment from the token stream * @return the property assignment as a Node */ private PropertyNode propertyAssignment() { // Capture firstToken. final long propertyToken = token; LiteralNode<?> name = null; if (type == STRING) { name = getStringLiteral(); } else if (type == ESCSTRING) { name = getLiteral(); } if (name != null) { expect(COLON); final Expression value = jsonLiteral(); return new PropertyNode(propertyToken, value.getFinish(), name, value, null, null); } // Raise an error. throw error(AbstractParser.message("expected", "string", type.getNameOrType())); }
Example 4
Source File: Parser.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
private RuntimeNode referenceError(final Expression lhs, final Expression rhs, final boolean earlyError) { if (earlyError) { throw error(JSErrorType.REFERENCE_ERROR, AbstractParser.message("invalid.lvalue"), lhs.getToken()); } final ArrayList<Expression> args = new ArrayList<>(); args.add(lhs); if (rhs == null) { args.add(LiteralNode.newInstance(lhs.getToken(), lhs.getFinish())); } else { args.add(rhs); } args.add(LiteralNode.newInstance(lhs.getToken(), lhs.getFinish(), lhs.toString())); return new RuntimeNode(lhs.getToken(), lhs.getFinish(), RuntimeNode.Request.REFERENCE_ERROR, args); }
Example 5
Source File: Parser.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
private RuntimeNode referenceError(final Expression lhs, final Expression rhs, final boolean earlyError) { if (earlyError) { throw error(JSErrorType.REFERENCE_ERROR, AbstractParser.message("invalid.lvalue"), lhs.getToken()); } final ArrayList<Expression> args = new ArrayList<>(); args.add(lhs); if (rhs == null) { args.add(LiteralNode.newInstance(lhs.getToken(), lhs.getFinish())); } else { args.add(rhs); } args.add(LiteralNode.newInstance(lhs.getToken(), lhs.getFinish(), lhs.toString())); return new RuntimeNode(lhs.getToken(), lhs.getFinish(), RuntimeNode.Request.REFERENCE_ERROR, args); }
Example 6
Source File: Parser.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
private RuntimeNode referenceError(final Expression lhs, final Expression rhs, final boolean earlyError) { if (earlyError) { throw error(JSErrorType.REFERENCE_ERROR, AbstractParser.message("invalid.lvalue"), lhs.getToken()); } final ArrayList<Expression> args = new ArrayList<>(); args.add(lhs); if (rhs == null) { args.add(LiteralNode.newInstance(lhs.getToken(), lhs.getFinish())); } else { args.add(rhs); } args.add(LiteralNode.newInstance(lhs.getToken(), lhs.getFinish(), lhs.toString())); return new RuntimeNode(lhs.getToken(), lhs.getFinish(), RuntimeNode.Request.REFERENCE_ERROR, args); }
Example 7
Source File: Parser.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
private RuntimeNode referenceError(final Expression lhs, final Expression rhs, final boolean earlyError) { if (earlyError) { throw error(JSErrorType.REFERENCE_ERROR, AbstractParser.message("invalid.lvalue"), lhs.getToken()); } final ArrayList<Expression> args = new ArrayList<>(); args.add(lhs); if (rhs == null) { args.add(LiteralNode.newInstance(lhs.getToken(), lhs.getFinish())); } else { args.add(rhs); } args.add(LiteralNode.newInstance(lhs.getToken(), lhs.getFinish(), lhs.toString())); return new RuntimeNode(lhs.getToken(), lhs.getFinish(), RuntimeNode.Request.REFERENCE_ERROR, args); }
Example 8
Source File: Parser.java From hottub with GNU General Public License v2.0 | 5 votes |
private RuntimeNode referenceError(final Expression lhs, final Expression rhs, final boolean earlyError) { if (earlyError) { throw error(JSErrorType.REFERENCE_ERROR, AbstractParser.message("invalid.lvalue"), lhs.getToken()); } final ArrayList<Expression> args = new ArrayList<>(); args.add(lhs); if (rhs == null) { args.add(LiteralNode.newInstance(lhs.getToken(), lhs.getFinish())); } else { args.add(rhs); } args.add(LiteralNode.newInstance(lhs.getToken(), lhs.getFinish(), lhs.toString())); return new RuntimeNode(lhs.getToken(), lhs.getFinish(), RuntimeNode.Request.REFERENCE_ERROR, args); }
Example 9
Source File: Parser.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
private RuntimeNode referenceError(final Expression lhs, final Expression rhs, final boolean earlyError) { if (earlyError) { throw error(JSErrorType.REFERENCE_ERROR, AbstractParser.message("invalid.lvalue"), lhs.getToken()); } final ArrayList<Expression> args = new ArrayList<>(); args.add(lhs); if (rhs == null) { args.add(LiteralNode.newInstance(lhs.getToken(), lhs.getFinish())); } else { args.add(rhs); } args.add(LiteralNode.newInstance(lhs.getToken(), lhs.getFinish(), lhs.toString())); return new RuntimeNode(lhs.getToken(), lhs.getFinish(), RuntimeNode.Request.REFERENCE_ERROR, args); }
Example 10
Source File: Parser.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
private RuntimeNode referenceError(final Expression lhs, final Expression rhs, final boolean earlyError) { if (earlyError) { throw error(JSErrorType.REFERENCE_ERROR, AbstractParser.message("invalid.lvalue"), lhs.getToken()); } final ArrayList<Expression> args = new ArrayList<>(); args.add(lhs); if (rhs == null) { args.add(LiteralNode.newInstance(lhs.getToken(), lhs.getFinish())); } else { args.add(rhs); } args.add(LiteralNode.newInstance(lhs.getToken(), lhs.getFinish(), lhs.toString())); return new RuntimeNode(lhs.getToken(), lhs.getFinish(), RuntimeNode.Request.REFERENCE_ERROR, args); }
Example 11
Source File: Parser.java From jdk8u_nashorn with GNU General Public License v2.0 | 5 votes |
private RuntimeNode referenceError(final Expression lhs, final Expression rhs, final boolean earlyError) { if (earlyError) { throw error(JSErrorType.REFERENCE_ERROR, AbstractParser.message("invalid.lvalue"), lhs.getToken()); } final ArrayList<Expression> args = new ArrayList<>(); args.add(lhs); if (rhs == null) { args.add(LiteralNode.newInstance(lhs.getToken(), lhs.getFinish())); } else { args.add(rhs); } args.add(LiteralNode.newInstance(lhs.getToken(), lhs.getFinish(), lhs.toString())); return new RuntimeNode(lhs.getToken(), lhs.getFinish(), RuntimeNode.Request.REFERENCE_ERROR, args); }
Example 12
Source File: Parser.java From nashorn with GNU General Public License v2.0 | 5 votes |
private RuntimeNode referenceError(final Expression lhs, final Expression rhs, final boolean earlyError) { if (earlyError) { throw error(JSErrorType.REFERENCE_ERROR, AbstractParser.message("invalid.lvalue"), lhs.getToken()); } final ArrayList<Expression> args = new ArrayList<>(); args.add(lhs); if (rhs == null) { args.add(LiteralNode.newInstance(lhs.getToken(), lhs.getFinish())); } else { args.add(rhs); } args.add(LiteralNode.newInstance(lhs.getToken(), lhs.getFinish(), lhs.toString())); return new RuntimeNode(lhs.getToken(), lhs.getFinish(), RuntimeNode.Request.REFERENCE_ERROR, args); }