mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-11-15 01:17:27 +00:00
Merge #808
808: rename yellow -> syntax_node r=matklad a=matklad Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
commit
afdcfb79b9
18 changed files with 20 additions and 20 deletions
|
@ -6,7 +6,7 @@ use itertools::Itertools;
|
|||
|
||||
pub use self::generated::*;
|
||||
use crate::{
|
||||
yellow::{SyntaxNode, SyntaxNodeChildren, TreeArc, RaTypes},
|
||||
syntax_node::{SyntaxNode, SyntaxNodeChildren, TreeArc, RaTypes},
|
||||
SmolStr,
|
||||
SyntaxKind::*,
|
||||
};
|
||||
|
|
|
@ -13,7 +13,7 @@ use rowan::TransparentNewType;
|
|||
|
||||
use crate::{
|
||||
SyntaxNode, SyntaxKind::*,
|
||||
yellow::{RaTypes, TreeArc},
|
||||
syntax_node::{RaTypes, TreeArc},
|
||||
ast::{self, AstNode},
|
||||
};
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ use rowan::TransparentNewType;
|
|||
|
||||
use crate::{
|
||||
SyntaxNode, SyntaxKind::*,
|
||||
yellow::{RaTypes, TreeArc},
|
||||
syntax_node::{RaTypes, TreeArc},
|
||||
ast::{self, AstNode},
|
||||
};
|
||||
{% for node, methods in ast %}
|
||||
|
|
|
@ -30,7 +30,7 @@ mod syntax_kinds;
|
|||
/// Utilities for simple uses of the parser.
|
||||
pub mod utils;
|
||||
mod validation;
|
||||
mod yellow;
|
||||
mod syntax_node;
|
||||
mod ptr;
|
||||
|
||||
pub use rowan::{SmolStr, TextRange, TextUnit};
|
||||
|
@ -38,12 +38,12 @@ pub use crate::{
|
|||
ast::AstNode,
|
||||
lexer::{tokenize, Token},
|
||||
syntax_kinds::SyntaxKind,
|
||||
yellow::{Direction, SyntaxError, SyntaxNode, WalkEvent, Location, TreeArc},
|
||||
syntax_node::{Direction, SyntaxError, SyntaxNode, WalkEvent, Location, TreeArc},
|
||||
ptr::{SyntaxNodePtr, AstPtr},
|
||||
};
|
||||
|
||||
use ra_text_edit::AtomTextEdit;
|
||||
use crate::yellow::GreenNode;
|
||||
use crate::syntax_node::GreenNode;
|
||||
|
||||
/// `SourceFile` represents a parse tree for a single Rust file.
|
||||
pub use crate::ast::SourceFile;
|
||||
|
@ -61,7 +61,7 @@ impl SourceFile {
|
|||
pub fn parse(text: &str) -> TreeArc<SourceFile> {
|
||||
let tokens = tokenize(&text);
|
||||
let (green, errors) =
|
||||
parser_impl::parse_with(yellow::GreenBuilder::new(), text, &tokens, grammar::root);
|
||||
parser_impl::parse_with(syntax_node::GreenBuilder::new(), text, &tokens, grammar::root);
|
||||
SourceFile::new(green, errors)
|
||||
}
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ use crate::{
|
|||
input::{InputPosition, ParserInput},
|
||||
},
|
||||
SmolStr,
|
||||
yellow::syntax_error::{
|
||||
syntax_node::syntax_error::{
|
||||
ParseError,
|
||||
SyntaxError,
|
||||
},
|
||||
|
|
|
@ -13,7 +13,7 @@ use crate::{
|
|||
SmolStr,
|
||||
SyntaxKind::{self, *},
|
||||
TextRange, TextUnit,
|
||||
yellow::syntax_error::{
|
||||
syntax_node::syntax_error::{
|
||||
ParseError,
|
||||
SyntaxError,
|
||||
SyntaxErrorKind,
|
||||
|
|
|
@ -3,7 +3,7 @@ use crate::grammar;
|
|||
use crate::lexer::{tokenize, Token};
|
||||
use crate::parser_api::Parser;
|
||||
use crate::parser_impl;
|
||||
use crate::yellow::{self, GreenNode, SyntaxError, SyntaxNode};
|
||||
use crate::syntax_node::{self, GreenNode, SyntaxError, SyntaxNode};
|
||||
use crate::{SyntaxKind::*, TextRange, TextUnit};
|
||||
use ra_text_edit::AtomTextEdit;
|
||||
|
||||
|
@ -56,7 +56,7 @@ fn reparse_block<'node>(
|
|||
return None;
|
||||
}
|
||||
let (green, new_errors) =
|
||||
parser_impl::parse_with(yellow::GreenBuilder::new(), &text, &tokens, reparser);
|
||||
parser_impl::parse_with(syntax_node::GreenBuilder::new(), &text, &tokens, reparser);
|
||||
Some((node, green, new_errors))
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use crate::{
|
||||
parser_impl::Sink,
|
||||
yellow::{GreenNode, RaTypes, SyntaxError},
|
||||
syntax_node::{GreenNode, RaTypes, SyntaxError},
|
||||
SmolStr, SyntaxKind,
|
||||
};
|
||||
use rowan::GreenNodeBuilder;
|
|
@ -5,7 +5,7 @@ mod string;
|
|||
mod block;
|
||||
|
||||
use crate::{
|
||||
SourceFile, yellow::SyntaxError, AstNode,
|
||||
SourceFile, syntax_node::SyntaxError, AstNode,
|
||||
ast,
|
||||
algo::visit::{visitor_ctx, VisitorCtx},
|
||||
};
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use crate::{SyntaxKind::*,
|
||||
ast::{self, AttrsOwner, AstNode},
|
||||
yellow::{
|
||||
syntax_node::{
|
||||
SyntaxError,
|
||||
SyntaxErrorKind::*,
|
||||
},
|
||||
|
|
|
@ -5,7 +5,7 @@ use crate::{
|
|||
string_lexing::{self, StringComponentKind},
|
||||
TextRange,
|
||||
validation::char,
|
||||
yellow::{
|
||||
syntax_node::{
|
||||
SyntaxError,
|
||||
SyntaxErrorKind::*,
|
||||
},
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use crate::{
|
||||
ast::{self, AstNode, AstToken},
|
||||
string_lexing::{self, StringComponentKind},
|
||||
yellow::{
|
||||
syntax_node::{
|
||||
SyntaxError,
|
||||
SyntaxErrorKind::*,
|
||||
},
|
||||
|
|
|
@ -8,7 +8,7 @@ use crate::{
|
|||
ast::{self, AstNode, AstToken},
|
||||
string_lexing::{self, StringComponentKind},
|
||||
TextRange,
|
||||
yellow::{
|
||||
syntax_node::{
|
||||
SyntaxError,
|
||||
SyntaxErrorKind::*,
|
||||
},
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use crate::{
|
||||
ast::{self, AstNode, AstToken},
|
||||
string_lexing,
|
||||
yellow::{
|
||||
syntax_node::{
|
||||
SyntaxError,
|
||||
SyntaxErrorKind::*,
|
||||
},
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
}
|
||||
pub fn parse(text: &str) -> File {
|
||||
let tokens = tokenize(&text);
|
||||
let (green, errors) = parser_impl::parse_with::<yellow::GreenBuilder>(
|
||||
let (green, errors) = parser_impl::parse_with::<syntax_node::GreenBuilder>(
|
||||
text, &tokens, grammar::root,
|
||||
);
|
||||
File::new(green, errors)
|
||||
|
@ -24,7 +24,7 @@
|
|||
if !is_balanced(&tokens) {
|
||||
return None;
|
||||
}
|
||||
let (green, new_errors) = parser_impl::parse_with::<yellow::GreenBuilder>(
|
||||
let (green, new_errors) = parser_impl::parse_with::<syntax_node::GreenBuilder>(
|
||||
&te2t, &tokens, reparser,
|
||||
);
|
||||
let green_root = node.replace_with(green);
|
||||
|
|
Loading…
Reference in a new issue