]> git.saurik.com Git - cycript.git/blobdiff - Cycript.y.in
Fixed the E4X attribute parser and removed some of the E4X contextual extensions.
[cycript.git] / Cycript.y.in
index 37b9203a65973d5a817dd0fc78373e8be8ec2fbd..a77265f3538f5b0e7ab46560dc7f5469625bfa6f 100644 (file)
@@ -696,7 +696,7 @@ BooleanLiteral
 PrimaryExpression
     : PrimaryExpressionNoWC { $$ = $1; }
 @begin E4X
-    | LexSetRegExp PrimaryExpressionWC { $$ = $1; }
+    | LexSetRegExp PrimaryExpressionWC { $$ = $2; }
 @end
     ;
 
@@ -1748,7 +1748,7 @@ PropertySelector_
     ;
 
 PropertySelector
-    : Word { $$ = $1; }
+    : Identifier { $$ = $1; }
     | WildcardIdentifier { $$ = $1; }
     ;
 /* }}} */
@@ -1774,16 +1774,12 @@ XMLInitialiser
     ;
 
 XMLElement
-    : "<" XMLTagContent_ "/>" LexPop
-    | "<" XMLTagContent_ ">" LexSetXMLContent XMLElementContentOpt "</" LexSetXMLTag XMLTagName XMLWhitespaceOpt ">" LexPop
-    ;
-
-XMLTagContent_
-    : LexPushXMLTag XMLTagContent XMLWhitespaceOpt
+    : "<" XMLTagContent "/>" LexPop
+    | "<" XMLTagContent ">" LexSetXMLContent XMLElementContentOpt "</" LexSetXMLTag XMLTagName XMLWhitespaceOpt ">" LexPop
     ;
 
 XMLTagContent
-    : XMLTagName XMLAttributesOpt
+    : LexPushXMLTag XMLTagName XMLAttributes
     ;
 
 XMLExpression
@@ -1795,14 +1791,14 @@ XMLTagName
     | XMLName
     ;
 
-XMLAttributes
-    : XMLWhitespace XMLExpression
-    | XMLAttributeOpt XMLAttributes
+XMLAttributes_
+    : XMLAttributes_ XMLAttribute
+    |
     ;
 
-XMLAttributesOpt
-    : XMLAttributes
-    |
+XMLAttributes
+    : XMLAttributes_ XMLWhitespace XMLExpression XMLWhitespaceOpt
+    | XMLAttributes_ XMLWhitespaceOpt
     ;
 
 XMLAttributeValue_
@@ -1814,11 +1810,6 @@ XMLAttribute
     : XMLWhitespace XMLName XMLWhitespaceOpt "=" XMLWhitespaceOpt XMLAttributeValue_
     ;
 
-XMLAttributeOpt
-    : XMLAttribute
-    |
-    ;
-
 XMLElementContent
     : XMLExpression XMLElementContentOpt
     | XMLMarkup XMLElementContentOpt
@@ -1838,7 +1829,7 @@ XMLListInitialiser
 /* }}} */
 /* 11.2 Left-Hand-Side Expressions {{{ */
 PropertyIdentifier_
-    : Word { $$ = $1; }
+    : Identifier { $$ = $1; }
     | PropertyIdentifier { $$ = $1; }
     ;