From 7202a501364ce3ac2bfe0265b4adb571c5c519d4 Mon Sep 17 00:00:00 2001 From: Michael Chirico Date: Thu, 28 Sep 2023 16:09:30 +0000 Subject: [PATCH 1/2] apply change from vscode --- syntax/r.json | 1287 ++++++++++++++++++++++++------------------------- 1 file changed, 641 insertions(+), 646 deletions(-) diff --git a/syntax/r.json b/syntax/r.json index 9c49a8af8..90df4dedb 100644 --- a/syntax/r.json +++ b/syntax/r.json @@ -1,647 +1,642 @@ { - "fileTypes": [ - "R", - "r", - "S", - "s", - "Rprofile" - ], - "foldingStartMarker": "(\\(\\s*$|\\{\\s*$)", - "foldingStopMarker": "(^\\s*\\)|^\\s*\\})", - "keyEquivalent": "^~R", - "name": "R", - "patterns": [ - { - "include": "#roxygen" - }, - { - "include": "#comments" - }, - { - "include": "#constants" - }, - { - "include": "#keywords" - }, - { - "include": "#storage-type" - }, - { - "include": "#strings" - }, - { - "include": "#brackets" - }, - { - "include": "#function-declarations" - }, - { - "include": "#lambda-functions" - }, - { - "include": "#builtin-functions" - }, - { - "include": "#function-calls" - }, - { - "include": "#general-variables" - } - ], - "repository": { - "comments": { - "patterns": [ - { - "captures": { - "1": { - "name": "comment.line.pragma.r" - }, - "2": { - "name": "entity.name.pragma.name.r" - } - }, - "match": "^(#pragma[ \\t]+mark)[ \\t](.*)", - "name": "comment.line.pragma-mark.r" - }, - { - "begin": "(^[ \\t]+)?(?=#)", - "beginCaptures": { - "1": { - "name": "punctuation.whitespace.comment.leading.r" - } - }, - "end": "(?!\\G)", - "patterns": [ - { - "begin": "#", - "beginCaptures": { - "0": { - "name": "punctuation.definition.comment.r" - } - }, - "end": "\\n", - "name": "comment.line.number-sign.r" - } - ] - } - ] - }, - "constants": { - "patterns": [ - { - "match": "\\b(pi|letters|LETTERS|month\\.abb|month\\.name)\\b", - "name": "support.constant.misc.r" - }, - { - "match": "\\b(TRUE|FALSE|NULL|NA|NA_integer_|NA_real_|NA_complex_|NA_character_|Inf|NaN)\\b", - "name": "constant.language.r" - }, - { - "match": "\\b0(x|X)[0-9a-fA-F]+i\\b", - "name": "constant.numeric.imaginary.hexadecimal.r" - }, - { - "match": "\\b[0-9]+\\.?[0-9]*(?:(e|E)(\\+|-)?[0-9]+)?i\\b", - "name": "constant.numeric.imaginary.decimal.r" - }, - { - "match": "\\.[0-9]+(?:(e|E)(\\+|-)?[0-9]+)?i\\b", - "name": "constant.numeric.imaginary.decimal.r" - }, - { - "match": "\\b0(x|X)[0-9a-fA-F]+L\\b", - "name": "constant.numeric.integer.hexadecimal.r" - }, - { - "match": "\\b(?:[0-9]+\\.?[0-9]*)(?:(e|E)(\\+|-)?[0-9]+)?L\\b", - "name": "constant.numeric.integer.decimal.r" - }, - { - "match": "\\b0(x|X)[0-9a-fA-F]+\\b", - "name": "constant.numeric.float.hexadecimal.r" - }, - { - "match": "\\b[0-9]+\\.?[0-9]*(?:(e|E)(\\+|-)?[0-9]+)?\\b", - "name": "constant.numeric.float.decimal.r" - }, - { - "match": "\\.[0-9]+(?:(e|E)(\\+|-)?[0-9]+)?\\b", - "name": "constant.numeric.float.decimal.r" - } - ] - }, - "general-variables": { - "patterns": [ - { - "captures": { - "1": { - "name": "variable.parameter.r" - }, - "2": { - "name": "keyword.operator.assignment.r" - } - }, - "match": "([[:alpha:].][[:alnum:]._]*)\\s*(=)(?=[^=])" - }, - { - "captures": { - "1": { - "name": "variable.parameter.r" - }, - "2": { - "name": "keyword.operator.assignment.r" - } - }, - "match": "(`[^`]+`)\\s*(=)(?=[^=])" - }, - { - "match": "\\b([\\d_][[:alnum:]._]+)\\b", - "name": "invalid.illegal.variable.other.r" - }, - { - "match": "\\b([[:alnum:]_]+)(?=::)", - "name": "entity.namespace.r" - }, - { - "match": "\\b([[:alnum:]._]+)\\b", - "name": "variable.other.r" - }, - { - "match": "(`[^`]+`)", - "name": "variable.other.r" - } - ] - }, - "keywords": { - "patterns": [ - { - "match": "\\b(break|next|repeat|else|in)\\b", - "name": "keyword.control.r" - }, - { - "match": "\\b(ifelse|if|for|return|switch|while|invisible)\\b(?=\\s*\\()", - "name": "keyword.control.r" - }, - { - "match": "(\\-|\\+|\\*|\\/|%\\/%|%%|%\\*%|%o%|%x%|\\^)", - "name": "keyword.operator.arithmetic.r" - }, - { - "match": "(:=|<-|<<-|->|->>)", - "name": "keyword.operator.assignment.r" - }, - { - "match": "(==|<=|>=|!=|<>|<|>|%in%)", - "name": "keyword.operator.comparison.r" - }, - { - "match": "(!|&{1,2}|[|]{1,2})", - "name": "keyword.operator.logical.r" - }, - { - "match": "(\\|>)", - "name": "keyword.operator.pipe.r" - }, - { - "match": "(%between%|%chin%|%like%|%\\+%|%\\+replace%|%:%|%do%|%dopar%|%>%|%<>%|%T>%|%\\$%)", - "name": "keyword.operator.other.r" - }, - { - "match": "(\\.\\.\\.|\\$|:|\\~|@)", - "name": "keyword.other.r" - } - ] - }, - "storage-type": { - "patterns": [ - { - "match": "\\b(character|complex|double|expression|integer|list|logical|numeric|single|raw)\\b(?=\\s*\\()", - "name": "storage.type.r" - } - ] - }, - "strings": { - "patterns": [ - { - "begin": "[rR]\"(-*)\\[", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.raw.begin.r" - } - }, - "end": "\\]\\1\"", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.raw.end.r" - } - }, - "name": "string.quoted.double.raw.r" - }, - { - "begin": "[rR]'(-*)\\[", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.raw.begin.r" - } - }, - "end": "\\]\\1'", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.raw.end.r" - } - }, - "name": "string.quoted.single.raw.r" - }, - { - "begin": "[rR]\"(-*)\\{", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.raw.begin.r" - } - }, - "end": "\\}\\1\"", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.raw.end.r" - } - }, - "name": "string.quoted.double.raw.r" - }, - { - "begin": "[rR]'(-*)\\{", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.raw.begin.r" - } - }, - "end": "\\}\\1'", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.raw.end.r" - } - }, - "name": "string.quoted.single.raw.r" - }, - { - "begin": "[rR]\"(-*)\\(", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.raw.begin.r" - } - }, - "end": "\\)\\1\"", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.raw.end.r" - } - }, - "name": "string.quoted.double.raw.r" - }, - { - "begin": "[rR]'(-*)\\(", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.raw.begin.r" - } - }, - "end": "\\)\\1'", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.raw.end.r" - } - }, - "name": "string.quoted.single.raw.r" - }, - { - "begin": "\"", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.begin.r" - } - }, - "end": "\"", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.end.r" - } - }, - "name": "string.quoted.double.r", - "patterns": [ - { - "match": "\\\\.", - "name": "constant.character.escape.r" - } - ] - }, - { - "begin": "'", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.begin.r" - } - }, - "end": "'", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.end.r" - } - }, - "name": "string.quoted.single.r", - "patterns": [ - { - "match": "\\\\.", - "name": "constant.character.escape.r" - } - ] - } - ] - }, - "brackets": { - "patterns": [ - { - "begin": "\\(", - "beginCaptures": { - "0": { - "name": "punctuation.section.parens.begin.r" - } - }, - "end": "\\)", - "endCaptures": { - "0": { - "name": "punctuation.section.parens.end.r" - } - }, - "patterns": [ - { - "include": "source.r" - } - ] - }, - { - "begin": "\\[(?!\\[)", - "beginCaptures": { - "0": { - "name": "punctuation.section.brackets.single.begin.r" - } - }, - "end": "\\]", - "endCaptures": { - "0": { - "name": "punctuation.section.brackets.single.end.r" - } - }, - "patterns": [ - { - "include": "source.r" - } - ] - }, - { - "begin": "\\[\\[", - "beginCaptures": { - "0": { - "name": "punctuation.section.brackets.double.begin.r" - } - }, - "end": "\\]\\]", - "endCaptures": { - "0": { - "name": "punctuation.section.brackets.double.end.r" - } - }, - "contentName": "meta.item-access.arguments.r", - "patterns": [ - { - "include": "source.r" - } - ] - }, - { - "begin": "\\{", - "beginCaptures": { - "0": { - "name": "punctuation.section.braces.begin.r" - } - }, - "end": "\\}", - "endCaptures": { - "0": { - "name": "punctuation.section.braces.end.r" - } - }, - "patterns": [ - { - "include": "source.r" - } - ] - } - ] - }, - "function-declarations": { - "patterns": [ - { - "match": "((?:`[^`\\\\]*(?:\\\\.[^`\\\\]*)*`)|(?:[[:alpha:].][[:alnum:]._]*))\\s*(|->>)", + "name": "keyword.operator.assignment.r" + }, + { + "match": "(==|<=|>=|!=|<>|<|>|%in%)", + "name": "keyword.operator.comparison.r" + }, + { + "match": "(!|&{1,2}|[|]{1,2})", + "name": "keyword.operator.logical.r" + }, + { + "match": "(\\|>)", + "name": "keyword.operator.pipe.r" + }, + { + "match": "(%between%|%chin%|%like%|%\\+%|%\\+replace%|%:%|%do%|%dopar%|%>%|%<>%|%T>%|%\\$%)", + "name": "keyword.operator.other.r" + }, + { + "match": "(\\.\\.\\.|\\$|:|\\~|@)", + "name": "keyword.other.r" + } + ] + }, + "storage-type": { + "patterns": [ + { + "match": "\\b(character|complex|double|expression|integer|list|logical|numeric|single|raw)\\b(?=\\s*\\()", + "name": "storage.type.r" + } + ] + }, + "strings": { + "patterns": [ + { + "begin": "[rR]\"(-*)\\[", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.raw.begin.r" + } + }, + "end": "\\]\\1\"", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.raw.end.r" + } + }, + "name": "string.quoted.double.raw.r" + }, + { + "begin": "[rR]'(-*)\\[", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.raw.begin.r" + } + }, + "end": "\\]\\1'", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.raw.end.r" + } + }, + "name": "string.quoted.single.raw.r" + }, + { + "begin": "[rR]\"(-*)\\{", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.raw.begin.r" + } + }, + "end": "\\}\\1\"", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.raw.end.r" + } + }, + "name": "string.quoted.double.raw.r" + }, + { + "begin": "[rR]'(-*)\\{", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.raw.begin.r" + } + }, + "end": "\\}\\1'", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.raw.end.r" + } + }, + "name": "string.quoted.single.raw.r" + }, + { + "begin": "[rR]\"(-*)\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.raw.begin.r" + } + }, + "end": "\\)\\1\"", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.raw.end.r" + } + }, + "name": "string.quoted.double.raw.r" + }, + { + "begin": "[rR]'(-*)\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.raw.begin.r" + } + }, + "end": "\\)\\1'", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.raw.end.r" + } + }, + "name": "string.quoted.single.raw.r" + }, + { + "begin": "\"", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.r" + } + }, + "end": "\"", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.r" + } + }, + "name": "string.quoted.double.r", + "patterns": [ + { + "match": "\\\\.", + "name": "constant.character.escape.r" + } + ] + }, + { + "begin": "'", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.r" + } + }, + "end": "'", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.r" + } + }, + "name": "string.quoted.single.r", + "patterns": [ + { + "match": "\\\\.", + "name": "constant.character.escape.r" + } + ] + } + ] + }, + "brackets": { + "patterns": [ + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.section.parens.begin.r" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.section.parens.end.r" + } + }, + "patterns": [ + { + "include": "source.r" + } + ] + }, + { + "begin": "\\[(?!\\[)", + "beginCaptures": { + "0": { + "name": "punctuation.section.brackets.single.begin.r" + } + }, + "end": "\\]", + "endCaptures": { + "0": { + "name": "punctuation.section.brackets.single.end.r" + } + }, + "patterns": [ + { + "include": "source.r" + } + ] + }, + { + "begin": "\\[\\[", + "beginCaptures": { + "0": { + "name": "punctuation.section.brackets.double.begin.r" + } + }, + "end": "\\]\\]", + "endCaptures": { + "0": { + "name": "punctuation.section.brackets.double.end.r" + } + }, + "contentName": "meta.item-access.arguments.r", + "patterns": [ + { + "include": "source.r" + } + ] + }, + { + "begin": "\\{", + "beginCaptures": { + "0": { + "name": "punctuation.section.braces.begin.r" + } + }, + "end": "\\}", + "endCaptures": { + "0": { + "name": "punctuation.section.braces.end.r" + } + }, + "patterns": [ + { + "include": "source.r" + } + ] + } + ] + }, + "function-declarations": { + "patterns": [ + { + "match": "((?:`[^`\\\\]*(?:\\\\.[^`\\\\]*)*`)|(?:[[:alpha:].][[:alnum:]._]*))\\s*( Date: Thu, 28 Sep 2023 16:13:17 +0000 Subject: [PATCH 2/2] restart from new formatting --- syntax/r.json | 1287 +++++++++++++++++++++++++------------------------ 1 file changed, 646 insertions(+), 641 deletions(-) diff --git a/syntax/r.json b/syntax/r.json index 90df4dedb..b6fdf5cb4 100644 --- a/syntax/r.json +++ b/syntax/r.json @@ -1,642 +1,647 @@ { - "information_for_contributors": [ - "This file has been converted from https://github.com/Ikuyadeu/vscode-R/blob/master/syntax/r.json", - "If you want to provide a fix or improvement, please create a pull request against the original repository.", - "Once accepted there, we are happy to receive an update request." - ], - "version": "https://github.com/Ikuyadeu/vscode-R/commit/ff60e426f66503f3c9533c7a62a8fd3f9f6c53df", - "name": "R", - "scopeName": "source.r", - "patterns": [ - { - "include": "#roxygen" - }, - { - "include": "#comments" - }, - { - "include": "#constants" - }, - { - "include": "#keywords" - }, - { - "include": "#storage-type" - }, - { - "include": "#strings" - }, - { - "include": "#brackets" - }, - { - "include": "#function-declarations" - }, - { - "include": "#lambda-functions" - }, - { - "include": "#builtin-functions" - }, - { - "include": "#function-calls" - }, - { - "include": "#general-variables" - } - ], - "repository": { - "comments": { - "patterns": [ - { - "captures": { - "1": { - "name": "comment.line.pragma.r" - }, - "2": { - "name": "entity.name.pragma.name.r" - } - }, - "match": "^(#pragma[ \\t]+mark)[ \\t](.*)", - "name": "comment.line.pragma-mark.r" - }, - { - "begin": "(^[ \\t]+)?(?=#)", - "beginCaptures": { - "1": { - "name": "punctuation.whitespace.comment.leading.r" - } - }, - "end": "(?!\\G)", - "patterns": [ - { - "begin": "#", - "beginCaptures": { - "0": { - "name": "punctuation.definition.comment.r" - } - }, - "end": "\\n", - "name": "comment.line.number-sign.r" - } - ] - } - ] - }, - "constants": { - "patterns": [ - { - "match": "\\b(pi|letters|LETTERS|month\\.abb|month\\.name)\\b", - "name": "support.constant.misc.r" - }, - { - "match": "\\b(TRUE|FALSE|NULL|NA|NA_integer_|NA_real_|NA_complex_|NA_character_|Inf|NaN)\\b", - "name": "constant.language.r" - }, - { - "match": "\\b0(x|X)[0-9a-fA-F]+i\\b", - "name": "constant.numeric.imaginary.hexadecimal.r" - }, - { - "match": "\\b[0-9]+\\.?[0-9]*(?:(e|E)(\\+|-)?[0-9]+)?i\\b", - "name": "constant.numeric.imaginary.decimal.r" - }, - { - "match": "\\.[0-9]+(?:(e|E)(\\+|-)?[0-9]+)?i\\b", - "name": "constant.numeric.imaginary.decimal.r" - }, - { - "match": "\\b0(x|X)[0-9a-fA-F]+L\\b", - "name": "constant.numeric.integer.hexadecimal.r" - }, - { - "match": "\\b(?:[0-9]+\\.?[0-9]*)(?:(e|E)(\\+|-)?[0-9]+)?L\\b", - "name": "constant.numeric.integer.decimal.r" - }, - { - "match": "\\b0(x|X)[0-9a-fA-F]+\\b", - "name": "constant.numeric.float.hexadecimal.r" - }, - { - "match": "\\b[0-9]+\\.?[0-9]*(?:(e|E)(\\+|-)?[0-9]+)?\\b", - "name": "constant.numeric.float.decimal.r" - }, - { - "match": "\\.[0-9]+(?:(e|E)(\\+|-)?[0-9]+)?\\b", - "name": "constant.numeric.float.decimal.r" - } - ] - }, - "general-variables": { - "patterns": [ - { - "captures": { - "1": { - "name": "variable.parameter.r" - }, - "2": { - "name": "keyword.operator.assignment.r" - } - }, - "match": "([[:alpha:].][[:alnum:]._]*)\\s*(=)(?=[^=])" - }, - { - "captures": { - "1": { - "name": "variable.parameter.r" - }, - "2": { - "name": "keyword.operator.assignment.r" - } - }, - "match": "(`[^`]+`)\\s*(=)(?=[^=])" - }, - { - "match": "\\b([\\d_][[:alnum:]._]+)\\b", - "name": "invalid.illegal.variable.other.r" - }, - { - "match": "\\b([[:alnum:]_]+)(?=::)", - "name": "entity.namespace.r" - }, - { - "match": "\\b([[:alnum:]._]+)\\b", - "name": "variable.other.r" - }, - { - "match": "(`[^`]+`)", - "name": "variable.other.r" - } - ] - }, - "keywords": { - "patterns": [ - { - "match": "\\b(break|next|repeat|else|in)\\b", - "name": "keyword.control.r" - }, - { - "match": "\\b(ifelse|if|for|return|switch|while|invisible)\\b(?=\\s*\\()", - "name": "keyword.control.r" - }, - { - "match": "(\\-|\\+|\\*|\\/|%\\/%|%%|%\\*%|%o%|%x%|\\^)", - "name": "keyword.operator.arithmetic.r" - }, - { - "match": "(:=|<-|<<-|->|->>)", - "name": "keyword.operator.assignment.r" - }, - { - "match": "(==|<=|>=|!=|<>|<|>|%in%)", - "name": "keyword.operator.comparison.r" - }, - { - "match": "(!|&{1,2}|[|]{1,2})", - "name": "keyword.operator.logical.r" - }, - { - "match": "(\\|>)", - "name": "keyword.operator.pipe.r" - }, - { - "match": "(%between%|%chin%|%like%|%\\+%|%\\+replace%|%:%|%do%|%dopar%|%>%|%<>%|%T>%|%\\$%)", - "name": "keyword.operator.other.r" - }, - { - "match": "(\\.\\.\\.|\\$|:|\\~|@)", - "name": "keyword.other.r" - } - ] - }, - "storage-type": { - "patterns": [ - { - "match": "\\b(character|complex|double|expression|integer|list|logical|numeric|single|raw)\\b(?=\\s*\\()", - "name": "storage.type.r" - } - ] - }, - "strings": { - "patterns": [ - { - "begin": "[rR]\"(-*)\\[", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.raw.begin.r" - } - }, - "end": "\\]\\1\"", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.raw.end.r" - } - }, - "name": "string.quoted.double.raw.r" - }, - { - "begin": "[rR]'(-*)\\[", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.raw.begin.r" - } - }, - "end": "\\]\\1'", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.raw.end.r" - } - }, - "name": "string.quoted.single.raw.r" - }, - { - "begin": "[rR]\"(-*)\\{", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.raw.begin.r" - } - }, - "end": "\\}\\1\"", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.raw.end.r" - } - }, - "name": "string.quoted.double.raw.r" - }, - { - "begin": "[rR]'(-*)\\{", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.raw.begin.r" - } - }, - "end": "\\}\\1'", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.raw.end.r" - } - }, - "name": "string.quoted.single.raw.r" - }, - { - "begin": "[rR]\"(-*)\\(", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.raw.begin.r" - } - }, - "end": "\\)\\1\"", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.raw.end.r" - } - }, - "name": "string.quoted.double.raw.r" - }, - { - "begin": "[rR]'(-*)\\(", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.raw.begin.r" - } - }, - "end": "\\)\\1'", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.raw.end.r" - } - }, - "name": "string.quoted.single.raw.r" - }, - { - "begin": "\"", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.begin.r" - } - }, - "end": "\"", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.end.r" - } - }, - "name": "string.quoted.double.r", - "patterns": [ - { - "match": "\\\\.", - "name": "constant.character.escape.r" - } - ] - }, - { - "begin": "'", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.begin.r" - } - }, - "end": "'", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.end.r" - } - }, - "name": "string.quoted.single.r", - "patterns": [ - { - "match": "\\\\.", - "name": "constant.character.escape.r" - } - ] - } - ] - }, - "brackets": { - "patterns": [ - { - "begin": "\\(", - "beginCaptures": { - "0": { - "name": "punctuation.section.parens.begin.r" - } - }, - "end": "\\)", - "endCaptures": { - "0": { - "name": "punctuation.section.parens.end.r" - } - }, - "patterns": [ - { - "include": "source.r" - } - ] - }, - { - "begin": "\\[(?!\\[)", - "beginCaptures": { - "0": { - "name": "punctuation.section.brackets.single.begin.r" - } - }, - "end": "\\]", - "endCaptures": { - "0": { - "name": "punctuation.section.brackets.single.end.r" - } - }, - "patterns": [ - { - "include": "source.r" - } - ] - }, - { - "begin": "\\[\\[", - "beginCaptures": { - "0": { - "name": "punctuation.section.brackets.double.begin.r" - } - }, - "end": "\\]\\]", - "endCaptures": { - "0": { - "name": "punctuation.section.brackets.double.end.r" - } - }, - "contentName": "meta.item-access.arguments.r", - "patterns": [ - { - "include": "source.r" - } - ] - }, - { - "begin": "\\{", - "beginCaptures": { - "0": { - "name": "punctuation.section.braces.begin.r" - } - }, - "end": "\\}", - "endCaptures": { - "0": { - "name": "punctuation.section.braces.end.r" - } - }, - "patterns": [ - { - "include": "source.r" - } - ] - } - ] - }, - "function-declarations": { - "patterns": [ - { - "match": "((?:`[^`\\\\]*(?:\\\\.[^`\\\\]*)*`)|(?:[[:alpha:].][[:alnum:]._]*))\\s*(|->>)", + "name": "keyword.operator.assignment.r" + }, + { + "match": "(==|<=|>=|!=|<>|<|>|%in%)", + "name": "keyword.operator.comparison.r" + }, + { + "match": "(!|&{1,2}|[|]{1,2})", + "name": "keyword.operator.logical.r" + }, + { + "match": "(\\|>)", + "name": "keyword.operator.pipe.r" + }, + { + "match": "(%between%|%chin%|%like%|%\\+%|%\\+replace%|%:%|%do%|%dopar%|%>%|%<>%|%T>%|%\\$%)", + "name": "keyword.operator.other.r" + }, + { + "match": "(\\.\\.\\.|\\$|:|\\~|@)", + "name": "keyword.other.r" + } + ] + }, + "storage-type": { + "patterns": [ + { + "match": "\\b(character|complex|double|expression|integer|list|logical|numeric|single|raw)\\b(?=\\s*\\()", + "name": "storage.type.r" + } + ] + }, + "strings": { + "patterns": [ + { + "begin": "[rR]\"(-*)\\[", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.raw.begin.r" + } + }, + "end": "\\]\\1\"", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.raw.end.r" + } + }, + "name": "string.quoted.double.raw.r" + }, + { + "begin": "[rR]'(-*)\\[", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.raw.begin.r" + } + }, + "end": "\\]\\1'", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.raw.end.r" + } + }, + "name": "string.quoted.single.raw.r" + }, + { + "begin": "[rR]\"(-*)\\{", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.raw.begin.r" + } + }, + "end": "\\}\\1\"", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.raw.end.r" + } + }, + "name": "string.quoted.double.raw.r" + }, + { + "begin": "[rR]'(-*)\\{", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.raw.begin.r" + } + }, + "end": "\\}\\1'", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.raw.end.r" + } + }, + "name": "string.quoted.single.raw.r" + }, + { + "begin": "[rR]\"(-*)\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.raw.begin.r" + } + }, + "end": "\\)\\1\"", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.raw.end.r" + } + }, + "name": "string.quoted.double.raw.r" + }, + { + "begin": "[rR]'(-*)\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.raw.begin.r" + } + }, + "end": "\\)\\1'", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.raw.end.r" + } + }, + "name": "string.quoted.single.raw.r" + }, + { + "begin": "\"", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.r" + } + }, + "end": "\"", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.r" + } + }, + "name": "string.quoted.double.r", + "patterns": [ + { + "match": "\\\\.", + "name": "constant.character.escape.r" + } + ] + }, + { + "begin": "'", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.r" + } + }, + "end": "'", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.r" + } + }, + "name": "string.quoted.single.r", + "patterns": [ + { + "match": "\\\\.", + "name": "constant.character.escape.r" + } + ] + } + ] + }, + "brackets": { + "patterns": [ + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.section.parens.begin.r" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.section.parens.end.r" + } + }, + "patterns": [ + { + "include": "source.r" + } + ] + }, + { + "begin": "\\[(?!\\[)", + "beginCaptures": { + "0": { + "name": "punctuation.section.brackets.single.begin.r" + } + }, + "end": "\\]", + "endCaptures": { + "0": { + "name": "punctuation.section.brackets.single.end.r" + } + }, + "patterns": [ + { + "include": "source.r" + } + ] + }, + { + "begin": "\\[\\[", + "beginCaptures": { + "0": { + "name": "punctuation.section.brackets.double.begin.r" + } + }, + "end": "\\]\\]", + "endCaptures": { + "0": { + "name": "punctuation.section.brackets.double.end.r" + } + }, + "contentName": "meta.item-access.arguments.r", + "patterns": [ + { + "include": "source.r" + } + ] + }, + { + "begin": "\\{", + "beginCaptures": { + "0": { + "name": "punctuation.section.braces.begin.r" + } + }, + "end": "\\}", + "endCaptures": { + "0": { + "name": "punctuation.section.braces.end.r" + } + }, + "patterns": [ + { + "include": "source.r" + } + ] + } + ] + }, + "function-declarations": { + "patterns": [ + { + "match": "((?:`[^`\\\\]*(?:\\\\.[^`\\\\]*)*`)|(?:[[:alpha:].][[:alnum:]._]*))\\s*(