diff --git a/C#/C#.sublime-syntax b/C#/C#.sublime-syntax index 4df334dcf3..575c190d5b 100644 --- a/C#/C#.sublime-syntax +++ b/C#/C#.sublime-syntax @@ -1977,266 +1977,440 @@ contexts: 2: constant.numeric.suffix.cs - include: strings +###[ STRINGS ]################################################################# + strings: + # literal raw strings - match: '(""""+)' scope: punctuation.definition.string.begin.cs - push: inside_raw_string_literal + push: inside_raw_string - match: '"""' scope: punctuation.definition.string.begin.cs push: - - inside_triple_quoted_raw_string_literal - - inside_triple_quoted_raw_string_literal_syntax + - inside_triple_quoted_raw_string + - inside_triple_quoted_raw_string_syntax + # literal quoted strings - match: '"' scope: punctuation.definition.string.begin.cs push: inside_string - # interpolated strings - - match: '\$("""+)' + # interpolated raw format strings + - match: '\${1}("""+)' scope: punctuation.definition.string.begin.cs - push: inside_raw_format_string - - match: '\$\$("""+)' + push: inside_raw_format_string_1 + - match: '\${2}("""+)' scope: punctuation.definition.string.begin.cs push: inside_raw_format_string_2 - - match: '@\$("""+)' + - match: '\${3}("""+)' scope: punctuation.definition.string.begin.cs - push: inside_raw_format_string_literal - - match: '@\$\$("""+)' + push: inside_raw_format_string_3 + - match: '\${4}("""+)' scope: punctuation.definition.string.begin.cs - push: inside_raw_format_string_literal_2 + push: inside_raw_format_string_4 + # interpolated quoted format strings - match: '\$"' scope: punctuation.definition.string.begin.cs push: inside_format_string - # multi-line strings + # literal verbatim strings - match: '@"' scope: punctuation.definition.string.begin.cs push: - - inside_long_string - - inside_long_string_syntax - # interpolated multi-line strings - - match: '(@\$|\$@)"' + - inside_verbatim_string + - inside_verbatim_string_syntax + # interpolated verbatim format strings + - match: '(?:@\$|\$@)"' scope: punctuation.definition.string.begin.cs push: - - inside_long_format_string - - inside_long_format_string_syntax + - inside_verbatim_format_string + - inside_verbatim_format_string_syntax + +###[ QUOTED STRINGS ]########################################################## - inside_raw_string_literal: + inside_string: - meta_include_prototype: false - - meta_scope: meta.string.cs string.quoted.triple.cs - - match: '\1' + - meta_scope: meta.string.cs string.quoted.double.cs + - match: '"' scope: punctuation.definition.string.end.cs pop: true - - include: string_escaped + - include: string_prototype + - include: string_escapes + - include: string_placeholder_escapes - include: string_placeholders - - include: extended_string_placeholders + - match: (\{)(\d+) + captures: + 1: punctuation.definition.placeholder.begin.cs + 2: meta.number.integer.decimal.cs constant.numeric.value.cs + push: inside_extended_string_placeholder + - match: $\n? + scope: invalid.illegal.unclosed-string.cs + pop: true - inside_triple_quoted_raw_string_literal: + inside_extended_string_placeholder: + - meta_scope: constant.other.placeholder.cs + - include: string_placeholder_end + - include: string_placeholder_width + - include: string_placeholder_format + - match: '[^"}]+' + scope: invalid.illegal.unexpected-character-in-placeholder.cs + + inside_format_string: - meta_include_prototype: false - - meta_scope: meta.string.cs string.quoted.triple.cs - - match: '"""' + - meta_scope: meta.string.interpolated.cs string.quoted.double.cs + - match: '"' + scope: punctuation.definition.string.end.cs + pop: true + - include: string_prototype + - include: string_escapes + - include: string_placeholder_escapes + - match: \{ + scope: punctuation.section.interpolation.begin.cs + push: inside_format_string_interpolation + - match: \} + scope: invalid.illegal.unescaped-placeholder.cs + - match: $\n? + scope: invalid.illegal.unclosed-string.cs + pop: true + + inside_format_string_interpolation: + - clear_scopes: 1 + - meta_scope: meta.interpolation.cs + - meta_content_scope: source.cs + - match: \} + scope: punctuation.section.interpolation.end.cs + pop: true + - include: string_interpolation_width + - include: string_placeholder_format + - include: line_of_code_in + + string_placeholder_format: + - match: ':(?=")' + scope: invalid.illegal.unclosed-string-placeholder.cs + pop: true + - match: ':' + scope: punctuation.separator.cs + push: inside_string_placeholder_format + + inside_string_placeholder_format: + - meta_scope: meta.format-spec.cs + - meta_content_scope: constant.other.format-spec.cs + - include: string_escapes + - include: string_placeholder_escapes + - match: (?=\}) + pop: true + - match: (?:[^}"\\](?:\\.)*)*(?=") + scope: invalid.illegal.unclosed-string-placeholder.cs + pop: 2 + - match: \{ + scope: invalid.illegal.unescaped-placeholder.cs + +###[ VERBATIM STRINGS ]######################################################## + + inside_verbatim_string: + - meta_include_prototype: false + - meta_scope: meta.string.cs string.quoted.double.verbatim.cs + - include: verbatim_string_escapes + - match: '"' scope: punctuation.definition.string.end.cs pop: true - - include: string_escaped + - include: string_prototype + - include: string_placeholder_escapes - include: string_placeholders - - include: extended_string_placeholders + - include: extended_verbatim_string_placeholders - inside_triple_quoted_raw_string_literal_syntax: + inside_verbatim_string_syntax: - meta_include_prototype: false - match: (?={{sql_indicator}}) set: scope:source.sql with_prototype: - - match: (?=""") + - include: verbatim_string_escapes + - match: (?=") pop: true + - include: string_prototype + - include: string_placeholder_escapes + - include: string_placeholders + - include: extended_verbatim_string_placeholders - match: (?=\S) pop: true - inside_string: + extended_verbatim_string_placeholders: + - match: (\{)(\d+) + captures: + 1: punctuation.definition.placeholder.begin.cs + 2: meta.number.integer.decimal.cs constant.numeric.value.cs + push: inside_extended_verbatim_string_placeholder + + inside_extended_verbatim_string_placeholder: + - meta_scope: constant.other.placeholder.cs + - include: string_placeholder_end + - include: string_placeholder_width + - include: verbatim_string_placeholder_format + - match: '[^"}]+' + scope: invalid.illegal.unexpected-character-in-placeholder.cs + + inside_verbatim_format_string: - meta_include_prototype: false - - meta_scope: meta.string.cs string.quoted.double.cs - - include: string_escaped + - meta_scope: meta.string.interpolated.cs string.quoted.double.verbatim.cs + - include: verbatim_string_escapes - match: '"' scope: punctuation.definition.string.end.cs pop: true - - include: string_placeholders - - include: extended_string_placeholders - - match: $\n? - scope: invalid.illegal.unclosed-string.cs + - include: string_prototype + - include: string_placeholder_escapes + - include: verbatim_format_string_interpolations + + inside_verbatim_format_string_syntax: + - meta_include_prototype: false + - match: (?={{sql_indicator}}) + set: scope:source.sql + with_prototype: + - include: verbatim_string_escapes + - match: (?=") + pop: true + - include: string_prototype + - include: string_placeholder_escapes + - include: verbatim_format_string_interpolations + - match: (?=\S) pop: true - inside_format_string: + verbatim_format_string_interpolations: + - match: \{ + scope: punctuation.section.interpolation.begin.cs + push: inside_verbatim_format_string_interpolation + - match: \} + scope: invalid.illegal.unescaped-placeholder.cs + + inside_verbatim_format_string_interpolation: + - clear_scopes: 1 + - meta_scope: meta.interpolation.cs + - meta_content_scope: source.cs + - match: \} + scope: punctuation.section.interpolation.end.cs + pop: true + - include: string_interpolation_width + - include: verbatim_string_placeholder_format + - include: line_of_code_in + + verbatim_string_placeholder_format: + - match: ':(?="(?!"))' + scope: invalid.illegal.unclosed-string-placeholder.cs + pop: true + - match: ':' + scope: punctuation.separator.cs + push: inside_verbatim_string_placeholder_format + + inside_verbatim_string_placeholder_format: + - meta_scope: meta.format-spec.cs + - meta_content_scope: constant.other.format-spec.cs + - include: verbatim_string_escapes + - include: string_placeholder_escapes + - match: (?=\}) + pop: true + - match: \\(?:""|[^"]) + scope: constant.character.escape.cs + - match: (?:[^}"]|"")*(?="(?!")) + scope: invalid.illegal.unclosed-string-placeholder.cs + pop: 2 + - match: \{ + scope: invalid.illegal.unescaped-placeholder.cs + + verbatim_string_escapes: + - match: '""' + scope: constant.character.escape.cs + +###[ RAW STRINGS ]############################################################# + + inside_triple_quoted_raw_string: - meta_include_prototype: false - - meta_scope: meta.string.interpolated.cs string.quoted.double.cs - - match: '"' + - meta_scope: meta.string.cs string.quoted.double.block.cs + - match: '"""' scope: punctuation.definition.string.end.cs pop: true - - include: string_escaped - - include: string_placeholder_escape - - include: format_string_interpolation - - match: $\n? - scope: invalid.illegal.unclosed-string.cs + - include: string_prototype + - include: string_placeholder_escapes + - include: string_placeholders + - include: extended_raw_string_placeholders + + inside_triple_quoted_raw_string_syntax: + - meta_include_prototype: false + - match: (?={{sql_indicator}}) + set: scope:source.sql + with_prototype: + - match: (?=""") + pop: true + - include: string_prototype + - match: (?=\S) pop: true - inside_raw_format_string: + inside_raw_string: - meta_include_prototype: false - - meta_scope: meta.string.interpolated.cs string.quoted.triple.cs - - match: '\1' + - meta_scope: meta.string.cs string.quoted.double.block.cs + - match: \1 scope: punctuation.definition.string.end.cs pop: true - - include: string_escaped - - include: string_placeholder_escape - - include: format_string_interpolation + - include: string_prototype + - include: string_placeholder_escapes + - include: string_placeholders + - include: extended_raw_string_placeholders + + extended_raw_string_placeholders: + - match: (\{)(\d+) + captures: + 1: punctuation.definition.placeholder.begin.cs + 2: meta.number.integer.decimal.cs constant.numeric.value.cs + push: inside_extended_raw_string_placeholder + + inside_extended_raw_string_placeholder: + - meta_scope: constant.other.placeholder.cs + - include: string_placeholder_end + - include: string_placeholder_width + - include: raw_string_placeholder_format + - match: '[^"}]+' + scope: invalid.illegal.unexpected-character-in-placeholder.cs - inside_raw_format_string_literal: + inside_raw_format_string_1: - meta_include_prototype: false - - meta_scope: meta.string.interpolated.cs string.quoted.triple.cs - - match: '\1' + - meta_scope: meta.string.interpolated.cs string.quoted.double.block.cs + - match: \1 scope: punctuation.definition.string.end.cs pop: true - - include: string_placeholder_escape - - include: format_string_interpolation - - format_string_interpolation: + - include: string_prototype + - match: \{{2,}|\}{1,} + scope: invalid.illegal.unexpected-token.cs - match: \{ scope: punctuation.section.interpolation.begin.cs - push: inside_format_string_interpolation + push: inside_raw_format_string_interpolation_1 - inside_format_string_interpolation: + inside_raw_format_string_interpolation_1: - clear_scopes: 1 - meta_scope: meta.interpolation.cs - meta_content_scope: source.cs - - match: '\}' + - match: \} scope: punctuation.section.interpolation.end.cs pop: true - - include: string_replacement_width - - include: string_placeholder_format + - include: string_interpolation_width + - include: raw_string_placeholder_format - include: line_of_code_in inside_raw_format_string_2: - meta_include_prototype: false - - meta_scope: meta.string.interpolated.cs string.quoted.triple.cs - - match: '\1' + - meta_scope: meta.string.interpolated.cs string.quoted.double.block.cs + - match: \1 scope: punctuation.definition.string.end.cs pop: true - - include: string_escaped - - include: string_placeholder_escape - - include: format_string_interpolation_2 + - include: string_prototype + - match: \{{2}(?!\{) + scope: punctuation.section.interpolation.begin.cs + push: inside_raw_format_string_interpolation_2 + - match: \}{2,} + scope: invalid.illegal.unexpected-token.cs - inside_raw_format_string_literal_2: + inside_raw_format_string_interpolation_2: + - clear_scopes: 1 + - meta_scope: meta.interpolation.cs + - meta_content_scope: source.cs + - match: \}{2} + scope: punctuation.section.interpolation.end.cs + pop: true + - include: string_interpolation_width + - include: raw_string_placeholder_format + - include: line_of_code_in + + inside_raw_format_string_3: - meta_include_prototype: false - - meta_scope: meta.string.interpolated.cs string.quoted.triple.cs - - match: '\1' + - meta_scope: meta.string.interpolated.cs string.quoted.double.block.cs + - match: \1 scope: punctuation.definition.string.end.cs pop: true - - include: string_placeholder_escape - - include: format_string_interpolation_2 - - format_string_interpolation_2: - - match: \{\{ + - include: string_prototype + - match: \{{3}(?!\{) scope: punctuation.section.interpolation.begin.cs - push: inside_format_string_interpolation_2 + push: inside_raw_format_string_interpolation_3 + - match: \}{3,} + scope: invalid.illegal.unexpected-token.cs - inside_format_string_interpolation_2: + inside_raw_format_string_interpolation_3: - clear_scopes: 1 - meta_scope: meta.interpolation.cs - meta_content_scope: source.cs - - match: '\}\}' + - match: \}{3} scope: punctuation.section.interpolation.end.cs pop: true - - include: string_replacement_width - - include: string_placeholder_format + - include: string_interpolation_width + - include: raw_string_placeholder_format - include: line_of_code_in - inside_long_format_string: + inside_raw_format_string_4: - meta_include_prototype: false - - meta_scope: meta.string.interpolated.cs string.quoted.double.raw.cs - - include: long_string_escaped - - match: '"' + - meta_scope: meta.string.interpolated.cs string.quoted.double.block.cs + - match: \1 scope: punctuation.definition.string.end.cs pop: true - - include: string_placeholder_escape - - match: \{ + - include: string_prototype + - match: \{{4}(?!\{) scope: punctuation.section.interpolation.begin.cs - push: inside_long_format_string_interpolation - - inside_long_format_string_syntax: - - meta_include_prototype: false - - match: (?={{sql_indicator}}) - set: scope:source.sql - with_prototype: - - include: long_string_escaped - - match: (?=") - pop: true - - include: string_placeholder_escape - - match: \{ - scope: punctuation.section.interpolation.begin.cs - push: inside_long_format_string_interpolation - - match: (?=\S) - pop: true + push: inside_raw_format_string_interpolation_4 + - match: \}{4,} + scope: invalid.illegal.unexpected-token.cs - inside_long_format_string_interpolation: + inside_raw_format_string_interpolation_4: - clear_scopes: 1 - meta_scope: meta.interpolation.cs - meta_content_scope: source.cs - - match: '\}' + - match: \}{4} scope: punctuation.section.interpolation.end.cs pop: true - - include: string_replacement_width - - include: long_string_placeholder_format + - include: string_interpolation_width + - include: raw_string_placeholder_format - include: line_of_code_in - string_placeholder_escape: - - match: '\{\{|\}\}' + raw_string_placeholder_format: + - match: ':' + scope: punctuation.separator.cs + push: inside_raw_string_placeholder_format + + inside_raw_string_placeholder_format: + - meta_scope: meta.format-spec.cs + - meta_content_scope: constant.other.format-spec.cs + - match: (?=\}) + pop: true + - match: (?=") + pop: 2 + - match: \\ + scope: invalid.illegal.lone-escape.cs + - match: \{ + scope: invalid.illegal.unescaped-placeholder.cs + +###[ STRING PROTOTYPES ]####################################################### + + string_escapes: + - match: '{{escaped_char}}' + scope: constant.character.escape.cs + - match: \\ + scope: invalid.illegal.lone-escape.cs + + string_placeholder_escapes: + - match: \{\{|\}\} scope: constant.character.escape.cs string_placeholders: - - include: string_placeholder_escape - match: \{\h{8}-(?:\h{4}-){3}\h{12}\} scope: constant.other.guid.cs - - match: '(\{)(\d+)(?=")' + - match: (\{)(\d+)(?=") scope: constant.other.placeholder.cs captures: 1: punctuation.definition.placeholder.begin.cs 2: meta.number.integer.decimal.cs constant.numeric.value.cs invalid.illegal.unclosed-string-placeholder.cs - extended_string_placeholders: - - match: '(\{)(\d+)' - captures: - 1: punctuation.definition.placeholder.begin.cs - 2: meta.number.integer.decimal.cs constant.numeric.value.cs - push: inside_extended_string_placeholder - - inside_extended_string_placeholder: - - meta_scope: constant.other.placeholder.cs - - include: string_placeholder_end - - include: string_placeholder_width - - include: string_placeholder_format - - match: '[^"}]+' - scope: invalid.illegal.unexpected-character-in-placeholder.cs - - extended_long_string_placeholders: - - match: '(\{)(\d+)' - captures: - 1: punctuation.definition.placeholder.begin.cs - 2: meta.number.integer.decimal.cs constant.numeric.value.cs - push: inside_extended_long_string_placeholder - - inside_extended_long_string_placeholder: - - meta_scope: constant.other.placeholder.cs - - include: string_placeholder_end - - include: string_placeholder_width - - include: long_string_placeholder_format - - match: '[^"}]+' - scope: invalid.illegal.unexpected-character-in-placeholder.cs - string_placeholder_end: - - match: '(\})(\}(?!\}))?' + - match: (\})(\}(?!\}))? captures: 1: punctuation.definition.placeholder.end.cs 2: invalid.illegal.unescaped-placeholder.cs pop: true - - match: (?=[}"]) + - match: (?=") pop: true - string_replacement_width: - - match: '\s*(?:(,)\s*(?:((-?)\d+)|({{name}}))\s*)?' + string_placeholder_width: + - match: \s*(?:(,)\s*((-?)\d+)\s*)? scope: meta.format-spec.cs captures: 1: punctuation.separator.cs @@ -2244,8 +2418,8 @@ contexts: 3: keyword.operator.arithmetic.cs 4: variable.other.cs - string_placeholder_width: - - match: '\s*(?:(,)\s*((-?)\d+)\s*)?' + string_interpolation_width: + - match: \s*(?:(,)\s*(?:((-?)\d+)|({{name}}))\s*)? scope: meta.format-spec.cs captures: 1: punctuation.separator.cs @@ -2253,85 +2427,9 @@ contexts: 3: keyword.operator.arithmetic.cs 4: variable.other.cs - string_placeholder_format: - - match: ':(?=")' - scope: invalid.illegal.unclosed-string-placeholder.cs - pop: true - - match: ':' - scope: punctuation.separator.cs - push: inside_string_placeholder_format - - inside_string_placeholder_format: - - meta_scope: meta.format-spec.cs - - meta_content_scope: constant.other.format-spec.cs - - include: string_placeholder_escape - - include: string_escaped - - match: '(?=\})' - pop: true - - match: '(?:[^}"\\](?:\\.)*)+(?=")' - scope: invalid.illegal.unclosed-string-placeholder.cs - pop: true - - match: '\{' - scope: invalid.illegal.unescaped-placeholder.cs - - long_string_placeholder_format: - - match: ':(?="(?!"))' - scope: invalid.illegal.unclosed-string-placeholder.cs - pop: true - - match: ':' - scope: punctuation.separator.cs - push: inside_long_string_placeholder_format - - inside_long_string_placeholder_format: - - meta_scope: meta.format-spec.cs - - meta_content_scope: constant.other.format-spec.cs - - include: string_placeholder_escape - - include: long_string_escaped - - match: (?=\}) - pop: true - - match: \\(?:""|[^"]) - scope: constant.character.escape.cs - - match: (?:[^}"]|"")+(?="(?!")) - scope: invalid.illegal.unclosed-string-placeholder.cs - pop: true - - match: \{ - scope: invalid.illegal.unescaped-placeholder.cs - - inside_long_string: - - meta_include_prototype: false - - meta_scope: meta.string.cs string.quoted.double.raw.cs - - include: long_string_escaped - - match: '"' - scope: punctuation.definition.string.end.cs - pop: true - - include: string_placeholders - - include: extended_long_string_placeholders + string_prototype: [] - inside_long_string_syntax: - - meta_include_prototype: false - - match: (?={{sql_indicator}}) - set: scope:source.sql - with_prototype: - - include: long_string_escaped - - match: (?=") - pop: true - - include: string_placeholders - - include: extended_long_string_placeholders - - match: (?=\S) - pop: true - - escaped: - - match: '{{escaped_char}}' - scope: constant.character.escape.cs - - string_escaped: - - include: escaped - - match: \\ - scope: invalid.illegal.lone-escape.cs - - long_string_escaped: - - match: '""' - scope: constant.character.escape.cs +###[ INITIALIZERS ]############################################################ initializer_constructor: - meta_content_scope: meta.instance.cs meta.braces.cs diff --git a/C#/tests/syntax_test_C#11.cs b/C#/tests/syntax_test_C#11.cs index 220b2e05c3..c51431fcc0 100644 --- a/C#/tests/syntax_test_C#11.cs +++ b/C#/tests/syntax_test_C#11.cs @@ -3,77 +3,543 @@ // https://learn.microsoft.com/en-gb/dotnet/csharp/whats-new/csharp-11#raw-string-literals string longMessage = """ -/// ^^^ string.quoted.triple punctuation.definition.string.begin +/// ^^^ string.quoted.double.block punctuation.definition.string.begin This is a long message. It has several lines. Some are indented more than others. Some should start at the first column. Some have "quoted text" in them. -/// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ string.quoted.triple - punctuation +/// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ string.quoted.double.block - punctuation + + Escapes like \0 \a \f \n \t "" are literals. +///^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - constant - invalid - punctuation + + Literal placeholders {0,20:F3}}! +/// ^^^^^^^^^ constant.other.placeholder.cs +/// ^ punctuation.definition.placeholder.begin.cs +/// ^ meta.number.integer.decimal.cs constant.numeric.value.cs +/// ^^^^^^ meta.format-spec.cs +/// ^ punctuation.separator.cs +/// ^^ meta.number.integer.decimal.cs constant.numeric.value.cs +/// ^ punctuation.separator.cs +/// ^^ constant.other.format-spec.cs +/// ^ punctuation.definition.placeholder.end.cs +/// ^ invalid.illegal.unescaped-placeholder.cs + + GMT is {{DateTime.Now,width:yyyyMMdd\THHmmss\Z}}! +/// ^^ constant.character.escape.cs +/// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - constant - invalid - punctuation +/// ^^ constant.character.escape.cs """; -/// ^^^ string.quoted.triple punctuation.definition.string.end +/// ^^^ string.quoted.double.block punctuation.definition.string.end longMessage = """"" This raw string literal has four """", count them: """" four! embedded quote characters in a sequence. That's why it starts and ends with five double quotes. -You could extend this example with as many embedded quotes as needed for your text. + Escapes like \0 \a \f \n \t "" are literals. +///^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - constant - invalid - punctuation + + Literal placeholders {0,20:F3}}! +/// ^^^^^^^^^ constant.other.placeholder.cs +/// ^ punctuation.definition.placeholder.begin.cs +/// ^ meta.number.integer.decimal.cs constant.numeric.value.cs +/// ^^^^^^ meta.format-spec.cs +/// ^ punctuation.separator.cs +/// ^^ meta.number.integer.decimal.cs constant.numeric.value.cs +/// ^ punctuation.separator.cs +/// ^^ constant.other.format-spec.cs +/// ^ punctuation.definition.placeholder.end.cs +/// ^ invalid.illegal.unescaped-placeholder.cs + + GMT is {{DateTime.Now,width:yyyyMMdd\THHmmss\Z}}! +/// ^^ constant.character.escape.cs +/// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - constant - invalid - punctuation +/// ^^ constant.character.escape.cs """"" // - no semi-colon on the line above -var location = $$""" -/// <- storage.type.variable -/// ^^^^^^^^ variable.other -/// ^^^^^ meta.string.interpolated string.quoted.triple punctuation.definition.string.begin - You are at {{{Longitude}}, {{Latitude}}} -/// ^^ meta.string.interpolated string.quoted.triple constant.character.escape -/// ^ - constant -/// ^^ meta.string.interpolated string.quoted.triple constant.character.escape -/// ^^ meta.string.interpolated string.quoted.triple constant.character.escape -/// ^^ meta.string.interpolated string.quoted.triple constant.character.escape -/// ^ - constant - """; - var location = $""" -/// ^^^^^ meta.string.interpolated string.quoted.triple +/// ^^^^^ meta.string.interpolated string.quoted.double.block /// ^^^^ punctuation.definition.string.begin /// ^ - invalid - You are at {{{Longitude}} \t {{Latitude}}} -///^^^^^^^^^^^^^ meta.string.interpolated string.quoted.triple -/// ^^^^^^^^^^^ meta.string.interpolated meta.interpolation - string -/// ^^^^^^^^^^^^^^^^^^ meta.string.interpolated string.quoted.triple -/// ^^ constant.character.escape + + Escapes like \0 \a \f \n \t "" are literals. +///^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - constant - invalid - punctuation + + You are at {Longitude}} \t {{Latitude}}} +///^^^^^^^^^^^^ meta.string.interpolated.cs string.quoted.double.block.cs +/// ^^^^^^^^^^^ meta.string.interpolated.cs meta.interpolation.cs - string +/// ^^^^^^^^^^^^^^^^^^^ meta.string.interpolated.cs string.quoted.double.block.cs +/// ^ punctuation.section.interpolation.begin.cs +/// ^^^^^^^^^ variable.other.cs +/// ^ punctuation.section.interpolation.end.cs +/// ^ invalid.illegal.unexpected-token.cs +/// ^^ - constant.character +/// ^^ invalid.illegal.unexpected-token.cs +/// ^^^ invalid.illegal.unexpected-token.cs + + GMT is {DateTime.Now,width:yyyyMMdd\THHmmss\Z}! +///^^^^^^^^ meta.string.interpolated.cs string.quoted.double.block.cs +/// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.string.interpolated.cs meta.interpolation.cs - string +/// ^^ meta.string.interpolated.cs string.quoted.double.block.cs +/// ^ punctuation.section.interpolation.begin.cs +/// ^^^^^^^^ variable.other.cs +/// ^ punctuation.accessor.dot.cs +/// ^^^ variable.other.cs +/// ^^^^^^^^^^^^^^^^^^^^^^^^^ meta.format-spec.cs +/// ^ punctuation.separator.cs +/// ^^^^^ variable.other.cs +/// ^ punctuation.separator.cs +/// ^^^^^^^^^^^^^^^^^^ constant.other.format-spec.cs - constant.character +/// ^ invalid.illegal.lone-escape.cs +/// ^ invalid.illegal.lone-escape.cs +/// ^ punctuation.section.interpolation.end.cs + + "{In+"complete":F"} "{Incomplete:F\"} {Brace:{}} +///^^ meta.string.interpolated.cs string.quoted.double.block.cs +/// ^^^^ meta.string.interpolated.cs meta.interpolation.cs - string +/// ^^^^^^^^^^ meta.string.interpolated.cs meta.interpolation.cs meta.string.cs +/// ^^ meta.string.interpolated.cs meta.interpolation.cs meta.format-spec.cs +/// ^^^^ meta.string.interpolated.cs string.quoted.double.block.cs +/// ^^^^^^^^^^^^^^ meta.string.interpolated.cs meta.interpolation.cs - string +/// ^^^ meta.string.interpolated.cs string.quoted.double.block.cs +/// ^^^^^^^^^ meta.string.interpolated.cs meta.interpolation.cs - string +/// ^^ meta.string.interpolated.cs string.quoted.double.block.cs +/// ^ punctuation.section.interpolation.begin.cs +/// ^^ variable.other.cs +/// ^ keyword.operator.arithmetic.cs +/// ^^^^^^^^^^ string.quoted.double.cs +/// ^^ meta.format-spec.cs +/// ^ punctuation.separator.cs +/// ^ constant.other.format-spec.cs +/// ^ invalid.illegal.unexpected-token.cs +/// ^ punctuation.section.interpolation.begin.cs +/// ^^^^^^^^^^ variable.other.cs +/// ^^^ meta.format-spec.cs +/// ^ punctuation.separator.cs +/// ^^ constant.other.format-spec.cs +/// ^ invalid.illegal.lone-escape.cs +/// ^ invalid.illegal.unexpected-token.cs +/// ^ punctuation.section.interpolation.begin.cs +/// ^^^^^ variable.other.cs +/// ^^ meta.format-spec.cs +/// ^ punctuation.separator.cs +/// ^ constant.other.format-spec.cs invalid.illegal.unescaped-placeholder.cs +/// ^ punctuation.section.interpolation.end.cs +/// ^ invalid.illegal.unexpected-token.cs """; -/// <- meta.string.interpolated string.quoted.triple -///^^^ meta.string.interpolated string.quoted.triple punctuation.definition.string.end +/// <- meta.string.interpolated string.quoted.double.block +///^^^ meta.string.interpolated string.quoted.double.block punctuation.definition.string.end /// ^ punctuation.terminator.statement - string +// Note: Verbatim strings may look like raw strings when starting with escaped double-quotes var location = @$""" -/// ^^^^^ meta.string.interpolated string.quoted.triple -/// ^^^^ punctuation.definition.string.begin -/// ^ - invalid - You are at {{{Longitude}} \t {{Latitude}}} -///^^^^^^^^^^^^^ meta.string.interpolated string.quoted.triple -/// ^^^^^^^^^^^ meta.string.interpolated meta.interpolation - string -/// ^^^^^^^^^^^^^^^^^ meta.string.interpolated string.quoted.triple -/// ^^ - constant.character.escape +/// ^^^^^^ meta.string.interpolated.cs string.quoted.double.verbatim.cs +/// ^^^ punctuation.definition.string.begin.cs +/// ^^ constant.character.escape.cs + + Escapes like \0 \a \f \n \t "" are literals. +///^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - constant - invalid - punctuation +/// ^^ constant.character.escape.cs +/// ^^^^^^^^^^^^^^^ - constant - invalid - punctuation + + You are at {{{Longitude}} \t {{Latitude}}} +///^^^^^^^^^^^^^^ meta.string.interpolated.cs string.quoted.double.verbatim.cs +/// ^^^^^^^^^^^ meta.string.interpolated.cs meta.interpolation.cs - string +/// ^^^^^^^^^^^^^^^^^^^ meta.string.interpolated.cs string.quoted.double.verbatim.cs +/// ^^ constant.character.escape.cs +/// ^ punctuation.section.interpolation.begin.cs +/// ^^^^^^^^^ variable.other.cs +/// ^ punctuation.section.interpolation.end.cs +/// ^^^^^ - constant +/// ^^ constant.character.escape.cs +/// ^^ constant.character.escape.cs +/// ^ - constant + + GMT is {DateTime.Now,width:yyyyMMdd\THHmmss\Z}! +///^^^^^^^^ meta.string.interpolated.cs string.quoted.double.verbatim.cs +/// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.string.interpolated.cs meta.interpolation.cs - string +/// ^^ meta.string.interpolated.cs string.quoted.double.verbatim.cs +/// ^ punctuation.section.interpolation.begin.cs +/// ^^^^^^^^ variable.other.cs +/// ^ punctuation.accessor.dot.cs +/// ^^^ variable.other.cs +/// ^^^^^^^^^^^^^^^^^^^^^^^^^ meta.format-spec.cs +/// ^ punctuation.separator.cs +/// ^^^^^ variable.other.cs +/// ^ punctuation.separator.cs +/// ^^^^^^^^^^^^^^^^^^ constant.other.format-spec.cs +/// ^^ constant.character.escape.cs +/// ^^ constant.character.escape.cs +/// ^ punctuation.section.interpolation.end.cs """; -/// <- meta.string.interpolated string.quoted.triple -///^^^ meta.string.interpolated string.quoted.triple punctuation.definition.string.end -/// ^ punctuation.terminator.statement - string +/// <- meta.string.interpolated.cs string.quoted.double.verbatim.cs +///^^^ meta.string.interpolated.cs string.quoted.double.verbatim.cs +///^^ constant.character.escape.cs +/// ^ punctuation.definition.string.end.cs +/// ^ punctuation.terminator.statement.cs + +var location = $$""" +/// <- storage.type.variable +/// ^^^^^^^^ variable.other +/// ^^^^^ meta.string.interpolated string.quoted.double.block punctuation.definition.string.begin + + Escapes like \0 \a \f \n \t "" are literals. +///^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - constant - invalid - punctuation + + You are at {{{Longitude}}} \t {Latitude}} } +///^^^^^^^^^^^^^ meta.string.interpolated.cs string.quoted.double.block.cs +/// ^^^^^^^^^^^^^ meta.string.interpolated.cs meta.interpolation.cs - string +/// ^^^^^^^^^^^^^^^^^^^ meta.string.interpolated.cs string.quoted.double.block.cs +/// ^ - constant - invalid - punctuation +/// ^^ punctuation.section.interpolation.begin.cs +/// ^^^^^^^^^ variable.other.cs +/// ^^ punctuation.section.interpolation.end.cs +/// ^^^^^^ - constant - invalid - punctuation +/// ^^ invalid.illegal.unexpected-token.cs +/// ^ - constant - invalid - punctuation + + GMT is {{DateTime.Now,width:yyyyMMdd\THHmmss\Z}}! +///^^^^^^^^ meta.string.interpolated.cs string.quoted.double.block.cs +/// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.string.interpolated.cs meta.interpolation.cs - string +/// ^^ meta.string.interpolated.cs string.quoted.double.block.cs +/// ^^ punctuation.section.interpolation.begin.cs +/// ^^^^^^^^ variable.other.cs +/// ^ punctuation.accessor.dot.cs +/// ^^^ variable.other.cs +/// ^^^^^^^^^^^^^^^^^^^^^^^^^ meta.format-spec.cs +/// ^ punctuation.separator.cs +/// ^^^^^ variable.other.cs +/// ^ punctuation.separator.cs +/// ^^^^^^^^^^^^^^^^^^ constant.other.format-spec.cs - constant.character +/// ^ invalid.illegal.lone-escape.cs +/// ^ invalid.illegal.lone-escape.cs +/// ^^ punctuation.section.interpolation.end.cs + + "{{In+"complete":F"}} "{{Incomplete:F\"}} {{Brace:{}}} +///^^ meta.string.interpolated.cs string.quoted.double.block.cs +/// ^^^^^ meta.string.interpolated.cs meta.interpolation.cs - string +/// ^^^^^^^^^^ meta.string.interpolated.cs meta.interpolation.cs meta.string.cs +/// ^^ meta.string.interpolated.cs meta.interpolation.cs meta.format-spec.cs +/// ^^^^^ meta.string.interpolated.cs string.quoted.double.block.cs +/// ^^^^^^^^^^^^^^^ meta.string.interpolated.cs meta.interpolation.cs - string +/// ^^^^ meta.string.interpolated.cs string.quoted.double.block.cs +/// ^^^^^^^^^^^ meta.string.interpolated.cs meta.interpolation.cs - string +/// ^^ meta.string.interpolated.cs string.quoted.double.block.cs +/// ^^ punctuation.section.interpolation.begin.cs +/// ^^ variable.other.cs +/// ^ keyword.operator.arithmetic.cs +/// ^^^^^^^^^^ string.quoted.double.cs +/// ^^ meta.format-spec.cs +/// ^ punctuation.separator.cs +/// ^ constant.other.format-spec.cs +/// ^^ invalid.illegal.unexpected-token.cs +/// ^^ punctuation.section.interpolation.begin.cs +/// ^^^^^^^^^^ variable.other.cs +/// ^^^ meta.format-spec.cs +/// ^ punctuation.separator.cs +/// ^^ constant.other.format-spec.cs +/// ^ invalid.illegal.lone-escape.cs +/// ^^ invalid.illegal.unexpected-token.cs +/// ^^ punctuation.section.interpolation.begin.cs +/// ^^^^^ variable.other.cs +/// ^^ meta.format-spec.cs +/// ^ punctuation.separator.cs +/// ^ constant.other.format-spec.cs invalid.illegal.unescaped-placeholder.cs +/// ^^ punctuation.section.interpolation.end.cs +/// ^ - invalid.illegal + """; +///^^^ meta.string.interpolated.cs string.quoted.double.block.cs +///^^^ punctuation.definition.string.end.cs +/// ^ punctuation.terminator.statement.cs + +var location = @$$""" +/// <- storage.type.variable +/// ^^^^^^^^ variable.other +/// ^ invalid.illegal.reserved-char.cs +/// ^^^^^ meta.string.interpolated string.quoted.double.block punctuation.definition.string.begin + + Escapes like \0 \a \f \n \t "" are literals. +///^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - constant - invalid - punctuation + + You are at {{{Longitude}}} \t {Latitude}} } +///^^^^^^^^^^^^^ meta.string.interpolated.cs string.quoted.double.block.cs +/// ^^^^^^^^^^^^^ meta.string.interpolated.cs meta.interpolation.cs - string +/// ^^^^^^^^^^^^^^^^^^^ meta.string.interpolated.cs string.quoted.double.block.cs +/// ^ - constant - invalid - punctuation +/// ^^ punctuation.section.interpolation.begin.cs +/// ^^^^^^^^^ variable.other.cs +/// ^^ punctuation.section.interpolation.end.cs +/// ^^^^^^ - constant - invalid - punctuation +/// ^^ invalid.illegal.unexpected-token.cs +/// ^ - constant - invalid - punctuation + + GMT is {{DateTime.Now,width:yyyyMMdd\THHmmss\Z}}! +///^^^^^^^^ meta.string.interpolated.cs string.quoted.double.block.cs +/// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.string.interpolated.cs meta.interpolation.cs - string +/// ^^ meta.string.interpolated.cs string.quoted.double.block.cs +/// ^^ punctuation.section.interpolation.begin.cs +/// ^^^^^^^^ variable.other.cs +/// ^ punctuation.accessor.dot.cs +/// ^^^ variable.other.cs +/// ^^^^^^^^^^^^^^^^^^^^^^^^^ meta.format-spec.cs +/// ^ punctuation.separator.cs +/// ^^^^^ variable.other.cs +/// ^ punctuation.separator.cs +/// ^^^^^^^^^^^^^^^^^^ constant.other.format-spec.cs - constant.character +/// ^ invalid.illegal.lone-escape.cs +/// ^ invalid.illegal.lone-escape.cs +/// ^^ punctuation.section.interpolation.end.cs + """; +///^^^ meta.string.interpolated.cs string.quoted.double.block.cs +///^^^ punctuation.definition.string.end.cs +/// ^ punctuation.terminator.statement.cs + +var location = $$$""" +/// <- storage.type.variable +/// ^^^^^^^^ variable.other +/// ^^^^^ meta.string.interpolated string.quoted.double.block punctuation.definition.string.begin + + Escapes like \0 \a \f \n \t "" are literals. +///^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - constant - invalid - punctuation + + You are at {{{{{Longitude}}}}} \t {{Latitude}}} }} +///^^^^^^^^^^^^^^ meta.string.interpolated.cs string.quoted.double.block.cs +/// ^^^^^^^^^^^^^^^ meta.string.interpolated.cs meta.interpolation.cs - string +/// ^^^^^^^^^^^^^^^^^^^^^^ meta.string.interpolated.cs string.quoted.double.block.cs +/// ^^ - constant - invalid - punctuation +/// ^^^ punctuation.section.interpolation.begin.cs +/// ^^^^^^^^^ source.cs variable.other.cs +/// ^^^ punctuation.section.interpolation.end.cs +/// ^^^^^^^^ - constant - invalid - punctuation +/// ^^^ invalid.illegal.unexpected-token.cs +/// ^^ - constant - invalid - punctuation + + GMT is {{{DateTime.Now,width:yyyyMMdd\THHmmss\Z}}}! +///^^^^^^^^ meta.string.interpolated.cs string.quoted.double.block.cs +/// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.string.interpolated.cs meta.interpolation.cs - string +/// ^^ meta.string.interpolated.cs string.quoted.double.block.cs +/// ^^^ punctuation.section.interpolation.begin.cs +/// ^^^^^^^^ variable.other.cs +/// ^ punctuation.accessor.dot.cs +/// ^^^ variable.other.cs +/// ^^^^^^^^^^^^^^^^^^^^^^^^^ meta.format-spec.cs +/// ^ punctuation.separator.cs +/// ^^^^^ variable.other.cs +/// ^ punctuation.separator.cs +/// ^^^^^^^^^^^^^^^^^^ constant.other.format-spec.cs - constant.character +/// ^ invalid.illegal.lone-escape.cs +/// ^ invalid.illegal.lone-escape.cs +/// ^^^ punctuation.section.interpolation.end.cs + + "{{{In+"complete":F"}}} "{{{Incomplete:F\"}}} {{{Brace:{}}}} +///^^ meta.string.interpolated.cs string.quoted.double.block.cs +/// ^^^^^^ meta.string.interpolated.cs meta.interpolation.cs - string +/// ^^^^^^^^^^ meta.string.interpolated.cs meta.interpolation.cs meta.string.cs +/// ^^ meta.string.interpolated.cs meta.interpolation.cs meta.format-spec.cs +/// ^^^^^^ meta.string.interpolated.cs string.quoted.double.block.cs +/// ^^^^^^^^^^^^^^^^ meta.string.interpolated.cs meta.interpolation.cs - string +/// ^^^^^ meta.string.interpolated.cs string.quoted.double.block.cs +/// ^^^^^^^^^^^^^ meta.string.interpolated.cs meta.interpolation.cs - string +/// ^^ meta.string.interpolated.cs string.quoted.double.block.cs +/// ^^^ punctuation.section.interpolation.begin.cs +/// ^^ variable.other.cs +/// ^ keyword.operator.arithmetic.cs +/// ^^^^^^^^^^ string.quoted.double.cs +/// ^^ meta.format-spec.cs +/// ^ punctuation.separator.cs +/// ^ constant.other.format-spec.cs +/// ^^^ invalid.illegal.unexpected-token.cs +/// ^^^ punctuation.section.interpolation.begin.cs +/// ^^^^^^^^^^ variable.other.cs +/// ^^^ meta.format-spec.cs +/// ^ punctuation.separator.cs +/// ^^ constant.other.format-spec.cs +/// ^ invalid.illegal.lone-escape.cs +/// ^^^ invalid.illegal.unexpected-token.cs +/// ^^^ punctuation.section.interpolation.begin.cs +/// ^^^^^ variable.other.cs +/// ^^ meta.format-spec.cs +/// ^ punctuation.separator.cs +/// ^ constant.other.format-spec.cs invalid.illegal.unescaped-placeholder.cs +/// ^^^ punctuation.section.interpolation.end.cs +/// ^ - invalid.illegal + """; +///^^^ meta.string.interpolated.cs string.quoted.double.block.cs +///^^^ punctuation.definition.string.end.cs +/// ^ punctuation.terminator.statement.cs + +var location = @$$$""" +/// <- storage.type.variable +/// ^^^^^^^^ variable.other +/// ^ invalid.illegal.reserved-char.cs +/// ^^^^^ meta.string.interpolated string.quoted.double.block punctuation.definition.string.begin + + Escapes like \0 \a \f \n \t "" are literals. +///^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - constant - invalid - punctuation + + You are at {{{{{Longitude}}}}} \t {{Latitude}}} }} +///^^^^^^^^^^^^^^ meta.string.interpolated.cs string.quoted.double.block.cs +/// ^^^^^^^^^^^^^^^ meta.string.interpolated.cs meta.interpolation.cs - string +/// ^^^^^^^^^^^^^^^^^^^^^^ meta.string.interpolated.cs string.quoted.double.block.cs +/// ^^ - constant - invalid - punctuation +/// ^^^ punctuation.section.interpolation.begin.cs +/// ^^^^^^^^^ source.cs variable.other.cs +/// ^^^ punctuation.section.interpolation.end.cs +/// ^^^^^^^^ - constant - invalid - punctuation +/// ^^^ invalid.illegal.unexpected-token.cs +/// ^^ - constant - invalid - punctuation + + GMT is {{{DateTime.Now,width:yyyyMMdd\THHmmss\Z}}}! +///^^^^^^^^ meta.string.interpolated.cs string.quoted.double.block.cs +/// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.string.interpolated.cs meta.interpolation.cs - string +/// ^^ meta.string.interpolated.cs string.quoted.double.block.cs +/// ^^^ punctuation.section.interpolation.begin.cs +/// ^^^^^^^^ variable.other.cs +/// ^ punctuation.accessor.dot.cs +/// ^^^ variable.other.cs +/// ^^^^^^^^^^^^^^^^^^^^^^^^^ meta.format-spec.cs +/// ^ punctuation.separator.cs +/// ^^^^^ variable.other.cs +/// ^ punctuation.separator.cs +/// ^^^^^^^^^^^^^^^^^^ constant.other.format-spec.cs - constant.character +/// ^ invalid.illegal.lone-escape.cs +/// ^ invalid.illegal.lone-escape.cs +/// ^^^ punctuation.section.interpolation.end.cs + """; +///^^^ meta.string.interpolated.cs string.quoted.double.block.cs +///^^^ punctuation.definition.string.end.cs +/// ^ punctuation.terminator.statement.cs + +var location = $$$$""" +/// <- storage.type.variable +/// ^^^^^^^^ variable.other +/// ^^^^^ meta.string.interpolated string.quoted.double.block punctuation.definition.string.begin + + Escapes like \0 \a \f \n \t "" are literals. +///^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - constant - invalid - punctuation + + You are at {{{{{{{Longitude}}}}}}} \t {{{Latitude}}}} }}} +///^^^^^^^^^^^^^^^ meta.string.interpolated.cs string.quoted.double.block.cs +/// ^^^^^^^^^^^^^^^^^ meta.string.interpolated.cs meta.interpolation.cs - string +/// ^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.string.interpolated.cs string.quoted.double.block.cs +/// ^^^ - constant - invalid - punctuation +/// ^^^^ punctuation.section.interpolation.begin.cs +/// ^^^^^^^^^ source.cs variable.other.cs +/// ^^^^ punctuation.section.interpolation.end.cs +/// ^^^^^^^^^^ - constant - invalid - punctuation +/// ^^^^ invalid.illegal.unexpected-token.cs +/// ^^^ - constant - invalid - punctuation + + GMT is {{{{DateTime.Now,width:yyyyMMdd\THHmmss\Z}}}}! +///^^^^^^^^ meta.string.interpolated.cs string.quoted.double.block.cs +/// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.string.interpolated.cs meta.interpolation.cs - string +/// ^^ meta.string.interpolated.cs string.quoted.double.block.cs +/// ^^^^ punctuation.section.interpolation.begin.cs +/// ^^^^^^^^ variable.other.cs +/// ^ punctuation.accessor.dot.cs +/// ^^^ variable.other.cs +/// ^^^^^^^^^^^^^^^^^^^^^^^^^ meta.format-spec.cs +/// ^ punctuation.separator.cs +/// ^^^^^ variable.other.cs +/// ^ punctuation.separator.cs +/// ^^^^^^^^^^^^^^^^^^ constant.other.format-spec.cs - constant.character +/// ^ invalid.illegal.lone-escape.cs +/// ^ invalid.illegal.lone-escape.cs +/// ^^^^ punctuation.section.interpolation.end.cs + + "{{{{In+"complete":F"}}}} "{{{{Incomplete:F\"}}}} {{{{Brace:{}}}}} +///^^ meta.string.interpolated.cs string.quoted.double.block.cs +/// ^^^^^^^ meta.string.interpolated.cs meta.interpolation.cs - string +/// ^^^^^^^^^^ meta.string.interpolated.cs meta.interpolation.cs meta.string.cs +/// ^^ meta.string.interpolated.cs meta.interpolation.cs meta.format-spec.cs +/// ^^^^^^^ meta.string.interpolated.cs string.quoted.double.block.cs +/// ^^^^^^^^^^^^^^^^^ meta.string.interpolated.cs meta.interpolation.cs - string +/// ^^^^^^ meta.string.interpolated.cs string.quoted.double.block.cs +/// ^^^^^^^^^^^^^^^ meta.string.interpolated.cs meta.interpolation.cs - string +/// ^^ meta.string.interpolated.cs string.quoted.double.block.cs +/// ^^^^ punctuation.section.interpolation.begin.cs +/// ^^ variable.other.cs +/// ^ keyword.operator.arithmetic.cs +/// ^^^^^^^^^^ string.quoted.double.cs +/// ^^ meta.format-spec.cs +/// ^ punctuation.separator.cs +/// ^ constant.other.format-spec.cs +/// ^^^^ invalid.illegal.unexpected-token.cs +/// ^^^^ punctuation.section.interpolation.begin.cs +/// ^^^^^^^^^^ variable.other.cs +/// ^^^ meta.format-spec.cs +/// ^ punctuation.separator.cs +/// ^^ constant.other.format-spec.cs +/// ^ invalid.illegal.lone-escape.cs +/// ^^^^ invalid.illegal.unexpected-token.cs +/// ^^^^ punctuation.section.interpolation.begin.cs +/// ^^^^^ variable.other.cs +/// ^^ meta.format-spec.cs +/// ^ punctuation.separator.cs +/// ^ constant.other.format-spec.cs invalid.illegal.unescaped-placeholder.cs +/// ^^^ punctuation.section.interpolation.end.cs +/// ^ - invalid.illegal + """; +///^^^ meta.string.interpolated.cs string.quoted.double.block.cs +///^^^ punctuation.definition.string.end.cs +/// ^ punctuation.terminator.statement.cs + +var location = @$$$$""" +/// <- storage.type.variable +/// ^^^^^^^^ variable.other +/// ^ invalid.illegal.reserved-char.cs +/// ^^^^^ meta.string.interpolated string.quoted.double.block punctuation.definition.string.begin + + Escapes like \0 \a \f \n \t "" are literals. +///^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - constant - invalid - punctuation + + You are at {{{{{{{Longitude}}}}}}} \t {{{Latitude}}}} }}} +///^^^^^^^^^^^^^^^ meta.string.interpolated.cs string.quoted.double.block.cs +/// ^^^^^^^^^^^^^^^^^ meta.string.interpolated.cs meta.interpolation.cs - string +/// ^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.string.interpolated.cs string.quoted.double.block.cs +/// ^^^ - constant - invalid - punctuation +/// ^^^^ punctuation.section.interpolation.begin.cs +/// ^^^^^^^^^ source.cs variable.other.cs +/// ^^^^ punctuation.section.interpolation.end.cs +/// ^^^^^^^^^^ - constant - invalid - punctuation +/// ^^^^ invalid.illegal.unexpected-token.cs +/// ^^^ - constant - invalid - punctuation + + GMT is {{{{DateTime.Now,width:yyyyMMdd\THHmmss\Z}}}}! +///^^^^^^^^ meta.string.interpolated.cs string.quoted.double.block.cs +/// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.string.interpolated.cs meta.interpolation.cs - string +/// ^^ meta.string.interpolated.cs string.quoted.double.block.cs +/// ^^^^ punctuation.section.interpolation.begin.cs +/// ^^^^^^^^ variable.other.cs +/// ^ punctuation.accessor.dot.cs +/// ^^^ variable.other.cs +/// ^^^^^^^^^^^^^^^^^^^^^^^^^ meta.format-spec.cs +/// ^ punctuation.separator.cs +/// ^^^^^ variable.other.cs +/// ^ punctuation.separator.cs +/// ^^^^^^^^^^^^^^^^^^ constant.other.format-spec.cs - constant.character +/// ^ invalid.illegal.lone-escape.cs +/// ^ invalid.illegal.lone-escape.cs +/// ^^^^ punctuation.section.interpolation.end.cs + """; +///^^^ meta.string.interpolated.cs string.quoted.double.block.cs +///^^^ punctuation.definition.string.end.cs +/// ^ punctuation.terminator.statement.cs var pointMessage = $"""The point "{X}, {Y}" is {Math.Sqrt(X * X + Y * Y)} from the origin"""; -/// ^^^^ meta.string.interpolated string.quoted.triple punctuation.definition.string.begin +/// ^^^^ meta.string.interpolated string.quoted.double.block punctuation.definition.string.begin /// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.string.interpolated -/// ^^^^^^^^^^^ string.quoted.triple - meta.interpolation +/// ^^^^^^^^^^^ string.quoted.double.block - meta.interpolation /// ^^^ meta.interpolation - string -/// ^^ string.quoted.triple - meta.interpolation +/// ^^ string.quoted.double.block - meta.interpolation /// ^^^ meta.interpolation - string -/// ^^^^^ string.quoted.triple - meta.interpolation +/// ^^^^^ string.quoted.double.block - meta.interpolation /// ^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.interpolation - string -/// ^^^^^^^^^^^^^^^^^^^ string.quoted.triple - meta.interpolation +/// ^^^^^^^^^^^^^^^^^^^ string.quoted.double.block - meta.interpolation /// ^ punctuation.section.interpolation.begin /// ^ variable.other /// ^ punctuation.section.interpolation.end @@ -123,16 +589,17 @@ The following example shows how newlines can improve the readability of an expre // Horace is 34 years old. string s2 = @$"He said, ""This is the last \u0063hance\x0021"""; -/// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.string.interpolated string.quoted.double.raw +/// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.string.interpolated string.quoted.double.verbatim /// ^^^ punctuation.definition.string.begin /// ^^ constant.character.escape /// ^^^^^^^^^^^^^^^^^ - constant - string s2 = @$$"""He said, ""This is the last \u0063hance\x0021"""; -/// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.string.interpolated string.quoted.triple -/// ^^^^^^ punctuation.definition.string.begin -/// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - constant +/// ^ invalid.illegal.reserved-char.cs +/// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.string.interpolated string.quoted.double.block - constant +/// ^^^^^ punctuation.definition.string.begin +/// ^^ - constant.character +/// ^^^^^^^^^^^^^^^^^ - constant /// ^^^ punctuation.definition.string.end public class C2 { diff --git a/C#/tests/syntax_test_GeneralStructure.cs b/C#/tests/syntax_test_GeneralStructure.cs index 3817faad84..dbdbb8c644 100644 --- a/C#/tests/syntax_test_GeneralStructure.cs +++ b/C#/tests/syntax_test_GeneralStructure.cs @@ -1254,6 +1254,7 @@ void TestMe () { /// ^ invalid.illegal.unclosed-string-placeholder /// ^ punctuation.definition.string.end /// ^ string - invalid - constant.other - punctuation +/// ^ string - invalid - constant.other - punctuation formatted = string.Format("{0", myInt); /// ^^ constant.other.placeholder /// ^ invalid.illegal.unclosed-string-placeholder @@ -1262,6 +1263,7 @@ void TestMe () { /// ^^ constant.character.escape /// ^^^ invalid.illegal.unclosed-string-placeholder /// ^ punctuation.definition.string.end +/// ^ string - invalid - constant.other - punctuation formatted = string.Format("{1:\",{{}} {}", myInt, "}"); /// ^^^^^^^^^^^^^ constant.other.placeholder /// ^ punctuation.definition.placeholder.begin @@ -1269,6 +1271,8 @@ void TestMe () { /// ^^^^ constant.character.escape /// ^ invalid.illegal.unescaped-placeholder /// ^ punctuation.definition.placeholder.end +/// ^ string - invalid - constant.other - punctuation + formatted = string.Format(@"{0:00.00000{{}}test""} me", 5); /// ^^^^^^^^^^^^^^^^^^^^^^ constant.other.placeholder - invalid /// ^^^^ constant.character.escape @@ -1277,10 +1281,21 @@ void TestMe () { /// ^^^^^ variable.other - variable.parameter /// ^^^^^ variable.other - variable.parameter /// ^^ keyword.operator - keyword.operator.assignment + + formatted = string.Format(@"GMT is {{ } }}"); +/// ^^ constant.character.escape.cs +/// ^ - invalid +/// ^^ constant.character.escape.cs + formatted = string.Format("GMT is {{ } }}"); +/// ^^ constant.character.escape.cs +/// ^ - invalid +/// ^^ constant.character.escape.cs + formatted = string.Format(@"GMT is {0:yyyyMMdd\THHmmss\Z}", DateTime.Now.ToUniversalTime()); -/// ^^^^^^^^^^^^^^^^^^^^^^ string.quoted.double.raw constant.other.placeholder +/// ^^^^^^^^^^^^^^^^^^^^^^ string.quoted.double.verbatim constant.other.placeholder formatted = string.Format("GMT is {0:yyyyMMdd\\THHmmss\\Z}", DateTime.Now.ToUniversalTime()); /// ^^^^^^^^^^^^^^^^^^^^^^^^ string.quoted.double constant.other.placeholder + Console.WriteLine($@"GMT is {DateTime.Now:yyyyMMdd\THHmmss\Z}"); /// ^^^^^^^^^^^^^ meta.string.interpolated meta.interpolation - meta.format-spec /// ^^^^^^^^^^^^^^^^^^^ meta.string.interpolated meta.interpolation meta.format-spec @@ -1299,6 +1314,45 @@ void TestMe () { /// ^ invalid.illegal.lone-escape /// ^ punctuation.section.interpolation.end /// ^ punctuation.definition.string.end + Console.WriteLine(@$"GMT is {{ } }}"); +/// ^^ constant.character.escape.cs +/// ^ invalid.illegal.unescaped-placeholder.cs +/// ^^ constant.character.escape.cs + Console.WriteLine(@$"GMT is {DateTime.Now:"); +/// ^^^^^^^^^^^^^^ meta.string.interpolated meta.interpolation - meta.format-spec +/// ^ invalid.illegal.unclosed-string-placeholder.cs +/// ^ meta.string.interpolated punctuation.definition.string.end - meta.interpolation - meta.format-spec + Console.WriteLine(@$"GMT is {DateTime.Now:"""); +/// ^^^^^^^^^^^^^ meta.string.interpolated meta.interpolation - meta.format-spec +/// ^^^ meta.string.interpolated.cs meta.interpolation.cs meta.format-spec.cs +/// ^ meta.string.interpolated punctuation.definition.string.end - meta.interpolation - meta.format-spec + Console.WriteLine(@$"GMT is {DateTime.Now:yyyyMMdd\THHmmss\Z"); +/// ^^^^^^^^^^^^^ meta.string.interpolated meta.interpolation - meta.format-spec +/// ^^^^^^^^^^^^^^^^^^^ meta.string.interpolated meta.interpolation meta.format-spec +/// ^ meta.string.interpolated - meta.interpolation - meta.format-spec +/// ^ punctuation.separator - constant.other.format-spec +/// ^^^^^^^^^^^^^^^^^^ invalid.illegal.unclosed-string-placeholder.cs +/// ^ punctuation.definition.string.end + Console.WriteLine($"GMT is {{ } }}"); +/// ^^ constant.character.escape.cs +/// ^ invalid.illegal.unescaped-placeholder.cs +/// ^^ constant.character.escape.cs + Console.WriteLine($"GMT is {DateTime.Now:"); +/// ^^^^^^^^^^^^^^ meta.string.interpolated meta.interpolation - meta.format-spec +/// ^ invalid.illegal.unclosed-string-placeholder.cs +/// ^ meta.string.interpolated punctuation.definition.string.end - meta.interpolation - meta.format-spec + Console.WriteLine($"GMT is {DateTime.Now:"""); +/// ^^^^^^^^^^^^^^ meta.string.interpolated meta.interpolation - meta.format-spec +/// ^ invalid.illegal.unclosed-string-placeholder.cs +/// ^ meta.string.interpolated punctuation.definition.string.end - meta.interpolation - meta.format-spec +/// ^^ meta.string.cs string.quoted.double.cs punctuation + Console.WriteLine($"GMT is {DateTime.Now:yyyyMMdd\THHmmss\Z"); +/// ^^^^^^^^^^^^^ meta.string.interpolated meta.interpolation - meta.format-spec +/// ^^^^^^^^^^^^^^^^^^^ meta.string.interpolated meta.interpolation meta.format-spec +/// ^ meta.string.interpolated - meta.interpolation - meta.format-spec +/// ^ punctuation.separator - constant.other.format-spec +/// ^^^^^^^^^^^^^^^^^^ invalid.illegal.unclosed-string-placeholder.cs +/// ^ punctuation.definition.string.end Console.WriteLine($@"GMT is {DateTime.Now:yyyyMMdd\T\""\x1043HHmmss\Z}"); /// ^^^^^^^^^^^^^ meta.string.interpolated meta.interpolation - meta.format-spec /// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.string.interpolated meta.interpolation meta.format-spec diff --git a/C#/tests/syntax_test_Strings.cs b/C#/tests/syntax_test_Strings.cs index 660252c684..5a94f2861f 100644 --- a/C#/tests/syntax_test_Strings.cs +++ b/C#/tests/syntax_test_Strings.cs @@ -46,21 +46,33 @@ /// ^^^^^^ meta.string.interpolated.cs string.quoted.double.cs var interpolated_yes = $"foo {bar} foo"; /// ^^^^^^^^^^^^^^^^ meta.string.interpolated.cs +var interpolated_quotes = $"|{"Left",-7}|{"Right",7}|"; +/// ^^^ meta.string.interpolated.cs +/// ^ meta.string.interpolated.cs meta.interpolation.cs punctuation.section.interpolation.begin.cs +/// ^^^^^^ meta.string.interpolated.cs meta.interpolation.cs meta.string.cs string.quoted.double.cs +/// ^^^ meta.string.interpolated.cs meta.interpolation.cs meta.format-spec.cs - string +/// ^ meta.string.interpolated.cs meta.interpolation.cs punctuation.section.interpolation.end.cs +/// ^ meta.string.interpolated.cs string.quoted.double.cs +/// ^ meta.string.interpolated.cs meta.interpolation.cs punctuation.section.interpolation.begin.cs +/// ^^^^^^^ meta.string.interpolated.cs meta.interpolation.cs meta.string.cs string.quoted.double.cs +/// ^^ meta.string.interpolated.cs meta.interpolation.cs meta.format-spec.cs - string +/// ^ meta.string.interpolated.cs meta.interpolation.cs punctuation.section.interpolation.end.cs +/// ^^ meta.string.interpolated.cs string.quoted.double.cs var verbatim_singleline = @"foo"; -/// ^^^^^^ meta.string.cs string.quoted.double.raw.cs - meta.string.interpolated +/// ^^^^^^ meta.string.cs string.quoted.double.verbatim.cs - meta.string.interpolated var verbatim_singleline_interpolated_none = $@"foo bar"; -/// ^^^^^^^^^^^ meta.string.interpolated.cs string.quoted.double.raw.cs +/// ^^^^^^^^^^^ meta.string.interpolated.cs string.quoted.double.verbatim.cs var verbatim_singleline_interpolated_yes = $@"foo {bar} foo"; -/// ^^^^^^^ string.quoted.double.raw.cs +/// ^^^^^^^ string.quoted.double.verbatim.cs /// ^^^^^^^^^^^^^^^^^ meta.string.interpolated.cs var verbatim_multiline = @"foo bar -/// ^^^^^^^^^^ meta.string.cs string.quoted.double.raw.cs - meta.string.interpolated +/// ^^^^^^^^^^ meta.string.cs string.quoted.double.verbatim.cs - meta.string.interpolated baz"; var verbatim_multiline_interpolated_none = $@"foo bar -/// ^^^^^^^^^^^ meta.string.interpolated.cs string.quoted.double.raw.cs +/// ^^^^^^^^^^^ meta.string.interpolated.cs string.quoted.double.verbatim.cs baz"; var verbatim_multiline_interpolated_yes = $@"foo {bar} -/// ^^^^^^ string.quoted.double.raw.cs +/// ^^^^^^ string.quoted.double.verbatim.cs /// ^^^^^^^^^^^^ meta.string.interpolated.cs baz"; @@ -68,7 +80,7 @@ SELECT * FROM foo WHERE SQLi='{0}'"; -///^^^^^^^^^^^^^^^^^^^^ meta.string.cs string.quoted.double.raw.cs - meta.string.interpolated +///^^^^^^^^^^^^^^^^^^^^ meta.string.cs string.quoted.double.verbatim.cs - meta.string.interpolated ///^^^^^^^^^^^^^^^^^^^ source.sql /// ^^^^^ keyword.other.dml.sql /// ^^^^ meta.column-name.sql @@ -87,7 +99,7 @@ FROM foo SELECT * FROM foo WHERE SQLi='{bar}'"; -///^^^^^^^^^^^^^^^^^^^^^^ meta.string.interpolated.cs string.quoted.double.raw.cs +///^^^^^^^^^^^^^^^^^^^^^^ meta.string.interpolated.cs string.quoted.double.verbatim.cs ///^^^^^^^^^^^^^^^^^^^^^ source.sql /// ^^^^^ keyword.other.dml.sql /// ^^^^ meta.column-name.sql @@ -109,11 +121,11 @@ FROM foo """ SELECT * FROM some_table -/// ^^^^ meta.string.cs string.quoted.triple.cs source.sql keyword.other.dml.sql +/// ^^^^ meta.string.cs string.quoted.double.block.cs source.sql keyword.other.dml.sql """; -/// <- meta.string.cs string.quoted.triple.cs punctuation.definition.string.end.cs +/// <- meta.string.cs string.quoted.double.block.cs punctuation.definition.string.end.cs """ no sql here -/// ^^^^^^^^^^^^ meta.string.cs string.quoted.triple.cs - source.sql +/// ^^^^^^^^^^^^ meta.string.cs string.quoted.double.block.cs - source.sql """; diff --git a/C#/tests/syntax_test_c#.cs b/C#/tests/syntax_test_c#.cs index f9c8d212c5..09f1d3163d 100644 --- a/C#/tests/syntax_test_c#.cs +++ b/C#/tests/syntax_test_c#.cs @@ -33,10 +33,10 @@ void Run([Usage("help text")] int x, int y) } string verbatim = @"This is a test "" of a verbatim string literal - C:\User"; -// ^^ string.quoted.double.raw punctuation.definition.string.begin +// ^^ string.quoted.double.verbatim punctuation.definition.string.begin // ^^ constant.character.escape -// ^ string.quoted.double.raw - constant -// ^ string.quoted.double.raw punctuation.definition.string.end +// ^ string.quoted.double.verbatim - constant +// ^ string.quoted.double.verbatim punctuation.definition.string.end class A {