feat!: drop modules, general refactor and cleanup

This commit is contained in:
Christian Clason 2023-06-12 09:54:30 -06:00
parent 310f0925ec
commit 692b051b09
1247 changed files with 6096 additions and 9074 deletions

View file

@ -0,0 +1,26 @@
[
(prologue)
(select_query)
(construct_query)
(describe_query)
(ask_query)
(values_clause)
(load)
(clear)
(drop)
(add)
(move)
(copy)
(create)
(insert_data)
(delete_data)
(delete_where)
(modify)
(group_graph_pattern)
(triples_same_subject)
(where_clause)
(delete_clause)
(insert_clause)
(data_block)
(blank_node_property_list)
] @fold

View file

@ -0,0 +1,249 @@
[
(path_mod)
"||"
"&&"
"="
"<"
">"
"<="
">="
"+"
"-"
"*"
"/"
"!"
"|"
"^"
] @operator
[
"_:"
(namespace)
] @module
[
"UNDEF"
"a"
] @variable.builtin
[
"ADD"
"ALL"
"AS"
"ASC"
"ASK"
"BIND"
"BY"
"CLEAR"
"CONSTRUCT"
"COPY"
"CREATE"
"DEFAULT"
"DELETE"
"DELETE DATA"
"DELETE WHERE"
"DESC"
"DESCRIBE"
"DISTINCT"
"DROP"
"EXISTS"
"FILTER"
"FROM"
"GRAPH"
"GROUP"
"HAVING"
"INSERT"
"INSERT DATA"
"INTO"
"LIMIT"
"LOAD"
"MINUS"
"MOVE"
"NAMED"
"NOT"
"OFFSET"
"OPTIONAL"
"ORDER"
"PREFIX"
"REDUCED"
"SELECT"
"SERVICE"
"SILENT"
"UNION"
"USING"
"VALUES"
"WHERE"
"WITH"
] @keyword
(string) @string
(echar) @string.escape
(integer) @number
[
(decimal)
(double)
] @number.float
(boolean_literal) @boolean
[
"BASE"
"PREFIX"
] @keyword
[
"ABS"
"AVG"
"BNODE"
"BOUND"
"CEIL"
"CONCAT"
"COALESCE"
"CONTAINS"
"DATATYPE"
"DAY"
"ENCODE_FOR_URI"
"FLOOR"
"HOURS"
"IF"
"IRI"
"LANG"
"LANGMATCHES"
"LCASE"
"MD5"
"MINUTES"
"MONTH"
"NOW"
"RAND"
"REGEX"
"ROUND"
"SECONDS"
"SHA1"
"SHA256"
"SHA384"
"SHA512"
"STR"
"SUM"
"MAX"
"MIN"
"SAMPLE"
"GROUP_CONCAT"
"SEPARATOR"
"COUNT"
"STRAFTER"
"STRBEFORE"
"STRDT"
"STRENDS"
"STRLANG"
"STRLEN"
"STRSTARTS"
"STRUUID"
"TIMEZONE"
"TZ"
"UCASE"
"URI"
"UUID"
"YEAR"
"isBLANK"
"isIRI"
"isLITERAL"
"isNUMERIC"
"isURI"
"sameTerm"
] @function.builtin
[
"."
","
";"
] @punctuation.delimiter
[
"("
")"
"["
"]"
"{"
"}"
(nil)
(anon)
] @punctuation.bracket
[
"IN"
("NOT"
"IN")
] @keyword.operator
(comment) @comment @spell
; Could this be summarized?
(select_clause
[
bound_variable: (var)
"*"
] @variable.parameter)
(bind
bound_variable: (var) @variable.parameter)
(data_block
bound_variable: (var) @variable.parameter)
(group_condition
bound_variable: (var) @variable.parameter)
(iri_reference
[
"<"
">"
] @module)
(lang_tag) @type
(rdf_literal
"^^" @type
datatype: (_
[
"<"
">"
(namespace)
] @type) @type)
(function_call
identifier: (_) @function)
(function_call
identifier: (iri_reference
[
"<"
">"
] @function))
(function_call
identifier: (prefixed_name
(namespace) @function))
(base_declaration
(iri_reference
[
"<"
">"
] @variable))
(prefix_declaration
(iri_reference
[
"<"
">"
] @variable))
[
(var)
(blank_node_label)
(iri_reference)
(prefixed_name)
] @variable

View file

@ -0,0 +1,18 @@
[
(group_graph_pattern)
(triples_block)
(triples_template)
(construct_template)
(construct_triples)
(quads)
(data_block)
(blank_node_property_list)
(collection)
] @indent.begin
[
"}"
"]"
")"
(triples_same_subject)
] @indent.branch

View file

@ -0,0 +1,8 @@
((comment) @injection.content
(#set! injection.language "comment"))
(regex_expression
pattern: (rdf_literal
value: (string) @injection.content)
(#offset! @injection.content 0 1 0 -1)
(#set! injection.language "regex"))

View file

@ -0,0 +1,14 @@
(group_graph_pattern
(triples_block) @local.scope)
((sub_select
(select_clause
(var) @local.definition.var))
(#set! definition.var.scope "parent"))
((select_query
(select_clause
(var) @local.definition.var))
(#set! definition.var.scope "parent"))
(var) @local.reference