{ "name": "css", "rules": { "stylesheet": { "type": "REPEAT", "content": { "type": "SYMBOL", "name": "_top_level_item" } }, "_top_level_item": { "type": "CHOICE", "members": [ { "type": "SYMBOL", "name": "rule_set" }, { "type": "SYMBOL", "name": "import_statement" }, { "type": "SYMBOL", "name": "media_statement" }, { "type": "SYMBOL", "name": "charset_statement" }, { "type": "SYMBOL", "name": "at_rule" } ] }, "import_statement": { "type": "SEQ", "members": [ { "type": "STRING", "value": "@import" }, { "type": "SYMBOL", "name": "_value" }, { "type": "CHOICE", "members": [ { "type": "SEQ", "members": [ { "type": "SYMBOL", "name": "_query" }, { "type": "REPEAT", "content": { "type": "SEQ", "members": [ { "type": "STRING", "value": "," }, { "type": "SYMBOL", "name": "_query" } ] } } ] }, { "type": "BLANK" } ] }, { "type": "STRING", "value": ";" } ] }, "media_statement": { "type": "SEQ", "members": [ { "type": "STRING", "value": "@media" }, { "type": "SEQ", "members": [ { "type": "SYMBOL", "name": "_query" }, { "type": "REPEAT", "content": { "type": "SEQ", "members": [ { "type": "STRING", "value": "," }, { "type": "SYMBOL", "name": "_query" } ] } } ] }, { "type": "SYMBOL", "name": "block" } ] }, "charset_statement": { "type": "SEQ", "members": [ { "type": "STRING", "value": "@charset" }, { "type": "SYMBOL", "name": "_value" }, { "type": "STRING", "value": ";" } ] }, "at_rule": { "type": "SEQ", "members": [ { "type": "SYMBOL", "name": "at_keyword" }, { "type": "CHOICE", "members": [ { "type": "SEQ", "members": [ { "type": "SYMBOL", "name": "_query" }, { "type": "REPEAT", "content": { "type": "SEQ", "members": [ { "type": "STRING", "value": "," }, { "type": "SYMBOL", "name": "_query" } ] } } ] }, { "type": "BLANK" } ] }, { "type": "CHOICE", "members": [ { "type": "STRING", "value": ";" }, { "type": "SYMBOL", "name": "block" } ] } ] }, "rule_set": { "type": "SEQ", "members": [ { "type": "SYMBOL", "name": "selectors" }, { "type": "SYMBOL", "name": "block" } ] }, "selectors": { "type": "SEQ", "members": [ { "type": "SYMBOL", "name": "_selector" }, { "type": "REPEAT", "content": { "type": "SEQ", "members": [ { "type": "STRING", "value": "," }, { "type": "SYMBOL", "name": "_selector" } ] } } ] }, "block": { "type": "SEQ", "members": [ { "type": "STRING", "value": "{" }, { "type": "REPEAT", "content": { "type": "SYMBOL", "name": "_block_item" } }, { "type": "STRING", "value": "}" } ] }, "_block_item": { "type": "CHOICE", "members": [ { "type": "SYMBOL", "name": "declaration" }, { "type": "SYMBOL", "name": "_top_level_item" } ] }, "_selector": { "type": "CHOICE", "members": [ { "type": "SYMBOL", "name": "universal_selector" }, { "type": "ALIAS", "content": { "type": "SYMBOL", "name": "identifier" }, "named": true, "value": "tag_name" }, { "type": "SYMBOL", "name": "class_selector" }, { "type": "SYMBOL", "name": "nesting_selector" }, { "type": "SYMBOL", "name": "pseudo_class_selector" }, { "type": "SYMBOL", "name": "pseudo_element_selector" }, { "type": "SYMBOL", "name": "id_selector" }, { "type": "SYMBOL", "name": "attribute_selector" }, { "type": "SYMBOL", "name": "child_selector" }, { "type": "SYMBOL", "name": "descendant_selector" } ] }, "nesting_selector": { "type": "STRING", "value": "&" }, "universal_selector": { "type": "STRING", "value": "*" }, "class_selector": { "type": "SEQ", "members": [ { "type": "CHOICE", "members": [ { "type": "SYMBOL", "name": "_selector" }, { "type": "BLANK" } ] }, { "type": "STRING", "value": "." }, { "type": "ALIAS", "content": { "type": "SYMBOL", "name": "identifier" }, "named": true, "value": "class_name" } ] }, "pseudo_class_selector": { "type": "SEQ", "members": [ { "type": "CHOICE", "members": [ { "type": "SYMBOL", "name": "_selector" }, { "type": "BLANK" } ] }, { "type": "STRING", "value": ":" }, { "type": "ALIAS", "content": { "type": "SYMBOL", "name": "identifier" }, "named": true, "value": "class_name" }, { "type": "CHOICE", "members": [ { "type": "SYMBOL", "name": "arguments" }, { "type": "BLANK" } ] } ] }, "pseudo_element_selector": { "type": "SEQ", "members": [ { "type": "CHOICE", "members": [ { "type": "SYMBOL", "name": "_selector" }, { "type": "BLANK" } ] }, { "type": "STRING", "value": "::" }, { "type": "ALIAS", "content": { "type": "SYMBOL", "name": "identifier" }, "named": true, "value": "tag_name" } ] }, "id_selector": { "type": "SEQ", "members": [ { "type": "CHOICE", "members": [ { "type": "SYMBOL", "name": "_selector" }, { "type": "BLANK" } ] }, { "type": "STRING", "value": "#" }, { "type": "ALIAS", "content": { "type": "SYMBOL", "name": "identifier" }, "named": true, "value": "id_name" } ] }, "attribute_selector": { "type": "SEQ", "members": [ { "type": "CHOICE", "members": [ { "type": "SYMBOL", "name": "_selector" }, { "type": "BLANK" } ] }, { "type": "STRING", "value": "[" }, { "type": "ALIAS", "content": { "type": "SYMBOL", "name": "identifier" }, "named": true, "value": "attribute_name" }, { "type": "CHOICE", "members": [ { "type": "SEQ", "members": [ { "type": "CHOICE", "members": [ { "type": "STRING", "value": "=" }, { "type": "STRING", "value": "~=" }, { "type": "STRING", "value": "^=" }, { "type": "STRING", "value": "|=" }, { "type": "STRING", "value": "*=" }, { "type": "STRING", "value": "$=" } ] }, { "type": "SYMBOL", "name": "_value" } ] }, { "type": "BLANK" } ] }, { "type": "STRING", "value": "]" } ] }, "child_selector": { "type": "PREC_LEFT", "value": 0, "content": { "type": "SEQ", "members": [ { "type": "SYMBOL", "name": "_selector" }, { "type": "STRING", "value": ">" }, { "type": "SYMBOL", "name": "_selector" } ] } }, "descendant_selector": { "type": "PREC_LEFT", "value": 0, "content": { "type": "SEQ", "members": [ { "type": "SYMBOL", "name": "_selector" }, { "type": "SYMBOL", "name": "_descendant_operator" }, { "type": "SYMBOL", "name": "_selector" } ] } }, "declaration": { "type": "PREC", "value": 1, "content": { "type": "SEQ", "members": [ { "type": "ALIAS", "content": { "type": "SYMBOL", "name": "identifier" }, "named": true, "value": "property_name" }, { "type": "STRING", "value": ":" }, { "type": "SYMBOL", "name": "_value" }, { "type": "REPEAT", "content": { "type": "SEQ", "members": [ { "type": "CHOICE", "members": [ { "type": "STRING", "value": "," }, { "type": "BLANK" } ] }, { "type": "SYMBOL", "name": "_value" } ] } }, { "type": "STRING", "value": ";" } ] } }, "_query": { "type": "CHOICE", "members": [ { "type": "ALIAS", "content": { "type": "SYMBOL", "name": "identifier" }, "named": true, "value": "keyword_query" }, { "type": "SYMBOL", "name": "feature_query" }, { "type": "SYMBOL", "name": "binary_query" }, { "type": "SYMBOL", "name": "negated_query" }, { "type": "SYMBOL", "name": "parenthesized_query" } ] }, "feature_query": { "type": "SEQ", "members": [ { "type": "STRING", "value": "(" }, { "type": "ALIAS", "content": { "type": "SYMBOL", "name": "identifier" }, "named": true, "value": "feature_name" }, { "type": "STRING", "value": ":" }, { "type": "SYMBOL", "name": "_value" }, { "type": "STRING", "value": ")" } ] }, "parenthesized_query": { "type": "SEQ", "members": [ { "type": "STRING", "value": "(" }, { "type": "SYMBOL", "name": "_query" }, { "type": "STRING", "value": ")" } ] }, "binary_query": { "type": "PREC_LEFT", "value": 0, "content": { "type": "SEQ", "members": [ { "type": "SYMBOL", "name": "_query" }, { "type": "CHOICE", "members": [ { "type": "STRING", "value": "and" }, { "type": "STRING", "value": "or" } ] }, { "type": "SYMBOL", "name": "_query" } ] } }, "negated_query": { "type": "PREC", "value": 1, "content": { "type": "SEQ", "members": [ { "type": "STRING", "value": "not" }, { "type": "SYMBOL", "name": "_query" } ] } }, "_value": { "type": "CHOICE", "members": [ { "type": "ALIAS", "content": { "type": "SYMBOL", "name": "identifier" }, "named": true, "value": "keyword_value" }, { "type": "SYMBOL", "name": "color_value" }, { "type": "SYMBOL", "name": "integer_value" }, { "type": "SYMBOL", "name": "float_value" }, { "type": "SYMBOL", "name": "string_value" }, { "type": "SYMBOL", "name": "call_expression" } ] }, "color_value": { "type": "PATTERN", "value": "#[0-9a-fA-F]{3,8}" }, "string_value": { "type": "TOKEN", "content": { "type": "CHOICE", "members": [ { "type": "SEQ", "members": [ { "type": "STRING", "value": "'" }, { "type": "PATTERN", "value": "([^']|\\\\.)+" }, { "type": "STRING", "value": "'" } ] }, { "type": "SEQ", "members": [ { "type": "STRING", "value": "\"" }, { "type": "PATTERN", "value": "([^\"]|\\\\.)+" }, { "type": "STRING", "value": "\"" } ] } ] } }, "integer_value": { "type": "SEQ", "members": [ { "type": "TOKEN", "content": { "type": "SEQ", "members": [ { "type": "CHOICE", "members": [ { "type": "CHOICE", "members": [ { "type": "STRING", "value": "+" }, { "type": "STRING", "value": "-" } ] }, { "type": "BLANK" } ] }, { "type": "PATTERN", "value": "\\d+" } ] } }, { "type": "CHOICE", "members": [ { "type": "SYMBOL", "name": "unit" }, { "type": "BLANK" } ] } ] }, "float_value": { "type": "SEQ", "members": [ { "type": "TOKEN", "content": { "type": "SEQ", "members": [ { "type": "CHOICE", "members": [ { "type": "CHOICE", "members": [ { "type": "STRING", "value": "+" }, { "type": "STRING", "value": "-" } ] }, { "type": "BLANK" } ] }, { "type": "PATTERN", "value": "\\d*" }, { "type": "CHOICE", "members": [ { "type": "SEQ", "members": [ { "type": "STRING", "value": "." }, { "type": "PATTERN", "value": "\\d+" } ] }, { "type": "SEQ", "members": [ { "type": "STRING", "value": "e" }, { "type": "CHOICE", "members": [ { "type": "STRING", "value": "-" }, { "type": "BLANK" } ] }, { "type": "PATTERN", "value": "\\d+" } ] }, { "type": "SEQ", "members": [ { "type": "STRING", "value": "." }, { "type": "PATTERN", "value": "\\d+" }, { "type": "STRING", "value": "e" }, { "type": "CHOICE", "members": [ { "type": "STRING", "value": "-" }, { "type": "BLANK" } ] }, { "type": "PATTERN", "value": "\\d+" } ] } ] } ] } }, { "type": "CHOICE", "members": [ { "type": "SYMBOL", "name": "unit" }, { "type": "BLANK" } ] } ] }, "unit": { "type": "IMMEDIATE_TOKEN", "content": { "type": "PATTERN", "value": "[a-z]+" } }, "call_expression": { "type": "SEQ", "members": [ { "type": "ALIAS", "content": { "type": "SYMBOL", "name": "identifier" }, "named": true, "value": "function_name" }, { "type": "SYMBOL", "name": "arguments" } ] }, "arguments": { "type": "SEQ", "members": [ { "type": "IMMEDIATE_TOKEN", "content": { "type": "STRING", "value": "(" } }, { "type": "CHOICE", "members": [ { "type": "SEQ", "members": [ { "type": "SYMBOL", "name": "_value" }, { "type": "REPEAT", "content": { "type": "SEQ", "members": [ { "type": "STRING", "value": "," }, { "type": "SYMBOL", "name": "_value" } ] } } ] }, { "type": "BLANK" } ] }, { "type": "STRING", "value": ")" } ] }, "identifier": { "type": "PATTERN", "value": "[a-zA-Z-_]+" }, "at_keyword": { "type": "PATTERN", "value": "@[a-zA-Z-_]+" }, "comment": { "type": "TOKEN", "content": { "type": "CHOICE", "members": [ { "type": "SEQ", "members": [ { "type": "STRING", "value": "//" }, { "type": "PATTERN", "value": ".*" } ] }, { "type": "SEQ", "members": [ { "type": "STRING", "value": "/*" }, { "type": "PATTERN", "value": "[^*]*\\*+([^\\/*][^*]*\\*+)*" }, { "type": "STRING", "value": "/" } ] } ] } } }, "extras": [ { "type": "PATTERN", "value": "\\s" }, { "type": "SYMBOL", "name": "comment" } ], "conflicts": [], "externals": [ { "type": "SYMBOL", "name": "_descendant_operator" } ], "inline": [ "_top_level_item", "_block_item" ] }