mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-16 00:30:21 +02:00
implement object literals
* module/language/ecmascript/impl.scm: * module/language/ecmascript/compile-ghil.scm (comp): Object literals. * module/language/ecmascript/parse.scm (parse-ecmascript): Fix some object literal parsing.
This commit is contained in:
parent
984dce236b
commit
b72880eb17
3 changed files with 25 additions and 6 deletions
|
@ -199,11 +199,11 @@
|
|||
|
||||
(ObjectLiteral (lbrace rbrace) -> `(object)
|
||||
(lbrace PropertyNameAndValueList rbrace) -> `(object ,@$2))
|
||||
(PropertyNameAndValueList (PropertyName colon AssignmentExpression) -> `((,$1 . ,$3))
|
||||
(PropertyNameAndValueList comma PropertyName colon AssignmentExpression) -> `(,@$1 (,$3 . ,$5)))
|
||||
(PropertyName (Identifier) -> `(ref ,$1)
|
||||
(StringLiteral) -> `(string ,$1)
|
||||
(NumericLiteral) -> `(number ,$1))
|
||||
(PropertyNameAndValueList (PropertyName colon AssignmentExpression) -> `((,$1 ,$3))
|
||||
(PropertyNameAndValueList comma PropertyName colon AssignmentExpression) -> `(,@$1 (,$3 ,$5)))
|
||||
(PropertyName (Identifier) -> $1
|
||||
(StringLiteral) -> (string->symbol $1)
|
||||
(NumericLiteral) -> $1)
|
||||
|
||||
(MemberExpression (PrimaryExpression) -> $1
|
||||
(FunctionExpression) -> $1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue