From 5ad1bc2add22232d6f42536ec01f61a1d08d4d06 Mon Sep 17 00:00:00 2001 From: David Majda Date: Thu, 1 Sep 2016 15:36:24 +0200 Subject: [PATCH] CSS example: Switch from first/rest to head/tail Follow-up to e510ecc3d01103b61b504128cee5341dd8c4e005. --- examples/css.pegjs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/examples/css.pegjs b/examples/css.pegjs index 0a6895d..cbe64e7 100644 --- a/examples/css.pegjs +++ b/examples/css.pegjs @@ -91,14 +91,14 @@ medium page = PAGE_SYM S* selector:pseudo_page? "{" S* - declarationsFirst:declaration? - declarationsRest:(";" S* declaration?)* + declarationsHead:declaration? + declarationsTail:(";" S* declaration?)* "}" S* { return { type: "PageRule", selector: selector, - declarations: buildList(declarationsFirst, declarationsRest, 2) + declarations: buildList(declarationsHead, declarationsTail, 2) }; } @@ -117,17 +117,17 @@ property = name:IDENT S* { return name; } ruleset - = selectorsFirst:selector - selectorsRest:("," S* selector)* + = selectorsHead:selector + selectorsTail:("," S* selector)* "{" S* - declarationsFirst:declaration? - declarationsRest:(";" S* declaration?)* + declarationsHead:declaration? + declarationsTail:(";" S* declaration?)* "}" S* { return { type: "RuleSet", - selectors: buildList(selectorsFirst, selectorsRest, 2), - declarations: buildList(declarationsFirst, declarationsRest, 2) + selectors: buildList(selectorsHead, selectorsTail, 2), + declarations: buildList(declarationsHead, declarationsTail, 2) }; }