Pattern `[".."]` inside multi-line docstring
Hi 👋🏻
The parser fails on the following code
```
namespace App {
@doc("""
some ["doc"]
""")
@route("/route")
@post
op route(): Foo;
}
```
with the problematic part of the AST being
```
(decorator ; [1, 2] - [4, 18]
name: (identifier_or_member_expression ; [1, 3] - [1, 6]
(identifier ; [1, 3] - [1, 6]
(plain_identifier))) ; [1, 3] - [1, 6]
(decorator_arguments ; [1, 6] - [4, 18]
(ERROR ; [1, 7] - [4, 9]
(triple_quoted_string_fragment) ; [1, 10] - [2, 10]
(expression_list ; [2, 10] - [2, 15]
(quoted_string_literal ; [2, 10] - [2, 15]
(quoted_string_fragment))) ; [2, 11] - [2, 14]
(triple_quoted_string_fragment)) ; [3, 7] - [4, 9]
(expression_list ; [4, 9] - [4, 17]
(quoted_string_literal ; [4, 9] - [4, 17]
(quoted_string_fragment)))))
```
Removing any of `["` or `"]` fixes parsing.
Tested in neovim
关闭于 2026-01-01 2 条评论