From 70251c5ee7e2c96dac19e49b6ce69a55d78994a4 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Fri, 2 Mar 2018 11:02:06 +0100 Subject: Bring JS grammar in line with ES7 spec This basically updates all grammar rules in the qqmljs.g file to be in line with the ES7 specification. Some special handling for the lookahead rules appearing in the spec was needed and is implemented through empty lookahead rules in the grammar, that might push an additional token into the token stream. Renamed some classes in the AST to be in line with the names used in ES7, and removed some other ones (SourceElements) that are no longer used. The ES7 grammar rules contain lots of variations of the base rules (with In/Return/Yield/Default suffixes). With the exception of the In and Default rules, these are implemented through state tracking in the parser and lexer. Change-Id: I4017d97cd050ed816c1dad11833e882cba30801a Reviewed-by: Simon Hausmann --- src/qml/parser/qqmljsastfwd_p.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/qml/parser/qqmljsastfwd_p.h') diff --git a/src/qml/parser/qqmljsastfwd_p.h b/src/qml/parser/qqmljsastfwd_p.h index 7a8bdf1b63..89245f4884 100644 --- a/src/qml/parser/qqmljsastfwd_p.h +++ b/src/qml/parser/qqmljsastfwd_p.h @@ -97,7 +97,7 @@ class ArrayLiteral; class ObjectLiteral; class ElementList; class Elision; -class PropertyAssignmentList; +class PropertyDefinitionList; class PropertyGetterSetter; class PropertyNameAndValue; class PropertyName; @@ -156,14 +156,12 @@ class Finally; class FunctionDeclaration; class FunctionExpression; class FormalParameterList; -class FunctionBody; class Program; -class SourceElements; -class SourceElement; -class FunctionSourceElement; -class StatementSourceElement; class DebuggerStatement; class NestedExpression; +class BindingPattern; +class ArrayBindingPattern; +class ObjectBindingPattern; class BindingElement; class BindingElementList; class BindingPropertyList; -- cgit v1.2.3