Skip to content

Failed to parse interpolated verbatim string #368

@vanessa-rodrigues

Description

@vanessa-rodrigues

The following code displays an error when parsing.

var p = 1;
var c = $@"""{p}""";
(compilation_unit [0, 0] - [1, 20]
  (global_statement [0, 0] - [0, 10]
    (local_declaration_statement [0, 0] - [0, 10]
      (variable_declaration [0, 0] - [0, 9]
        type: (implicit_type [0, 0] - [0, 3])
        (variable_declarator [0, 4] - [0, 9]
          name: (identifier [0, 4] - [0, 5])
          (integer_literal [0, 8] - [0, 9])))))
  (ERROR [1, 0] - [1, 20]
    (implicit_type [1, 0] - [1, 3])
    (identifier [1, 4] - [1, 5])
    (interpolation_start [1, 8] - [1, 10])
    (interpolation [1, 11] - [1, 16]
      (interpolation_brace [1, 11] - [1, 14])
      (identifier [1, 14] - [1, 15])
      (interpolation_brace [1, 15] - [1, 16]))
    (string_content [1, 16] - [1, 20])))
.\tests.cs         0.52 ms          62 bytes/ms (ERROR [1, 0] - [1, 20])

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions