mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-08-23 20:04:21 +00:00
internal: start isolating ssr-related parsing APIs to SSR
This commit is contained in:
parent
634c7682c9
commit
b468bd6645
10 changed files with 44 additions and 45 deletions
|
@ -201,13 +201,6 @@ impl ast::Item {
|
|||
}
|
||||
}
|
||||
|
||||
impl ast::Type {
|
||||
/// Returns `text`, parsed as an type reference, but only if it has no errors.
|
||||
pub fn parse(text: &str) -> Result<Self, ()> {
|
||||
parsing::parse_text_as(text, parser::ParserEntryPoint::Type)
|
||||
}
|
||||
}
|
||||
|
||||
impl ast::Attr {
|
||||
/// Returns `text`, parsed as an attribute, but only if it has no errors.
|
||||
pub fn parse(text: &str) -> Result<Self, ()> {
|
||||
|
|
|
@ -95,15 +95,6 @@ fn item_parser_tests() {
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn type_parser_tests() {
|
||||
fragment_parser_dir_test(
|
||||
&["parser/fragments/type/ok"],
|
||||
&["parser/fragments/type/err"],
|
||||
crate::ast::Type::parse,
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn stmt_parser_tests() {
|
||||
fragment_parser_dir_test(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue