From f792eb996df0acc0bb51c535fa4ab3a7b8908db6 Mon Sep 17 00:00:00 2001 From: Linus Eriksson Date: Mon, 15 Oct 2018 22:39:08 +0200 Subject: [PATCH] Add more syntax --- grammars/tree-sitter-php.cson | 67 +++++++++++++++++++++++++++++++++-- 1 file changed, 65 insertions(+), 2 deletions(-) diff --git a/grammars/tree-sitter-php.cson b/grammars/tree-sitter-php.cson index 6fb11aba..63f845e7 100644 --- a/grammars/tree-sitter-php.cson +++ b/grammars/tree-sitter-php.cson @@ -24,6 +24,14 @@ folds: [ scopes: '"echo"': 'support.function' + '"print"': 'support.function' + '"unset"': 'support.function' + '"isset"': 'support.function' + '"list"': 'support.function' + '"eval"': 'support.function' + '"array"': 'support.function' + '"list"': 'support.function' + '"empty"': 'support.function' 'string': 'string.quoted' 'float': 'constant.numeric' @@ -33,9 +41,11 @@ scopes: 'program': 'source.php' 'ERROR': 'syntax-error' + 'class_declaration > name': 'entity.name.type.class' + 'class_base_clause > qualified_name > name': 'entity.other.inherited-class' - 'class_declaration > name': 'support.storage.type' - 'class_base_clause > qualified_name > name': 'storage.modifier.extends.php' + 'interface_declaration > name': 'entity.name.type.interface' + 'class_interface_clause > qualified_name > name': 'entity.other.implemented-interface' 'function_definition > name': 'entity.name.function' 'function_call_expression > name': 'entity.name.function' @@ -64,14 +74,63 @@ scopes: '"public"': 'storage.modifier' '"private"': 'storage.modifier' '"protected"': 'storage.modifier' + '"global"': 'storage.modifier' + '"const"': 'storage.modifier' + '"abstract"': 'storage.modifier.abstract' + '"extends"': 'storage.modifier.extends' + '"implements"': 'storage.modifier.implements' + '"final"': 'storage.modifier.final' + '"use"': 'keyword.other.use' + '"namespace"': 'keyword.other.namespace' + '"callable"': 'storage.type' + '"var"': 'storage.type' + '"trait"': 'storage.type.trait' '"class"': 'storage.type.class' + '"interface"': 'storage.type.interface' '"function"': 'storage.type.function' '"type"': 'storage.type.type' + 'cast_expression > cast_type': 'storage.type.cast' '"+"': 'keyword.operator' '"-"': 'keyword.operator' '"*"': 'keyword.operator' '"/"': 'keyword.operator' + '"%"': 'keyword.operator' + '"**"': 'keyword.operator' + '"=="': 'keyword.operator' + '"==="': 'keyword.operator' + '"!="': 'keyword.operator' + '"!="': 'keyword.operator' + '"!=="': 'keyword.operator' + '"<"': 'keyword.operator' + '">"': 'keyword.operator' + '"<>"': 'keyword.operator' + '"<="': 'keyword.operator' + '">="': 'keyword.operator' + '"<=>"': 'keyword.operator' + '"&"': 'keyword.operator' + '"|"': 'keyword.operator' + '"^"': 'keyword.operator' + '"~"': 'keyword.opeator' + '"<<"': 'keyword.operator' + '">>"': 'keyword.operator' + '"++"': 'keyword.operator' + '"--"': 'keyword.operator' + '"and"': 'keyword.operator' + '"or"': 'keyword.operator' + '"xor"': 'keyword.operator' + '"!"': 'keyword.operator' + '"&&"': 'keyword.operator' + '"||"': 'keyword.operator' + '"."': 'keyword.operator' + '"?"': 'keyword.operator' + '":"': 'keyword.operator' + '"??"': 'keyword.operator' + '"as"': 'keyword.operator.logical' + '"new"': 'keyword.other.new' + '"clone"': 'keyword.other.clone' + '"insteadof"': 'keyword.other.insteadof' + '"instanceof"': 'keyword.operator.type' '"."': 'meta.delimiter.property.period' '","': 'meta.delimiter.object.comma' @@ -100,3 +159,7 @@ scopes: '"endswitch"': 'keyword.control' '"case"': 'keyword.control' '"default"': 'keyword.control' + '"yield"': 'keyword.control.yield' + '"goto"': 'keyword.control.goto' + '"exit"': 'keyword.control.exit' + '"die"': 'keyword.control.die'