mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-08-20 10:30:34 +00:00
parser,syntax: Add separate parser for stmt with optional semicolon
Adjusting `grammar::fragments::stmt` to Optional or Yes will break original functionality and tests.
This commit is contained in:
parent
cc081b7e1c
commit
42da26e959
15 changed files with 72 additions and 5 deletions
|
@ -215,7 +215,7 @@ impl ast::Attr {
|
|||
impl ast::Stmt {
|
||||
/// Returns `text`, parsed as statement, but only if it has no errors.
|
||||
pub fn parse(text: &str) -> Result<Self, ()> {
|
||||
parsing::parse_text_fragment(text, parser::FragmentKind::Statement)
|
||||
parsing::parse_text_fragment(text, parser::FragmentKind::StatementOptionalSemi)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue