Allow function arguments to consist of multiple values

This commit is contained in:
Max Brunsfeld 2018-10-26 11:49:08 -07:00
parent 2659e00a88
commit eb66c5abb4
4 changed files with 1530 additions and 1352 deletions

View File

@ -20,6 +20,45 @@ a {
(integer_value)
(float_value)))))))
=============================================
Calls where each argument has multiple values
=============================================
div {
background: repeating-linear-gradient(red, orange 50px);
clip-path: polygon(50% 0%, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0% 50%, 40% 40%);
}
---
(stylesheet
(rule_set (selectors (tag_name)) (block
(declaration
(property_name)
(call_expression (function_name) (arguments
(plain_value)
(plain_value)
(integer_value (unit)))))
(declaration
(property_name)
(call_expression (function_name) (arguments
(integer_value (unit))
(integer_value (unit))
(integer_value (unit))
(integer_value (unit))
(integer_value (unit))
(integer_value (unit))
(integer_value (unit))
(integer_value (unit))
(integer_value (unit))
(integer_value (unit))
(integer_value (unit))
(integer_value (unit))
(integer_value (unit))
(integer_value (unit))
(integer_value (unit))
(integer_value (unit))))))))
============================
Color literals
============================

View File

@ -244,7 +244,7 @@ module.exports = grammar({
arguments: $ => seq(
token.immediate('('),
commaSep($._value),
commaSep(repeat1($._value)),
')'
),

6
src/grammar.json vendored
View File

@ -1165,8 +1165,11 @@
"type": "SEQ",
"members": [
{
"type": "REPEAT1",
"content": {
"type": "SYMBOL",
"name": "_value"
}
},
{
"type": "REPEAT",
@ -1178,9 +1181,12 @@
"value": ","
},
{
"type": "REPEAT1",
"content": {
"type": "SYMBOL",
"name": "_value"
}
}
]
}
}

2827
src/parser.c vendored

File diff suppressed because it is too large Load Diff