Fixes
This commit is contained in:
parent
5a4b4f507e
commit
f7e12559cb
2 changed files with 8 additions and 19 deletions
|
@ -25,17 +25,15 @@ fn attribute(p: &mut Parser, inner: bool) {
|
|||
if p.eat(T!['[']) {
|
||||
paths::use_path(p);
|
||||
|
||||
let is_delimiter = |p: &mut Parser| match p.current() {
|
||||
T!['('] | T!['['] | T!['{'] => true,
|
||||
_ => false,
|
||||
};
|
||||
|
||||
if p.eat(T![=]) {
|
||||
match p.current() {
|
||||
T![=] => {
|
||||
p.bump(T![=]);
|
||||
if expressions::literal(p).is_none() {
|
||||
p.error("expected literal");
|
||||
}
|
||||
} else if is_delimiter(p) {
|
||||
items::token_tree(p);
|
||||
}
|
||||
T!['('] | T!['['] | T!['{'] => items::token_tree(p),
|
||||
_ => {}
|
||||
}
|
||||
|
||||
if !p.eat(T![']']) {
|
||||
|
|
|
@ -36,15 +36,6 @@ fn text_of_first_token(node: &SyntaxNode) -> &SmolStr {
|
|||
}
|
||||
|
||||
impl ast::Attr {
|
||||
pub fn is_inner(&self) -> bool {
|
||||
let prev = match self.syntax().prev_sibling() {
|
||||
None => return false,
|
||||
Some(prev) => prev,
|
||||
};
|
||||
|
||||
prev.kind() == T![!]
|
||||
}
|
||||
|
||||
pub fn as_simple_atom(&self) -> Option<SmolStr> {
|
||||
match self.input() {
|
||||
None => self.simple_name(),
|
||||
|
|
Loading…
Add table
Reference in a new issue