mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-02 07:22:42 +00:00
internal: more reasonable grammar for blocks
Consider these expples { 92 } async { 92 } 'a: { 92 } #[a] { 92 } Previously the tree for them were BLOCK_EXPR { ... } EFFECT_EXPR async BLOCK_EXPR { ... } EFFECT_EXPR 'a: BLOCK_EXPR { ... } BLOCK_EXPR #[a] { ... } As you see, it gets progressively worse :) The last two items are especially odd. The last one even violates the balanced curleys invariant we have (#10357) The new approach is to say that the stuff in `{}` is stmt_list, and the block is stmt_list + optional modifiers BLOCK_EXPR STMT_LIST { ... } BLOCK_EXPR async STMT_LIST { ... } BLOCK_EXPR 'a: STMT_LIST { ... } BLOCK_EXPR #[a] STMT_LIST { ... }
This commit is contained in:
parent
c51a3c78cf
commit
2bf81922f7
4
Cargo.lock
generated
4
Cargo.lock
generated
@ -1760,9 +1760,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "ungrammar"
|
||||
version = "1.14.4"
|
||||
version = "1.14.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0d6e36d57b143472488b1594fe25c376fa9683bccfd80d858b2180c97806835b"
|
||||
checksum = "395e988af2480b8a8118ad1d5f1f790197d332e3e2585231f742949b63080ef5"
|
||||
|
||||
[[package]]
|
||||
name = "unicase"
|
||||
|
@ -698,7 +698,7 @@ impl<'db> SemanticsImpl<'db> {
|
||||
ast::ForExpr(it) => it.label(),
|
||||
ast::WhileExpr(it) => it.label(),
|
||||
ast::LoopExpr(it) => it.label(),
|
||||
ast::EffectExpr(it) => it.label(),
|
||||
ast::BlockExpr(it) => it.label(),
|
||||
_ => None,
|
||||
}
|
||||
};
|
||||
|
@ -524,7 +524,8 @@ fn inner_attributes(
|
||||
},
|
||||
ast::Fn(it) => {
|
||||
let body = it.body()?;
|
||||
(body.attrs(), ast::CommentIter::from_syntax_node(body.syntax()))
|
||||
let stmt_list = body.stmt_list()?;
|
||||
(stmt_list.attrs(), ast::CommentIter::from_syntax_node(body.syntax()))
|
||||
},
|
||||
ast::Impl(it) => {
|
||||
let assoc_item_list = it.assoc_item_list()?;
|
||||
|
@ -245,43 +245,37 @@ impl ExprCollector<'_> {
|
||||
|
||||
self.alloc_expr(Expr::If { condition, then_branch, else_branch }, syntax_ptr)
|
||||
}
|
||||
ast::Expr::EffectExpr(e) => match e.effect() {
|
||||
ast::Effect::Try(_) => {
|
||||
let body = self.collect_block_opt(e.block_expr());
|
||||
ast::Expr::BlockExpr(e) => match e.modifier() {
|
||||
Some(ast::BlockModifier::Try(_)) => {
|
||||
let body = self.collect_block(e);
|
||||
self.alloc_expr(Expr::TryBlock { body }, syntax_ptr)
|
||||
}
|
||||
ast::Effect::Unsafe(_) => {
|
||||
let body = self.collect_block_opt(e.block_expr());
|
||||
Some(ast::BlockModifier::Unsafe(_)) => {
|
||||
let body = self.collect_block(e);
|
||||
self.alloc_expr(Expr::Unsafe { body }, syntax_ptr)
|
||||
}
|
||||
// FIXME: we need to record these effects somewhere...
|
||||
ast::Effect::Label(label) => {
|
||||
Some(ast::BlockModifier::Label(label)) => {
|
||||
let label = self.collect_label(label);
|
||||
match e.block_expr() {
|
||||
Some(block) => {
|
||||
let res = self.collect_block(block);
|
||||
match &mut self.body.exprs[res] {
|
||||
Expr::Block { label: block_label, .. } => {
|
||||
*block_label = Some(label);
|
||||
}
|
||||
_ => unreachable!(),
|
||||
}
|
||||
res
|
||||
let res = self.collect_block(e);
|
||||
match &mut self.body.exprs[res] {
|
||||
Expr::Block { label: block_label, .. } => {
|
||||
*block_label = Some(label);
|
||||
}
|
||||
None => self.missing_expr(),
|
||||
_ => unreachable!(),
|
||||
}
|
||||
res
|
||||
}
|
||||
// FIXME: we need to record these effects somewhere...
|
||||
ast::Effect::Async(_) => {
|
||||
let body = self.collect_block_opt(e.block_expr());
|
||||
Some(ast::BlockModifier::Async(_)) => {
|
||||
let body = self.collect_block(e);
|
||||
self.alloc_expr(Expr::Async { body }, syntax_ptr)
|
||||
}
|
||||
ast::Effect::Const(_) => {
|
||||
let body = self.collect_block_opt(e.block_expr());
|
||||
Some(ast::BlockModifier::Const(_)) => {
|
||||
let body = self.collect_block(e);
|
||||
self.alloc_expr(Expr::Const { body }, syntax_ptr)
|
||||
}
|
||||
None => self.collect_block(e),
|
||||
},
|
||||
ast::Expr::BlockExpr(e) => self.collect_block(e),
|
||||
ast::Expr::LoopExpr(e) => {
|
||||
let label = e.label().map(|label| self.collect_label(label));
|
||||
let body = self.collect_block_opt(e.loop_body());
|
||||
|
@ -721,7 +721,7 @@ impl ExpandTo {
|
||||
|
||||
match parent.kind() {
|
||||
MACRO_ITEMS | SOURCE_FILE | ITEM_LIST => ExpandTo::Items,
|
||||
MACRO_STMTS | EXPR_STMT | BLOCK_EXPR => ExpandTo::Statements,
|
||||
MACRO_STMTS | EXPR_STMT | STMT_LIST => ExpandTo::Statements,
|
||||
MACRO_PAT => ExpandTo::Pattern,
|
||||
MACRO_TYPE => ExpandTo::Type,
|
||||
|
||||
|
@ -1083,22 +1083,22 @@ fn dyn_trait_super_trait_not_in_scope() {
|
||||
fn method_resolution_foreign_opaque_type() {
|
||||
check_infer(
|
||||
r#"
|
||||
extern "C" {
|
||||
type S;
|
||||
fn f() -> &'static S;
|
||||
}
|
||||
extern "C" {
|
||||
type S;
|
||||
fn f() -> &'static S;
|
||||
}
|
||||
|
||||
impl S {
|
||||
fn foo(&self) -> bool {
|
||||
true
|
||||
}
|
||||
}
|
||||
impl S {
|
||||
fn foo(&self) -> bool {
|
||||
true
|
||||
}
|
||||
}
|
||||
|
||||
fn test() {
|
||||
let s = unsafe { f() };
|
||||
s.foo();
|
||||
}
|
||||
"#,
|
||||
fn test() {
|
||||
let s = unsafe { f() };
|
||||
s.foo();
|
||||
}
|
||||
"#,
|
||||
expect![[r#"
|
||||
75..79 'self': &S
|
||||
89..109 '{ ... }': bool
|
||||
@ -1106,7 +1106,7 @@ fn method_resolution_foreign_opaque_type() {
|
||||
123..167 '{ ...o(); }': ()
|
||||
133..134 's': &S
|
||||
137..151 'unsafe { f() }': &S
|
||||
144..151 '{ f() }': &S
|
||||
137..151 'unsafe { f() }': &S
|
||||
146..147 'f': fn f() -> &S
|
||||
146..149 'f()': &S
|
||||
157..158 's': &S
|
||||
|
@ -352,7 +352,7 @@ unsafe fn baz(u: MyUnion) {
|
||||
71..89 'MyUnio...o: 0 }': MyUnion
|
||||
86..87 '0': u32
|
||||
95..113 'unsafe...(u); }': ()
|
||||
102..113 '{ baz(u); }': ()
|
||||
95..113 'unsafe...(u); }': ()
|
||||
104..107 'baz': fn baz(MyUnion)
|
||||
104..110 'baz(u)': ()
|
||||
108..109 'u': MyUnion
|
||||
@ -360,7 +360,7 @@ unsafe fn baz(u: MyUnion) {
|
||||
126..146 'MyUnio... 0.0 }': MyUnion
|
||||
141..144 '0.0': f32
|
||||
152..170 'unsafe...(u); }': ()
|
||||
159..170 '{ baz(u); }': ()
|
||||
152..170 'unsafe...(u); }': ()
|
||||
161..164 'baz': fn baz(MyUnion)
|
||||
161..167 'baz(u)': ()
|
||||
165..166 'u': MyUnion
|
||||
@ -1914,41 +1914,41 @@ fn fn_pointer_return() {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn effects_smoke_test() {
|
||||
fn block_modifiers_smoke_test() {
|
||||
check_infer(
|
||||
r#"
|
||||
//- minicore: future
|
||||
async fn main() {
|
||||
let x = unsafe { 92 };
|
||||
let y = async { async { () }.await };
|
||||
let z = try { () };
|
||||
let w = const { 92 };
|
||||
let t = 'a: { 92 };
|
||||
}
|
||||
//- minicore: future
|
||||
async fn main() {
|
||||
let x = unsafe { 92 };
|
||||
let y = async { async { () }.await };
|
||||
let z = try { () };
|
||||
let w = const { 92 };
|
||||
let t = 'a: { 92 };
|
||||
}
|
||||
"#,
|
||||
expect![[r#"
|
||||
16..162 '{ ...2 }; }': ()
|
||||
26..27 'x': i32
|
||||
30..43 'unsafe { 92 }': i32
|
||||
37..43 '{ 92 }': i32
|
||||
30..43 'unsafe { 92 }': i32
|
||||
39..41 '92': i32
|
||||
53..54 'y': impl Future<Output = ()>
|
||||
57..85 'async ...wait }': ()
|
||||
57..85 'async ...wait }': impl Future<Output = ()>
|
||||
63..85 '{ asyn...wait }': ()
|
||||
65..77 'async { () }': ()
|
||||
65..77 'async { () }': impl Future<Output = ()>
|
||||
65..83 'async ....await': ()
|
||||
71..77 '{ () }': ()
|
||||
73..75 '()': ()
|
||||
95..96 'z': {unknown}
|
||||
99..109 'try { () }': ()
|
||||
99..109 'try { () }': {unknown}
|
||||
103..109 '{ () }': ()
|
||||
105..107 '()': ()
|
||||
119..120 'w': i32
|
||||
123..135 'const { 92 }': i32
|
||||
129..135 '{ 92 }': i32
|
||||
123..135 'const { 92 }': i32
|
||||
131..133 '92': i32
|
||||
145..146 't': i32
|
||||
153..159 '{ 92 }': i32
|
||||
149..159 ''a: { 92 }': i32
|
||||
155..157 '92': i32
|
||||
"#]],
|
||||
)
|
||||
@ -2104,32 +2104,32 @@ fn infer_labelled_break_with_val() {
|
||||
fn infer_labelled_block_break_with_val() {
|
||||
check_infer(
|
||||
r#"
|
||||
fn default<T>() -> T { loop {} }
|
||||
fn foo() {
|
||||
let _x = 'outer: {
|
||||
let inner = 'inner: {
|
||||
let i = default();
|
||||
if (break 'outer i) {
|
||||
break 'inner 5i8;
|
||||
} else if true {
|
||||
break 'inner 6;
|
||||
}
|
||||
break 'inner 'innermost: { 0 };
|
||||
42
|
||||
};
|
||||
break 'outer inner < 8;
|
||||
};
|
||||
}
|
||||
"#,
|
||||
fn default<T>() -> T { loop {} }
|
||||
fn foo() {
|
||||
let _x = 'outer: {
|
||||
let inner = 'inner: {
|
||||
let i = default();
|
||||
if (break 'outer i) {
|
||||
break 'inner 5i8;
|
||||
} else if true {
|
||||
break 'inner 6;
|
||||
}
|
||||
break 'inner 'innermost: { 0 };
|
||||
42
|
||||
};
|
||||
break 'outer inner < 8;
|
||||
};
|
||||
}
|
||||
"#,
|
||||
expect![[r#"
|
||||
21..32 '{ loop {} }': T
|
||||
23..30 'loop {}': !
|
||||
28..30 '{}': ()
|
||||
42..381 '{ ... }; }': ()
|
||||
52..54 '_x': bool
|
||||
65..378 '{ ... }': bool
|
||||
57..378 ''outer... }': bool
|
||||
79..84 'inner': i8
|
||||
95..339 '{ ... }': i8
|
||||
87..339 ''inner... }': i8
|
||||
113..114 'i': bool
|
||||
117..124 'default': fn default<bool>() -> bool
|
||||
117..126 'default()': bool
|
||||
@ -2145,7 +2145,7 @@ fn infer_labelled_block_break_with_val() {
|
||||
241..255 'break 'inner 6': !
|
||||
254..255 '6': i8
|
||||
283..313 'break ... { 0 }': !
|
||||
308..313 '{ 0 }': i8
|
||||
296..313 ''inner... { 0 }': i8
|
||||
310..311 '0': i8
|
||||
327..329 '42': i8
|
||||
349..371 'break ...er < 8': !
|
||||
|
@ -164,8 +164,8 @@ fn highlight_exit_points(
|
||||
match anc {
|
||||
ast::Fn(fn_) => hl(sema, fn_.body().map(ast::Expr::BlockExpr)),
|
||||
ast::ClosureExpr(closure) => hl(sema, closure.body()),
|
||||
ast::EffectExpr(effect) => if matches!(effect.effect(), ast::Effect::Async(_) | ast::Effect::Try(_)| ast::Effect::Const(_)) {
|
||||
hl(sema, effect.block_expr().map(ast::Expr::BlockExpr))
|
||||
ast::BlockExpr(block_expr) => if matches!(block_expr.modifier(), Some(ast::BlockModifier::Async(_) | ast::BlockModifier::Try(_)| ast::BlockModifier::Const(_))) {
|
||||
hl(sema, Some(block_expr.into()))
|
||||
} else {
|
||||
continue;
|
||||
},
|
||||
@ -180,7 +180,7 @@ fn highlight_break_points(token: SyntaxToken) -> Option<Vec<HighlightedRange>> {
|
||||
fn hl(
|
||||
token: Option<SyntaxToken>,
|
||||
label: Option<ast::Label>,
|
||||
body: Option<ast::BlockExpr>,
|
||||
body: Option<ast::StmtList>,
|
||||
) -> Option<Vec<HighlightedRange>> {
|
||||
let mut highlights = Vec::new();
|
||||
let range = cover_range(
|
||||
@ -204,7 +204,7 @@ fn highlight_break_points(token: SyntaxToken) -> Option<Vec<HighlightedRange>> {
|
||||
ast::LoopExpr(l) => l.label().and_then(|it| it.lifetime()),
|
||||
ast::ForExpr(f) => f.label().and_then(|it| it.lifetime()),
|
||||
ast::WhileExpr(w) => w.label().and_then(|it| it.lifetime()),
|
||||
ast::EffectExpr(b) => Some(b.label().and_then(|it| it.lifetime())?),
|
||||
ast::BlockExpr(b) => Some(b.label().and_then(|it| it.lifetime())?),
|
||||
_ => return None,
|
||||
}
|
||||
};
|
||||
@ -218,16 +218,16 @@ fn highlight_break_points(token: SyntaxToken) -> Option<Vec<HighlightedRange>> {
|
||||
for anc in token.ancestors().flat_map(ast::Expr::cast) {
|
||||
return match anc {
|
||||
ast::Expr::LoopExpr(l) if label_matches(l.label()) => {
|
||||
hl(l.loop_token(), l.label(), l.loop_body())
|
||||
hl(l.loop_token(), l.label(), l.loop_body().and_then(|it| it.stmt_list()))
|
||||
}
|
||||
ast::Expr::ForExpr(f) if label_matches(f.label()) => {
|
||||
hl(f.for_token(), f.label(), f.loop_body())
|
||||
hl(f.for_token(), f.label(), f.loop_body().and_then(|it| it.stmt_list()))
|
||||
}
|
||||
ast::Expr::WhileExpr(w) if label_matches(w.label()) => {
|
||||
hl(w.while_token(), w.label(), w.loop_body())
|
||||
hl(w.while_token(), w.label(), w.loop_body().and_then(|it| it.stmt_list()))
|
||||
}
|
||||
ast::Expr::EffectExpr(e) if e.label().is_some() && label_matches(e.label()) => {
|
||||
hl(None, e.label(), e.block_expr())
|
||||
ast::Expr::BlockExpr(e) if e.label().is_some() && label_matches(e.label()) => {
|
||||
hl(None, e.label(), e.stmt_list())
|
||||
}
|
||||
_ => continue,
|
||||
};
|
||||
@ -258,7 +258,12 @@ fn highlight_yield_points(token: SyntaxToken) -> Option<Vec<HighlightedRange>> {
|
||||
return match_ast! {
|
||||
match anc {
|
||||
ast::Fn(fn_) => hl(fn_.async_token(), fn_.body().map(ast::Expr::BlockExpr)),
|
||||
ast::EffectExpr(effect) => hl(effect.async_token(), effect.block_expr().map(ast::Expr::BlockExpr)),
|
||||
ast::BlockExpr(block_expr) => {
|
||||
if block_expr.async_token().is_none() {
|
||||
continue;
|
||||
}
|
||||
hl(block_expr.async_token(), Some(block_expr.into()))
|
||||
},
|
||||
ast::ClosureExpr(closure) => hl(closure.async_token(), closure.body()),
|
||||
_ => continue,
|
||||
}
|
||||
|
@ -86,8 +86,8 @@ pub(super) fn try_expr(
|
||||
ast::Fn(fn_) => sema.to_def(&fn_)?.ret_type(sema.db),
|
||||
ast::Item(__) => return None,
|
||||
ast::ClosureExpr(closure) => sema.type_of_expr(&closure.body()?)?.original,
|
||||
ast::EffectExpr(effect) => if matches!(effect.effect(), ast::Effect::Async(_) | ast::Effect::Try(_)| ast::Effect::Const(_)) {
|
||||
sema.type_of_expr(&effect.block_expr()?.into())?.original
|
||||
ast::BlockExpr(block_expr) => if matches!(block_expr.modifier(), Some(ast::BlockModifier::Async(_) | ast::BlockModifier::Try(_)| ast::BlockModifier::Const(_))) {
|
||||
sema.type_of_expr(&block_expr.into())?.original
|
||||
} else {
|
||||
continue;
|
||||
},
|
||||
|
@ -212,7 +212,7 @@ fn remove_newline(
|
||||
}
|
||||
|
||||
fn join_single_expr_block(edit: &mut TextEditBuilder, token: &SyntaxToken) -> Option<()> {
|
||||
let block_expr = ast::BlockExpr::cast(token.parent()?)?;
|
||||
let block_expr = ast::BlockExpr::cast(token.ancestors().nth(1)?)?;
|
||||
if !block_expr.is_standalone() {
|
||||
return None;
|
||||
}
|
||||
|
@ -133,8 +133,9 @@ mod tests {
|
||||
R_PAREN@7..8 ")"
|
||||
WHITESPACE@8..9 " "
|
||||
BLOCK_EXPR@9..11
|
||||
L_CURLY@9..10 "{"
|
||||
R_CURLY@10..11 "}"
|
||||
STMT_LIST@9..11
|
||||
L_CURLY@9..10 "{"
|
||||
R_CURLY@10..11 "}"
|
||||
"#]],
|
||||
);
|
||||
|
||||
@ -158,25 +159,26 @@ fn test() {
|
||||
R_PAREN@8..9 ")"
|
||||
WHITESPACE@9..10 " "
|
||||
BLOCK_EXPR@10..60
|
||||
L_CURLY@10..11 "{"
|
||||
WHITESPACE@11..16 "\n "
|
||||
EXPR_STMT@16..58
|
||||
MACRO_CALL@16..57
|
||||
PATH@16..22
|
||||
PATH_SEGMENT@16..22
|
||||
NAME_REF@16..22
|
||||
IDENT@16..22 "assert"
|
||||
BANG@22..23 "!"
|
||||
TOKEN_TREE@23..57
|
||||
L_PAREN@23..24 "("
|
||||
STRING@24..52 "\"\n fn foo() {\n ..."
|
||||
COMMA@52..53 ","
|
||||
WHITESPACE@53..54 " "
|
||||
STRING@54..56 "\"\""
|
||||
R_PAREN@56..57 ")"
|
||||
SEMICOLON@57..58 ";"
|
||||
WHITESPACE@58..59 "\n"
|
||||
R_CURLY@59..60 "}"
|
||||
STMT_LIST@10..60
|
||||
L_CURLY@10..11 "{"
|
||||
WHITESPACE@11..16 "\n "
|
||||
EXPR_STMT@16..58
|
||||
MACRO_CALL@16..57
|
||||
PATH@16..22
|
||||
PATH_SEGMENT@16..22
|
||||
NAME_REF@16..22
|
||||
IDENT@16..22 "assert"
|
||||
BANG@22..23 "!"
|
||||
TOKEN_TREE@23..57
|
||||
L_PAREN@23..24 "("
|
||||
STRING@24..52 "\"\n fn foo() {\n ..."
|
||||
COMMA@52..53 ","
|
||||
WHITESPACE@53..54 " "
|
||||
STRING@54..56 "\"\""
|
||||
R_PAREN@56..57 ")"
|
||||
SEMICOLON@57..58 ";"
|
||||
WHITESPACE@58..59 "\n"
|
||||
R_CURLY@59..60 "}"
|
||||
"#]],
|
||||
)
|
||||
}
|
||||
@ -196,8 +198,9 @@ fn test() {
|
||||
R_PAREN@7..8 ")"
|
||||
WHITESPACE@8..9 " "
|
||||
BLOCK_EXPR@9..11
|
||||
L_CURLY@9..10 "{"
|
||||
R_CURLY@10..11 "}"
|
||||
STMT_LIST@9..11
|
||||
L_CURLY@9..10 "{"
|
||||
R_CURLY@10..11 "}"
|
||||
"#]],
|
||||
);
|
||||
|
||||
@ -252,9 +255,10 @@ fn bar() {
|
||||
R_PAREN@7..8 ")"
|
||||
WHITESPACE@8..9 " "
|
||||
BLOCK_EXPR@9..12
|
||||
L_CURLY@9..10 "{"
|
||||
WHITESPACE@10..11 "\n"
|
||||
R_CURLY@11..12 "}"
|
||||
STMT_LIST@9..12
|
||||
L_CURLY@9..10 "{"
|
||||
WHITESPACE@10..11 "\n"
|
||||
R_CURLY@11..12 "}"
|
||||
"#]],
|
||||
);
|
||||
|
||||
@ -280,9 +284,10 @@ fn bar() {
|
||||
R_PAREN@7..8 ")"
|
||||
WHITESPACE@8..9 " "
|
||||
BLOCK_EXPR@9..12
|
||||
L_CURLY@9..10 "{"
|
||||
WHITESPACE@10..11 "\n"
|
||||
R_CURLY@11..12 "}"
|
||||
STMT_LIST@9..12
|
||||
L_CURLY@9..10 "{"
|
||||
WHITESPACE@10..11 "\n"
|
||||
R_CURLY@11..12 "}"
|
||||
"#]],
|
||||
);
|
||||
|
||||
@ -307,9 +312,10 @@ fn bar() {
|
||||
R_PAREN@7..8 ")"
|
||||
WHITESPACE@8..9 " "
|
||||
BLOCK_EXPR@9..12
|
||||
L_CURLY@9..10 "{"
|
||||
WHITESPACE@10..11 "\n"
|
||||
R_CURLY@11..12 "}"
|
||||
STMT_LIST@9..12
|
||||
L_CURLY@9..10 "{"
|
||||
WHITESPACE@10..11 "\n"
|
||||
R_CURLY@11..12 "}"
|
||||
WHITESPACE@12..13 "\n"
|
||||
FN@13..25
|
||||
FN_KW@13..15 "fn"
|
||||
@ -321,9 +327,10 @@ fn bar() {
|
||||
R_PAREN@20..21 ")"
|
||||
WHITESPACE@21..22 " "
|
||||
BLOCK_EXPR@22..25
|
||||
L_CURLY@22..23 "{"
|
||||
WHITESPACE@23..24 "\n"
|
||||
R_CURLY@24..25 "}"
|
||||
STMT_LIST@22..25
|
||||
L_CURLY@22..23 "{"
|
||||
WHITESPACE@23..24 "\n"
|
||||
R_CURLY@24..25 "}"
|
||||
"#]],
|
||||
);
|
||||
}
|
||||
|
@ -100,9 +100,10 @@ fn extract_tail(ctx: &AssistContext) -> Option<(FnType, ast::Expr, InsertOrRepla
|
||||
let action = ret_ty_to_action(func.ret_type(), rparen_pos)?;
|
||||
|
||||
let body = func.body()?;
|
||||
let tail_expr = body.tail_expr()?;
|
||||
let stmt_list = body.stmt_list()?;
|
||||
let tail_expr = stmt_list.tail_expr()?;
|
||||
|
||||
let ret_range_end = body.l_curly_token()?.text_range().start();
|
||||
let ret_range_end = stmt_list.l_curly_token()?.text_range().start();
|
||||
let ret_range = TextRange::new(rparen_pos, ret_range_end);
|
||||
(FnType::Function, tail_expr, ret_range, action)
|
||||
};
|
||||
|
@ -68,6 +68,7 @@ pub(crate) fn convert_to_guarded_return(acc: &mut Assists, ctx: &AssistContext)
|
||||
|
||||
let cond_expr = cond.expr()?;
|
||||
let then_block = if_expr.then_branch()?;
|
||||
let then_block = then_block.stmt_list()?;
|
||||
|
||||
let parent_block = if_expr.syntax().parent()?.ancestors().find_map(ast::BlockExpr::cast)?;
|
||||
|
||||
@ -75,6 +76,9 @@ pub(crate) fn convert_to_guarded_return(acc: &mut Assists, ctx: &AssistContext)
|
||||
return None;
|
||||
}
|
||||
|
||||
// FIXME: This relies on untyped syntax tree and casts to much. It should be
|
||||
// rewritten to use strongly-typed APIs.
|
||||
|
||||
// check for early return and continue
|
||||
let first_in_then_block = then_block.syntax().first_child()?;
|
||||
if ast::ReturnExpr::can_cast(first_in_then_block.kind())
|
||||
|
@ -148,24 +148,30 @@ fn extraction_target(node: &SyntaxNode, selection_range: TextRange) -> Option<Fu
|
||||
return match stmt {
|
||||
ast::Stmt::Item(_) => None,
|
||||
ast::Stmt::ExprStmt(_) | ast::Stmt::LetStmt(_) => Some(FunctionBody::from_range(
|
||||
node.parent().and_then(ast::BlockExpr::cast)?,
|
||||
node.parent().and_then(ast::StmtList::cast)?,
|
||||
node.text_range(),
|
||||
)),
|
||||
};
|
||||
}
|
||||
|
||||
// Covering element returned the parent block of one or multiple statements that have been selected
|
||||
if let Some(stmt_list) = ast::StmtList::cast(node.clone()) {
|
||||
if let Some(block_expr) = stmt_list.syntax().parent().and_then(ast::BlockExpr::cast) {
|
||||
if block_expr.syntax().text_range() == selection_range {
|
||||
return FunctionBody::from_expr(block_expr.into());
|
||||
}
|
||||
}
|
||||
|
||||
// Extract the full statements.
|
||||
return Some(FunctionBody::from_range(stmt_list, selection_range));
|
||||
}
|
||||
|
||||
let expr = ast::Expr::cast(node.clone())?;
|
||||
// A node got selected fully
|
||||
if node.text_range() == selection_range {
|
||||
return FunctionBody::from_expr(expr.clone());
|
||||
}
|
||||
|
||||
// Covering element returned the parent block of one or multiple statements that have been selected
|
||||
if let ast::Expr::BlockExpr(block) = expr {
|
||||
// Extract the full statements.
|
||||
return Some(FunctionBody::from_range(block, selection_range));
|
||||
}
|
||||
|
||||
node.ancestors().find_map(ast::Expr::cast).and_then(FunctionBody::from_expr)
|
||||
}
|
||||
|
||||
@ -284,7 +290,7 @@ impl RetType {
|
||||
#[derive(Debug)]
|
||||
enum FunctionBody {
|
||||
Expr(ast::Expr),
|
||||
Span { parent: ast::BlockExpr, text_range: TextRange },
|
||||
Span { parent: ast::StmtList, text_range: TextRange },
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
@ -441,7 +447,7 @@ impl FunctionBody {
|
||||
}
|
||||
}
|
||||
|
||||
fn from_range(parent: ast::BlockExpr, selected: TextRange) -> FunctionBody {
|
||||
fn from_range(parent: ast::StmtList, selected: TextRange) -> FunctionBody {
|
||||
let mut text_range = parent
|
||||
.statements()
|
||||
.map(|stmt| stmt.syntax().text_range())
|
||||
@ -643,14 +649,14 @@ impl FunctionBody {
|
||||
break match_ast! {
|
||||
match anc {
|
||||
ast::ClosureExpr(closure) => (false, closure.body(), infer_expr_opt(closure.body())),
|
||||
ast::EffectExpr(effect) => {
|
||||
let (constness, block) = match effect.effect() {
|
||||
ast::Effect::Const(_) => (true, effect.block_expr()),
|
||||
ast::Effect::Try(_) => (false, effect.block_expr()),
|
||||
ast::Effect::Label(label) if label.lifetime().is_some() => (false, effect.block_expr()),
|
||||
ast::BlockExpr(block_expr) => {
|
||||
let (constness, block) = match block_expr.modifier() {
|
||||
Some(ast::BlockModifier::Const(_)) => (true, block_expr),
|
||||
Some(ast::BlockModifier::Try(_)) => (false, block_expr),
|
||||
Some(ast::BlockModifier::Label(label)) if label.lifetime().is_some() => (false, block_expr),
|
||||
_ => continue,
|
||||
};
|
||||
let expr = block.map(ast::Expr::BlockExpr);
|
||||
let expr = Some(ast::Expr::BlockExpr(block));
|
||||
(constness, expr.clone(), infer_expr_opt(expr))
|
||||
},
|
||||
ast::Fn(fn_) => {
|
||||
@ -745,7 +751,7 @@ impl FunctionBody {
|
||||
ast::Expr::LoopExpr(_)
|
||||
| ast::Expr::ForExpr(_)
|
||||
| ast::Expr::WhileExpr(_) => loop_depth -= 1,
|
||||
ast::Expr::EffectExpr(effect) if effect.unsafe_token().is_some() => {
|
||||
ast::Expr::BlockExpr(block_expr) if block_expr.unsafe_token().is_some() => {
|
||||
unsafe_depth -= 1
|
||||
}
|
||||
_ => (),
|
||||
@ -757,7 +763,7 @@ impl FunctionBody {
|
||||
ast::Expr::LoopExpr(_) | ast::Expr::ForExpr(_) | ast::Expr::WhileExpr(_) => {
|
||||
loop_depth += 1;
|
||||
}
|
||||
ast::Expr::EffectExpr(effect) if effect.unsafe_token().is_some() => {
|
||||
ast::Expr::BlockExpr(block_expr) if block_expr.unsafe_token().is_some() => {
|
||||
unsafe_depth += 1
|
||||
}
|
||||
ast::Expr::ReturnExpr(it) => {
|
||||
|
@ -137,6 +137,7 @@ fn valid_target_expr(node: SyntaxNode) -> Option<ast::Expr> {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
enum Anchor {
|
||||
Before(SyntaxNode),
|
||||
Replace(ast::ExprStmt),
|
||||
@ -148,7 +149,7 @@ impl Anchor {
|
||||
to_extract.syntax().ancestors().take_while(|it| !ast::Item::can_cast(it.kind())).find_map(
|
||||
|node| {
|
||||
if let Some(expr) =
|
||||
node.parent().and_then(ast::BlockExpr::cast).and_then(|it| it.tail_expr())
|
||||
node.parent().and_then(ast::StmtList::cast).and_then(|it| it.tail_expr())
|
||||
{
|
||||
if expr.syntax() == &node {
|
||||
cov_mark::hit!(test_extract_var_last_expr);
|
||||
|
@ -389,9 +389,13 @@ fn inline(
|
||||
_ => {
|
||||
let ty =
|
||||
sema.type_of_expr(expr).filter(TypeInfo::has_adjustment).and(param_ty.clone());
|
||||
body.push_front(
|
||||
make::let_stmt(pat.clone(), ty, Some(expr.clone())).clone_for_update().into(),
|
||||
)
|
||||
if let Some(stmt_list) = body.stmt_list() {
|
||||
stmt_list.push_front(
|
||||
make::let_stmt(pat.clone(), ty, Some(expr.clone()))
|
||||
.clone_for_update()
|
||||
.into(),
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -93,8 +93,7 @@ pub(crate) fn inline_local_variable(acc: &mut Assists, ctx: &AssistContext) -> O
|
||||
| ast::Expr::ArrayExpr(_)
|
||||
| ast::Expr::ParenExpr(_)
|
||||
| ast::Expr::PathExpr(_)
|
||||
| ast::Expr::BlockExpr(_)
|
||||
| ast::Expr::EffectExpr(_),
|
||||
| ast::Expr::BlockExpr(_),
|
||||
);
|
||||
let parent = matches!(
|
||||
usage_parent,
|
||||
|
@ -46,7 +46,7 @@ pub(crate) fn remove_dbg(acc: &mut Assists, ctx: &AssistContext) -> Option<()> {
|
||||
[] => {
|
||||
match_ast! {
|
||||
match parent {
|
||||
ast::BlockExpr(__) => {
|
||||
ast::StmtList(__) => {
|
||||
let range = macro_call.syntax().text_range();
|
||||
let range = match whitespace_start(macro_call.syntax().prev_sibling_or_token()) {
|
||||
Some(start) => range.cover_offset(start),
|
||||
|
@ -30,14 +30,14 @@ pub(crate) fn unwrap_block(acc: &mut Assists, ctx: &AssistContext) -> Option<()>
|
||||
let assist_label = "Unwrap block";
|
||||
|
||||
let l_curly_token = ctx.find_token_syntax_at_offset(T!['{'])?;
|
||||
let mut block = ast::BlockExpr::cast(l_curly_token.parent()?)?;
|
||||
let mut block = ast::BlockExpr::cast(l_curly_token.ancestors().nth(1)?)?;
|
||||
let target = block.syntax().text_range();
|
||||
let mut parent = block.syntax().parent()?;
|
||||
if ast::MatchArm::can_cast(parent.kind()) {
|
||||
parent = parent.ancestors().find(|it| ast::MatchExpr::can_cast(it.kind()))?
|
||||
}
|
||||
|
||||
if matches!(parent.kind(), SyntaxKind::BLOCK_EXPR | SyntaxKind::EXPR_STMT) {
|
||||
if matches!(parent.kind(), SyntaxKind::STMT_LIST | SyntaxKind::EXPR_STMT) {
|
||||
return acc.add(assist_id, assist_label, target, |builder| {
|
||||
builder.replace(block.syntax().text_range(), update_expr_string(block.to_string()));
|
||||
});
|
||||
|
@ -25,30 +25,34 @@ use crate::assist_context::{AssistBuilder, AssistContext};
|
||||
|
||||
pub(crate) use gen_trait_fn_body::gen_trait_fn_body;
|
||||
|
||||
pub(crate) fn unwrap_trivial_block(block: ast::BlockExpr) -> ast::Expr {
|
||||
extract_trivial_expression(&block)
|
||||
pub(crate) fn unwrap_trivial_block(block_expr: ast::BlockExpr) -> ast::Expr {
|
||||
extract_trivial_expression(&block_expr)
|
||||
.filter(|expr| !expr.syntax().text().contains_char('\n'))
|
||||
.unwrap_or_else(|| block.into())
|
||||
.unwrap_or_else(|| block_expr.into())
|
||||
}
|
||||
|
||||
pub fn extract_trivial_expression(block: &ast::BlockExpr) -> Option<ast::Expr> {
|
||||
pub fn extract_trivial_expression(block_expr: &ast::BlockExpr) -> Option<ast::Expr> {
|
||||
if block_expr.modifier().is_some() {
|
||||
return None;
|
||||
}
|
||||
let stmt_list = block_expr.stmt_list()?;
|
||||
let has_anything_else = |thing: &SyntaxNode| -> bool {
|
||||
let mut non_trivial_children =
|
||||
block.syntax().children_with_tokens().filter(|it| match it.kind() {
|
||||
stmt_list.syntax().children_with_tokens().filter(|it| match it.kind() {
|
||||
WHITESPACE | T!['{'] | T!['}'] => false,
|
||||
_ => it.as_node() != Some(thing),
|
||||
});
|
||||
non_trivial_children.next().is_some()
|
||||
};
|
||||
|
||||
if let Some(expr) = block.tail_expr() {
|
||||
if let Some(expr) = stmt_list.tail_expr() {
|
||||
if has_anything_else(expr.syntax()) {
|
||||
return None;
|
||||
}
|
||||
return Some(expr);
|
||||
}
|
||||
// Unwrap `{ continue; }`
|
||||
let stmt = block.statements().next()?;
|
||||
let stmt = stmt_list.statements().next()?;
|
||||
if let ast::Stmt::ExprStmt(expr_stmt) = stmt {
|
||||
if has_anything_else(expr_stmt.syntax()) {
|
||||
return None;
|
||||
|
@ -8,7 +8,7 @@ use ide_db::{
|
||||
};
|
||||
use syntax::{
|
||||
ast::{self, AstNode, AstToken},
|
||||
SyntaxKind::{BLOCK_EXPR, EXPR_STMT},
|
||||
SyntaxKind::{EXPR_STMT, STMT_LIST},
|
||||
TextRange, TextSize,
|
||||
};
|
||||
use text_edit::TextEdit;
|
||||
@ -256,7 +256,7 @@ pub(crate) fn complete_postfix(acc: &mut Completions, ctx: &CompletionContext) {
|
||||
.add_to(acc);
|
||||
|
||||
if let Some(parent) = dot_receiver.syntax().parent().and_then(|p| p.parent()) {
|
||||
if matches!(parent.kind(), BLOCK_EXPR | EXPR_STMT) {
|
||||
if matches!(parent.kind(), STMT_LIST | EXPR_STMT) {
|
||||
postfix_snippet(
|
||||
ctx,
|
||||
cap,
|
||||
|
@ -326,7 +326,7 @@ impl<'a> CompletionContext<'a> {
|
||||
}
|
||||
|
||||
pub(crate) fn has_block_expr_parent(&self) -> bool {
|
||||
matches!(self.completion_location, Some(ImmediateLocation::BlockExpr))
|
||||
matches!(self.completion_location, Some(ImmediateLocation::StmtList))
|
||||
}
|
||||
|
||||
pub(crate) fn expects_ident_pat_or_ref_expr(&self) -> bool {
|
||||
@ -818,9 +818,9 @@ impl<'a> CompletionContext<'a> {
|
||||
if let Some(stmt) = ast::ExprStmt::cast(node.clone()) {
|
||||
return Some(stmt.syntax().text_range() == name_ref.syntax().text_range());
|
||||
}
|
||||
if let Some(block) = ast::BlockExpr::cast(node) {
|
||||
if let Some(stmt_list) = ast::StmtList::cast(node) {
|
||||
return Some(
|
||||
block.tail_expr().map(|e| e.syntax().text_range())
|
||||
stmt_list.tail_expr().map(|e| e.syntax().text_range())
|
||||
== Some(name_ref.syntax().text_range()),
|
||||
);
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ pub(crate) enum ImmediateLocation {
|
||||
TupleField,
|
||||
RefExpr,
|
||||
IdentPat,
|
||||
BlockExpr,
|
||||
StmtList,
|
||||
ItemList,
|
||||
TypeBound,
|
||||
// Fake file ast node
|
||||
@ -201,7 +201,7 @@ pub(crate) fn determine_location(
|
||||
ast::Use(_it) => ImmediateLocation::Use,
|
||||
ast::UseTree(_it) => ImmediateLocation::UseTree,
|
||||
ast::UseTreeList(_it) => ImmediateLocation::UseTree,
|
||||
ast::BlockExpr(_it) => ImmediateLocation::BlockExpr,
|
||||
ast::StmtList(_it) => ImmediateLocation::StmtList,
|
||||
ast::SourceFile(_it) => ImmediateLocation::ItemList,
|
||||
ast::ItemList(_it) => ImmediateLocation::ItemList,
|
||||
ast::RefExpr(_it) => ImmediateLocation::RefExpr,
|
||||
@ -421,8 +421,8 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn test_block_expr_loc() {
|
||||
check_location(r"fn my_fn() { let a = 2; f$0 }", ImmediateLocation::BlockExpr);
|
||||
check_location(r"fn my_fn() { f$0 f }", ImmediateLocation::BlockExpr);
|
||||
check_location(r"fn my_fn() { let a = 2; f$0 }", ImmediateLocation::StmtList);
|
||||
check_location(r"fn my_fn() { f$0 f }", ImmediateLocation::StmtList);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
@ -139,26 +139,27 @@ impl SnippetCap {
|
||||
pub fn for_each_tail_expr(expr: &ast::Expr, cb: &mut dyn FnMut(&ast::Expr)) {
|
||||
match expr {
|
||||
ast::Expr::BlockExpr(b) => {
|
||||
if let Some(e) = b.tail_expr() {
|
||||
for_each_tail_expr(&e, cb);
|
||||
}
|
||||
}
|
||||
ast::Expr::EffectExpr(e) => match e.effect() {
|
||||
ast::Effect::Label(label) => {
|
||||
for_each_break_expr(Some(label), e.block_expr(), &mut |b| {
|
||||
cb(&ast::Expr::BreakExpr(b))
|
||||
});
|
||||
if let Some(b) = e.block_expr() {
|
||||
for_each_tail_expr(&ast::Expr::BlockExpr(b), cb);
|
||||
match b.modifier() {
|
||||
Some(
|
||||
ast::BlockModifier::Async(_)
|
||||
| ast::BlockModifier::Try(_)
|
||||
| ast::BlockModifier::Const(_),
|
||||
) => return cb(expr),
|
||||
|
||||
Some(ast::BlockModifier::Label(label)) => {
|
||||
for_each_break_expr(Some(label), b.stmt_list(), &mut |b| {
|
||||
cb(&ast::Expr::BreakExpr(b))
|
||||
});
|
||||
}
|
||||
Some(ast::BlockModifier::Unsafe(_)) => (),
|
||||
None => (),
|
||||
}
|
||||
ast::Effect::Unsafe(_) => {
|
||||
if let Some(e) = e.block_expr().and_then(|b| b.tail_expr()) {
|
||||
if let Some(stmt_list) = b.stmt_list() {
|
||||
if let Some(e) = stmt_list.tail_expr() {
|
||||
for_each_tail_expr(&e, cb);
|
||||
}
|
||||
}
|
||||
ast::Effect::Async(_) | ast::Effect::Try(_) | ast::Effect::Const(_) => cb(expr),
|
||||
},
|
||||
}
|
||||
ast::Expr::IfExpr(if_) => {
|
||||
let mut if_ = if_.clone();
|
||||
loop {
|
||||
@ -176,7 +177,9 @@ pub fn for_each_tail_expr(expr: &ast::Expr, cb: &mut dyn FnMut(&ast::Expr)) {
|
||||
}
|
||||
}
|
||||
ast::Expr::LoopExpr(l) => {
|
||||
for_each_break_expr(l.label(), l.loop_body(), &mut |b| cb(&ast::Expr::BreakExpr(b)))
|
||||
for_each_break_expr(l.label(), l.loop_body().and_then(|it| it.stmt_list()), &mut |b| {
|
||||
cb(&ast::Expr::BreakExpr(b))
|
||||
})
|
||||
}
|
||||
ast::Expr::MatchExpr(m) => {
|
||||
if let Some(arms) = m.match_arm_list() {
|
||||
@ -216,7 +219,7 @@ pub fn for_each_tail_expr(expr: &ast::Expr, cb: &mut dyn FnMut(&ast::Expr)) {
|
||||
/// Calls `cb` on each break expr inside of `body` that is applicable for the given label.
|
||||
pub fn for_each_break_expr(
|
||||
label: Option<ast::Label>,
|
||||
body: Option<ast::BlockExpr>,
|
||||
body: Option<ast::StmtList>,
|
||||
cb: &mut dyn FnMut(ast::BreakExpr),
|
||||
) {
|
||||
let label = label.and_then(|lbl| lbl.lifetime());
|
||||
@ -236,7 +239,7 @@ pub fn for_each_break_expr(
|
||||
ast::Expr::LoopExpr(_) | ast::Expr::WhileExpr(_) | ast::Expr::ForExpr(_) => {
|
||||
depth += 1
|
||||
}
|
||||
ast::Expr::EffectExpr(e) if e.label().is_some() => depth += 1,
|
||||
ast::Expr::BlockExpr(e) if e.label().is_some() => depth += 1,
|
||||
ast::Expr::BreakExpr(b)
|
||||
if (depth == 0 && b.lifetime().is_none()) || eq_label(b.lifetime()) =>
|
||||
{
|
||||
@ -248,7 +251,7 @@ pub fn for_each_break_expr(
|
||||
ast::Expr::LoopExpr(_) | ast::Expr::WhileExpr(_) | ast::Expr::ForExpr(_) => {
|
||||
depth -= 1
|
||||
}
|
||||
ast::Expr::EffectExpr(e) if e.label().is_some() => depth -= 1,
|
||||
ast::Expr::BlockExpr(e) if e.label().is_some() => depth -= 1,
|
||||
_ => (),
|
||||
},
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ pub struct InsertUseConfig {
|
||||
pub enum ImportScope {
|
||||
File(ast::SourceFile),
|
||||
Module(ast::ItemList),
|
||||
Block(ast::BlockExpr),
|
||||
Block(ast::StmtList),
|
||||
}
|
||||
|
||||
impl ImportScope {
|
||||
@ -60,15 +60,15 @@ impl ImportScope {
|
||||
match syntax {
|
||||
ast::Module(module) => module.item_list().map(ImportScope::Module),
|
||||
ast::SourceFile(file) => Some(ImportScope::File(file)),
|
||||
ast::Fn(func) => contains_cfg_attr(&func).then(|| func.body().map(ImportScope::Block)).flatten(),
|
||||
ast::Fn(func) => contains_cfg_attr(&func).then(|| func.body().and_then(|it| it.stmt_list().map(ImportScope::Block))).flatten(),
|
||||
ast::Const(konst) => contains_cfg_attr(&konst).then(|| match konst.body()? {
|
||||
ast::Expr::BlockExpr(block) => Some(block),
|
||||
_ => None,
|
||||
}).flatten().map(ImportScope::Block),
|
||||
}).flatten().and_then(|it| it.stmt_list().map(ImportScope::Block)),
|
||||
ast::Static(statik) => contains_cfg_attr(&statik).then(|| match statik.body()? {
|
||||
ast::Expr::BlockExpr(block) => Some(block),
|
||||
_ => None,
|
||||
}).flatten().map(ImportScope::Block),
|
||||
}).flatten().and_then(|it| it.stmt_list().map(ImportScope::Block)),
|
||||
_ => None,
|
||||
|
||||
}
|
||||
|
@ -1,8 +1,8 @@
|
||||
use super::*;
|
||||
|
||||
use hir::PrefixKind;
|
||||
use test_utils::{assert_eq_text, extract_range_or_offset, CURSOR_MARKER};
|
||||
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn respects_cfg_attr_fn() {
|
||||
check(
|
||||
|
@ -32,8 +32,8 @@ pub fn walk_expr(expr: &ast::Expr, cb: &mut dyn FnMut(ast::Expr)) {
|
||||
/// Preorder walk all the expression's child expressions preserving events.
|
||||
/// If the callback returns true on an [`WalkEvent::Enter`], the subtree of the expression will be skipped.
|
||||
/// Note that the subtree may already be skipped due to the context analysis this function does.
|
||||
pub fn preorder_expr(expr: &ast::Expr, cb: &mut dyn FnMut(WalkEvent<ast::Expr>) -> bool) {
|
||||
let mut preorder = expr.syntax().preorder();
|
||||
pub fn preorder_expr(start: &ast::Expr, cb: &mut dyn FnMut(WalkEvent<ast::Expr>) -> bool) {
|
||||
let mut preorder = start.syntax().preorder();
|
||||
while let Some(event) = preorder.next() {
|
||||
let node = match event {
|
||||
WalkEvent::Enter(node) => node,
|
||||
@ -44,17 +44,17 @@ pub fn preorder_expr(expr: &ast::Expr, cb: &mut dyn FnMut(WalkEvent<ast::Expr>)
|
||||
continue;
|
||||
}
|
||||
};
|
||||
match ast::Stmt::cast(node.clone()) {
|
||||
// recursively walk the initializer, skipping potential const pat expressions
|
||||
// let statements aren't usually nested too deeply so this is fine to recurse on
|
||||
Some(ast::Stmt::LetStmt(l)) => {
|
||||
if let Some(expr) = l.initializer() {
|
||||
preorder_expr(&expr, cb);
|
||||
}
|
||||
if let Some(let_stmt) = node.parent().and_then(ast::LetStmt::cast) {
|
||||
if Some(node.clone()) != let_stmt.initializer().map(|it| it.syntax().clone()) {
|
||||
// skipping potential const pat expressions in let statements
|
||||
preorder.skip_subtree();
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
match ast::Stmt::cast(node.clone()) {
|
||||
// Don't skip subtree since we want to process the expression child next
|
||||
Some(ast::Stmt::ExprStmt(_)) => (),
|
||||
Some(ast::Stmt::ExprStmt(_)) | Some(ast::Stmt::LetStmt(_)) => (),
|
||||
// This might be an expression
|
||||
Some(ast::Stmt::Item(ast::Item::MacroCall(mcall))) => {
|
||||
cb(WalkEvent::Enter(ast::Expr::MacroCall(mcall)));
|
||||
@ -68,15 +68,19 @@ pub fn preorder_expr(expr: &ast::Expr, cb: &mut dyn FnMut(WalkEvent<ast::Expr>)
|
||||
preorder.skip_subtree();
|
||||
} else if let Some(expr) = ast::Expr::cast(node) {
|
||||
let is_different_context = match &expr {
|
||||
ast::Expr::EffectExpr(effect) => {
|
||||
ast::Expr::BlockExpr(block_expr) => {
|
||||
matches!(
|
||||
effect.effect(),
|
||||
ast::Effect::Async(_) | ast::Effect::Try(_) | ast::Effect::Const(_)
|
||||
block_expr.modifier(),
|
||||
Some(
|
||||
ast::BlockModifier::Async(_)
|
||||
| ast::BlockModifier::Try(_)
|
||||
| ast::BlockModifier::Const(_)
|
||||
)
|
||||
)
|
||||
}
|
||||
ast::Expr::ClosureExpr(_) => true,
|
||||
_ => false,
|
||||
};
|
||||
} && expr.syntax() != start.syntax();
|
||||
let skip = cb(WalkEvent::Enter(expr));
|
||||
if skip || is_different_context {
|
||||
preorder.skip_subtree();
|
||||
@ -88,8 +92,8 @@ pub fn preorder_expr(expr: &ast::Expr, cb: &mut dyn FnMut(WalkEvent<ast::Expr>)
|
||||
}
|
||||
|
||||
/// Preorder walk all the expression's child patterns.
|
||||
pub fn walk_patterns_in_expr(expr: &ast::Expr, cb: &mut dyn FnMut(ast::Pat)) {
|
||||
let mut preorder = expr.syntax().preorder();
|
||||
pub fn walk_patterns_in_expr(start: &ast::Expr, cb: &mut dyn FnMut(ast::Pat)) {
|
||||
let mut preorder = start.syntax().preorder();
|
||||
while let Some(event) = preorder.next() {
|
||||
let node = match event {
|
||||
WalkEvent::Enter(node) => node,
|
||||
@ -115,15 +119,19 @@ pub fn walk_patterns_in_expr(expr: &ast::Expr, cb: &mut dyn FnMut(ast::Pat)) {
|
||||
preorder.skip_subtree();
|
||||
} else if let Some(expr) = ast::Expr::cast(node.clone()) {
|
||||
let is_different_context = match &expr {
|
||||
ast::Expr::EffectExpr(effect) => match effect.effect() {
|
||||
ast::Effect::Async(_) | ast::Effect::Try(_) | ast::Effect::Const(_) => {
|
||||
true
|
||||
}
|
||||
ast::Effect::Unsafe(_) | ast::Effect::Label(_) => false,
|
||||
},
|
||||
ast::Expr::BlockExpr(block_expr) => {
|
||||
matches!(
|
||||
block_expr.modifier(),
|
||||
Some(
|
||||
ast::BlockModifier::Async(_)
|
||||
| ast::BlockModifier::Try(_)
|
||||
| ast::BlockModifier::Const(_)
|
||||
)
|
||||
)
|
||||
}
|
||||
ast::Expr::ClosureExpr(_) => true,
|
||||
_ => false,
|
||||
};
|
||||
} && expr.syntax() != start.syntax();
|
||||
if is_different_context {
|
||||
preorder.skip_subtree();
|
||||
}
|
||||
|
@ -217,20 +217,21 @@ fn test_expr_order() {
|
||||
L_PAREN@5..6 "("
|
||||
R_PAREN@6..7 ")"
|
||||
BLOCK_EXPR@7..15
|
||||
L_CURLY@7..8 "{"
|
||||
EXPR_STMT@8..14
|
||||
BIN_EXPR@8..13
|
||||
BIN_EXPR@8..11
|
||||
LITERAL@8..9
|
||||
INT_NUMBER@8..9 "1"
|
||||
PLUS@9..10 "+"
|
||||
LITERAL@10..11
|
||||
INT_NUMBER@10..11 "1"
|
||||
STAR@11..12 "*"
|
||||
LITERAL@12..13
|
||||
INT_NUMBER@12..13 "2"
|
||||
SEMICOLON@13..14 ";"
|
||||
R_CURLY@14..15 "}""#,
|
||||
STMT_LIST@7..15
|
||||
L_CURLY@7..8 "{"
|
||||
EXPR_STMT@8..14
|
||||
BIN_EXPR@8..13
|
||||
BIN_EXPR@8..11
|
||||
LITERAL@8..9
|
||||
INT_NUMBER@8..9 "1"
|
||||
PLUS@9..10 "+"
|
||||
LITERAL@10..11
|
||||
INT_NUMBER@10..11 "1"
|
||||
STAR@11..12 "*"
|
||||
LITERAL@12..13
|
||||
INT_NUMBER@12..13 "2"
|
||||
SEMICOLON@13..14 ";"
|
||||
R_CURLY@14..15 "}""#,
|
||||
dump.trim()
|
||||
);
|
||||
}
|
||||
@ -1320,70 +1321,72 @@ fn test_vec() {
|
||||
|
||||
let tree = fixture.expand_expr(r#"vec![1u32,2];"#);
|
||||
|
||||
assert_eq!(
|
||||
format!("{:#?}", tree).trim(),
|
||||
assert_eq_text!(
|
||||
&format!("{:#?}", tree),
|
||||
r#"BLOCK_EXPR@0..45
|
||||
L_CURLY@0..1 "{"
|
||||
LET_STMT@1..20
|
||||
LET_KW@1..4 "let"
|
||||
IDENT_PAT@4..8
|
||||
MUT_KW@4..7 "mut"
|
||||
NAME@7..8
|
||||
IDENT@7..8 "v"
|
||||
EQ@8..9 "="
|
||||
CALL_EXPR@9..19
|
||||
PATH_EXPR@9..17
|
||||
PATH@9..17
|
||||
PATH@9..12
|
||||
PATH_SEGMENT@9..12
|
||||
NAME_REF@9..12
|
||||
IDENT@9..12 "Vec"
|
||||
COLON2@12..14 "::"
|
||||
PATH_SEGMENT@14..17
|
||||
NAME_REF@14..17
|
||||
IDENT@14..17 "new"
|
||||
ARG_LIST@17..19
|
||||
L_PAREN@17..18 "("
|
||||
R_PAREN@18..19 ")"
|
||||
SEMICOLON@19..20 ";"
|
||||
EXPR_STMT@20..33
|
||||
METHOD_CALL_EXPR@20..32
|
||||
PATH_EXPR@20..21
|
||||
PATH@20..21
|
||||
PATH_SEGMENT@20..21
|
||||
NAME_REF@20..21
|
||||
IDENT@20..21 "v"
|
||||
DOT@21..22 "."
|
||||
NAME_REF@22..26
|
||||
IDENT@22..26 "push"
|
||||
ARG_LIST@26..32
|
||||
L_PAREN@26..27 "("
|
||||
LITERAL@27..31
|
||||
INT_NUMBER@27..31 "1u32"
|
||||
R_PAREN@31..32 ")"
|
||||
SEMICOLON@32..33 ";"
|
||||
EXPR_STMT@33..43
|
||||
METHOD_CALL_EXPR@33..42
|
||||
PATH_EXPR@33..34
|
||||
PATH@33..34
|
||||
PATH_SEGMENT@33..34
|
||||
NAME_REF@33..34
|
||||
IDENT@33..34 "v"
|
||||
DOT@34..35 "."
|
||||
NAME_REF@35..39
|
||||
IDENT@35..39 "push"
|
||||
ARG_LIST@39..42
|
||||
L_PAREN@39..40 "("
|
||||
LITERAL@40..41
|
||||
INT_NUMBER@40..41 "2"
|
||||
R_PAREN@41..42 ")"
|
||||
SEMICOLON@42..43 ";"
|
||||
PATH_EXPR@43..44
|
||||
PATH@43..44
|
||||
PATH_SEGMENT@43..44
|
||||
NAME_REF@43..44
|
||||
IDENT@43..44 "v"
|
||||
R_CURLY@44..45 "}""#
|
||||
STMT_LIST@0..45
|
||||
L_CURLY@0..1 "{"
|
||||
LET_STMT@1..20
|
||||
LET_KW@1..4 "let"
|
||||
IDENT_PAT@4..8
|
||||
MUT_KW@4..7 "mut"
|
||||
NAME@7..8
|
||||
IDENT@7..8 "v"
|
||||
EQ@8..9 "="
|
||||
CALL_EXPR@9..19
|
||||
PATH_EXPR@9..17
|
||||
PATH@9..17
|
||||
PATH@9..12
|
||||
PATH_SEGMENT@9..12
|
||||
NAME_REF@9..12
|
||||
IDENT@9..12 "Vec"
|
||||
COLON2@12..14 "::"
|
||||
PATH_SEGMENT@14..17
|
||||
NAME_REF@14..17
|
||||
IDENT@14..17 "new"
|
||||
ARG_LIST@17..19
|
||||
L_PAREN@17..18 "("
|
||||
R_PAREN@18..19 ")"
|
||||
SEMICOLON@19..20 ";"
|
||||
EXPR_STMT@20..33
|
||||
METHOD_CALL_EXPR@20..32
|
||||
PATH_EXPR@20..21
|
||||
PATH@20..21
|
||||
PATH_SEGMENT@20..21
|
||||
NAME_REF@20..21
|
||||
IDENT@20..21 "v"
|
||||
DOT@21..22 "."
|
||||
NAME_REF@22..26
|
||||
IDENT@22..26 "push"
|
||||
ARG_LIST@26..32
|
||||
L_PAREN@26..27 "("
|
||||
LITERAL@27..31
|
||||
INT_NUMBER@27..31 "1u32"
|
||||
R_PAREN@31..32 ")"
|
||||
SEMICOLON@32..33 ";"
|
||||
EXPR_STMT@33..43
|
||||
METHOD_CALL_EXPR@33..42
|
||||
PATH_EXPR@33..34
|
||||
PATH@33..34
|
||||
PATH_SEGMENT@33..34
|
||||
NAME_REF@33..34
|
||||
IDENT@33..34 "v"
|
||||
DOT@34..35 "."
|
||||
NAME_REF@35..39
|
||||
IDENT@35..39 "push"
|
||||
ARG_LIST@39..42
|
||||
L_PAREN@39..40 "("
|
||||
LITERAL@40..41
|
||||
INT_NUMBER@40..41 "2"
|
||||
R_PAREN@41..42 ")"
|
||||
SEMICOLON@42..43 ";"
|
||||
PATH_EXPR@43..44
|
||||
PATH@43..44
|
||||
PATH_SEGMENT@43..44
|
||||
NAME_REF@43..44
|
||||
IDENT@43..44 "v"
|
||||
R_CURLY@44..45 "}"
|
||||
"#
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -93,8 +93,8 @@ pub(super) fn atom_expr(p: &mut Parser, r: Restrictions) -> Option<(CompletedMar
|
||||
// test labeled_block
|
||||
// fn f() { 'label: {}; }
|
||||
T!['{'] => {
|
||||
block_expr(p);
|
||||
m.complete(p, EFFECT_EXPR)
|
||||
stmt_list(p);
|
||||
m.complete(p, BLOCK_EXPR)
|
||||
}
|
||||
_ => {
|
||||
// test_err misplaced_label_err
|
||||
@ -111,8 +111,8 @@ pub(super) fn atom_expr(p: &mut Parser, r: Restrictions) -> Option<(CompletedMar
|
||||
let m = p.start();
|
||||
p.bump(T![async]);
|
||||
p.eat(T![move]);
|
||||
block_expr(p);
|
||||
m.complete(p, EFFECT_EXPR)
|
||||
stmt_list(p);
|
||||
m.complete(p, BLOCK_EXPR)
|
||||
}
|
||||
T![match] => match_expr(p),
|
||||
// test unsafe_block
|
||||
@ -120,16 +120,16 @@ pub(super) fn atom_expr(p: &mut Parser, r: Restrictions) -> Option<(CompletedMar
|
||||
T![unsafe] if la == T!['{'] => {
|
||||
let m = p.start();
|
||||
p.bump(T![unsafe]);
|
||||
block_expr(p);
|
||||
m.complete(p, EFFECT_EXPR)
|
||||
stmt_list(p);
|
||||
m.complete(p, BLOCK_EXPR)
|
||||
}
|
||||
// test const_block
|
||||
// fn f() { const { } }
|
||||
T![const] if la == T!['{'] => {
|
||||
let m = p.start();
|
||||
p.bump(T![const]);
|
||||
block_expr(p);
|
||||
m.complete(p, EFFECT_EXPR)
|
||||
stmt_list(p);
|
||||
m.complete(p, BLOCK_EXPR)
|
||||
}
|
||||
T!['{'] => {
|
||||
// test for_range_from
|
||||
@ -138,7 +138,9 @@ pub(super) fn atom_expr(p: &mut Parser, r: Restrictions) -> Option<(CompletedMar
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
block_expr_unchecked(p)
|
||||
let m = p.start();
|
||||
stmt_list(p);
|
||||
m.complete(p, BLOCK_EXPR)
|
||||
}
|
||||
T![return] => return_expr(p),
|
||||
T![yield] => yield_expr(p),
|
||||
@ -150,9 +152,7 @@ pub(super) fn atom_expr(p: &mut Parser, r: Restrictions) -> Option<(CompletedMar
|
||||
}
|
||||
};
|
||||
let blocklike = match done.kind() {
|
||||
IF_EXPR | WHILE_EXPR | FOR_EXPR | LOOP_EXPR | MATCH_EXPR | BLOCK_EXPR | EFFECT_EXPR => {
|
||||
BlockLike::Block
|
||||
}
|
||||
IF_EXPR | WHILE_EXPR | FOR_EXPR | LOOP_EXPR | MATCH_EXPR | BLOCK_EXPR => BlockLike::Block,
|
||||
_ => BlockLike::NotBlock,
|
||||
};
|
||||
Some((done, blocklike))
|
||||
@ -486,16 +486,18 @@ pub(crate) fn block_expr(p: &mut Parser) {
|
||||
p.error("expected a block");
|
||||
return;
|
||||
}
|
||||
block_expr_unchecked(p);
|
||||
let m = p.start();
|
||||
stmt_list(p);
|
||||
m.complete(p, BLOCK_EXPR);
|
||||
}
|
||||
|
||||
fn block_expr_unchecked(p: &mut Parser) -> CompletedMarker {
|
||||
fn stmt_list(p: &mut Parser) -> CompletedMarker {
|
||||
assert!(p.at(T!['{']));
|
||||
let m = p.start();
|
||||
p.bump(T!['{']);
|
||||
expr_block_contents(p);
|
||||
p.expect(T!['}']);
|
||||
m.complete(p, BLOCK_EXPR)
|
||||
m.complete(p, STMT_LIST)
|
||||
}
|
||||
|
||||
// test return_expr
|
||||
@ -597,8 +599,12 @@ fn try_block_expr(p: &mut Parser, m: Option<Marker>) -> CompletedMarker {
|
||||
}
|
||||
|
||||
p.bump(T![try]);
|
||||
block_expr(p);
|
||||
m.complete(p, EFFECT_EXPR)
|
||||
if p.at(T!['{']) {
|
||||
stmt_list(p);
|
||||
} else {
|
||||
p.error("expected a block")
|
||||
}
|
||||
m.complete(p, BLOCK_EXPR)
|
||||
}
|
||||
|
||||
// test box_expr
|
||||
|
@ -187,6 +187,7 @@ pub enum SyntaxKind {
|
||||
BREAK_EXPR,
|
||||
LABEL,
|
||||
BLOCK_EXPR,
|
||||
STMT_LIST,
|
||||
RETURN_EXPR,
|
||||
YIELD_EXPR,
|
||||
MATCH_EXPR,
|
||||
@ -196,7 +197,6 @@ pub enum SyntaxKind {
|
||||
RECORD_EXPR,
|
||||
RECORD_EXPR_FIELD_LIST,
|
||||
RECORD_EXPR_FIELD,
|
||||
EFFECT_EXPR,
|
||||
BOX_EXPR,
|
||||
CALL_EXPR,
|
||||
INDEX_EXPR,
|
||||
|
@ -29,7 +29,7 @@ rayon = "1"
|
||||
expect-test = "1.1"
|
||||
proc-macro2 = "1.0.8"
|
||||
quote = "1.0.2"
|
||||
ungrammar = "=1.14"
|
||||
ungrammar = "=1.14.5"
|
||||
|
||||
test_utils = { path = "../test_utils" }
|
||||
sourcegen = { path = "../sourcegen" }
|
||||
|
@ -18,7 +18,7 @@ use crate::{
|
||||
};
|
||||
|
||||
pub use self::{
|
||||
expr_ext::{ArrayExprKind, Effect, ElseBranch, LiteralKind},
|
||||
expr_ext::{ArrayExprKind, BlockModifier, ElseBranch, LiteralKind},
|
||||
generated::{nodes::*, tokens::*},
|
||||
node_ext::{
|
||||
AttrKind, FieldKind, Macro, NameLike, NameOrNameRef, PathSegmentKind, SelfParamKind,
|
||||
|
@ -451,7 +451,7 @@ impl ast::RecordExprFieldList {
|
||||
}
|
||||
}
|
||||
|
||||
impl ast::BlockExpr {
|
||||
impl ast::StmtList {
|
||||
pub fn push_front(&self, statement: ast::Stmt) {
|
||||
ted::insert(Position::after(self.l_curly_token().unwrap()), statement.syntax());
|
||||
}
|
||||
|
@ -25,7 +25,6 @@ impl ast::Expr {
|
||||
| ast::Expr::WhileExpr(_)
|
||||
| ast::Expr::BlockExpr(_)
|
||||
| ast::Expr::MatchExpr(_)
|
||||
| ast::Expr::EffectExpr(_)
|
||||
)
|
||||
}
|
||||
}
|
||||
@ -268,38 +267,23 @@ impl ast::Literal {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub enum Effect {
|
||||
pub enum BlockModifier {
|
||||
Async(SyntaxToken),
|
||||
Unsafe(SyntaxToken),
|
||||
Try(SyntaxToken),
|
||||
Const(SyntaxToken),
|
||||
// Very much not an effect, but we stuff it into this node anyway
|
||||
Label(ast::Label),
|
||||
}
|
||||
|
||||
impl ast::EffectExpr {
|
||||
pub fn effect(&self) -> Effect {
|
||||
if let Some(token) = self.async_token() {
|
||||
return Effect::Async(token);
|
||||
}
|
||||
if let Some(token) = self.unsafe_token() {
|
||||
return Effect::Unsafe(token);
|
||||
}
|
||||
if let Some(token) = self.try_token() {
|
||||
return Effect::Try(token);
|
||||
}
|
||||
if let Some(token) = self.const_token() {
|
||||
return Effect::Const(token);
|
||||
}
|
||||
if let Some(label) = self.label() {
|
||||
return Effect::Label(label);
|
||||
}
|
||||
unreachable!("ast::EffectExpr without Effect")
|
||||
}
|
||||
}
|
||||
|
||||
impl ast::BlockExpr {
|
||||
pub fn modifier(&self) -> Option<BlockModifier> {
|
||||
self.async_token()
|
||||
.map(BlockModifier::Async)
|
||||
.or_else(|| self.unsafe_token().map(BlockModifier::Unsafe))
|
||||
.or_else(|| self.try_token().map(BlockModifier::Try))
|
||||
.or_else(|| self.const_token().map(BlockModifier::Const))
|
||||
.or_else(|| self.label().map(BlockModifier::Label))
|
||||
}
|
||||
/// false if the block is an intrinsic part of the syntax and can't be
|
||||
/// replaced with arbitrary expression.
|
||||
///
|
||||
@ -312,7 +296,7 @@ impl ast::BlockExpr {
|
||||
Some(it) => it,
|
||||
None => return true,
|
||||
};
|
||||
!matches!(parent.kind(), FN | IF_EXPR | WHILE_EXPR | LOOP_EXPR | EFFECT_EXPR)
|
||||
!matches!(parent.kind(), FN | IF_EXPR | WHILE_EXPR | LOOP_EXPR)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -477,10 +477,12 @@ pub struct BlockExpr {
|
||||
}
|
||||
impl ast::AttrsOwner for BlockExpr {}
|
||||
impl BlockExpr {
|
||||
pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) }
|
||||
pub fn statements(&self) -> AstChildren<Stmt> { support::children(&self.syntax) }
|
||||
pub fn tail_expr(&self) -> Option<Expr> { support::child(&self.syntax) }
|
||||
pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) }
|
||||
pub fn label(&self) -> Option<Label> { support::child(&self.syntax) }
|
||||
pub fn try_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![try]) }
|
||||
pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![unsafe]) }
|
||||
pub fn async_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![async]) }
|
||||
pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) }
|
||||
pub fn stmt_list(&self) -> Option<StmtList> { support::child(&self.syntax) }
|
||||
}
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
|
||||
pub struct SelfParam {
|
||||
@ -643,7 +645,6 @@ impl Meta {
|
||||
pub struct ExprStmt {
|
||||
pub(crate) syntax: SyntaxNode,
|
||||
}
|
||||
impl ast::AttrsOwner for ExprStmt {}
|
||||
impl ExprStmt {
|
||||
pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
|
||||
pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) }
|
||||
@ -753,19 +754,6 @@ impl ContinueExpr {
|
||||
pub fn lifetime(&self) -> Option<Lifetime> { support::child(&self.syntax) }
|
||||
}
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
|
||||
pub struct EffectExpr {
|
||||
pub(crate) syntax: SyntaxNode,
|
||||
}
|
||||
impl ast::AttrsOwner for EffectExpr {}
|
||||
impl EffectExpr {
|
||||
pub fn label(&self) -> Option<Label> { support::child(&self.syntax) }
|
||||
pub fn try_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![try]) }
|
||||
pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![unsafe]) }
|
||||
pub fn async_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![async]) }
|
||||
pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) }
|
||||
pub fn block_expr(&self) -> Option<BlockExpr> { support::child(&self.syntax) }
|
||||
}
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
|
||||
pub struct FieldExpr {
|
||||
pub(crate) syntax: SyntaxNode,
|
||||
}
|
||||
@ -945,6 +933,17 @@ impl YieldExpr {
|
||||
pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
|
||||
}
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
|
||||
pub struct StmtList {
|
||||
pub(crate) syntax: SyntaxNode,
|
||||
}
|
||||
impl ast::AttrsOwner for StmtList {}
|
||||
impl StmtList {
|
||||
pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) }
|
||||
pub fn statements(&self) -> AstChildren<Stmt> { support::children(&self.syntax) }
|
||||
pub fn tail_expr(&self) -> Option<Expr> { support::child(&self.syntax) }
|
||||
pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) }
|
||||
}
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
|
||||
pub struct Label {
|
||||
pub(crate) syntax: SyntaxNode,
|
||||
}
|
||||
@ -1339,7 +1338,6 @@ pub enum Expr {
|
||||
CastExpr(CastExpr),
|
||||
ClosureExpr(ClosureExpr),
|
||||
ContinueExpr(ContinueExpr),
|
||||
EffectExpr(EffectExpr),
|
||||
FieldExpr(FieldExpr),
|
||||
ForExpr(ForExpr),
|
||||
IfExpr(IfExpr),
|
||||
@ -2255,17 +2253,6 @@ impl AstNode for ContinueExpr {
|
||||
}
|
||||
fn syntax(&self) -> &SyntaxNode { &self.syntax }
|
||||
}
|
||||
impl AstNode for EffectExpr {
|
||||
fn can_cast(kind: SyntaxKind) -> bool { kind == EFFECT_EXPR }
|
||||
fn cast(syntax: SyntaxNode) -> Option<Self> {
|
||||
if Self::can_cast(syntax.kind()) {
|
||||
Some(Self { syntax })
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}
|
||||
fn syntax(&self) -> &SyntaxNode { &self.syntax }
|
||||
}
|
||||
impl AstNode for FieldExpr {
|
||||
fn can_cast(kind: SyntaxKind) -> bool { kind == FIELD_EXPR }
|
||||
fn cast(syntax: SyntaxNode) -> Option<Self> {
|
||||
@ -2475,6 +2462,17 @@ impl AstNode for YieldExpr {
|
||||
}
|
||||
fn syntax(&self) -> &SyntaxNode { &self.syntax }
|
||||
}
|
||||
impl AstNode for StmtList {
|
||||
fn can_cast(kind: SyntaxKind) -> bool { kind == STMT_LIST }
|
||||
fn cast(syntax: SyntaxNode) -> Option<Self> {
|
||||
if Self::can_cast(syntax.kind()) {
|
||||
Some(Self { syntax })
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}
|
||||
fn syntax(&self) -> &SyntaxNode { &self.syntax }
|
||||
}
|
||||
impl AstNode for Label {
|
||||
fn can_cast(kind: SyntaxKind) -> bool { kind == LABEL }
|
||||
fn cast(syntax: SyntaxNode) -> Option<Self> {
|
||||
@ -3073,9 +3071,6 @@ impl From<ClosureExpr> for Expr {
|
||||
impl From<ContinueExpr> for Expr {
|
||||
fn from(node: ContinueExpr) -> Expr { Expr::ContinueExpr(node) }
|
||||
}
|
||||
impl From<EffectExpr> for Expr {
|
||||
fn from(node: EffectExpr) -> Expr { Expr::EffectExpr(node) }
|
||||
}
|
||||
impl From<FieldExpr> for Expr {
|
||||
fn from(node: FieldExpr) -> Expr { Expr::FieldExpr(node) }
|
||||
}
|
||||
@ -3143,9 +3138,9 @@ impl AstNode for Expr {
|
||||
fn can_cast(kind: SyntaxKind) -> bool {
|
||||
match kind {
|
||||
ARRAY_EXPR | AWAIT_EXPR | BIN_EXPR | BLOCK_EXPR | BOX_EXPR | BREAK_EXPR | CALL_EXPR
|
||||
| CAST_EXPR | CLOSURE_EXPR | CONTINUE_EXPR | EFFECT_EXPR | FIELD_EXPR | FOR_EXPR
|
||||
| IF_EXPR | INDEX_EXPR | LITERAL | LOOP_EXPR | MACRO_CALL | MACRO_STMTS
|
||||
| MATCH_EXPR | METHOD_CALL_EXPR | PAREN_EXPR | PATH_EXPR | PREFIX_EXPR | RANGE_EXPR
|
||||
| CAST_EXPR | CLOSURE_EXPR | CONTINUE_EXPR | FIELD_EXPR | FOR_EXPR | IF_EXPR
|
||||
| INDEX_EXPR | LITERAL | LOOP_EXPR | MACRO_CALL | MACRO_STMTS | MATCH_EXPR
|
||||
| METHOD_CALL_EXPR | PAREN_EXPR | PATH_EXPR | PREFIX_EXPR | RANGE_EXPR
|
||||
| RECORD_EXPR | REF_EXPR | RETURN_EXPR | TRY_EXPR | TUPLE_EXPR | WHILE_EXPR
|
||||
| YIELD_EXPR => true,
|
||||
_ => false,
|
||||
@ -3163,7 +3158,6 @@ impl AstNode for Expr {
|
||||
CAST_EXPR => Expr::CastExpr(CastExpr { syntax }),
|
||||
CLOSURE_EXPR => Expr::ClosureExpr(ClosureExpr { syntax }),
|
||||
CONTINUE_EXPR => Expr::ContinueExpr(ContinueExpr { syntax }),
|
||||
EFFECT_EXPR => Expr::EffectExpr(EffectExpr { syntax }),
|
||||
FIELD_EXPR => Expr::FieldExpr(FieldExpr { syntax }),
|
||||
FOR_EXPR => Expr::ForExpr(ForExpr { syntax }),
|
||||
IF_EXPR => Expr::IfExpr(IfExpr { syntax }),
|
||||
@ -3201,7 +3195,6 @@ impl AstNode for Expr {
|
||||
Expr::CastExpr(it) => &it.syntax,
|
||||
Expr::ClosureExpr(it) => &it.syntax,
|
||||
Expr::ContinueExpr(it) => &it.syntax,
|
||||
Expr::EffectExpr(it) => &it.syntax,
|
||||
Expr::FieldExpr(it) => &it.syntax,
|
||||
Expr::ForExpr(it) => &it.syntax,
|
||||
Expr::IfExpr(it) => &it.syntax,
|
||||
@ -3660,7 +3653,6 @@ impl AstNode for DynAttrsOwner {
|
||||
| CONST_PARAM
|
||||
| LIFETIME_PARAM
|
||||
| TYPE_PARAM
|
||||
| EXPR_STMT
|
||||
| LET_STMT
|
||||
| ARRAY_EXPR
|
||||
| AWAIT_EXPR
|
||||
@ -3671,7 +3663,6 @@ impl AstNode for DynAttrsOwner {
|
||||
| CAST_EXPR
|
||||
| CLOSURE_EXPR
|
||||
| CONTINUE_EXPR
|
||||
| EFFECT_EXPR
|
||||
| FIELD_EXPR
|
||||
| FOR_EXPR
|
||||
| IF_EXPR
|
||||
@ -3690,6 +3681,7 @@ impl AstNode for DynAttrsOwner {
|
||||
| TUPLE_EXPR
|
||||
| WHILE_EXPR
|
||||
| YIELD_EXPR
|
||||
| STMT_LIST
|
||||
| RECORD_EXPR_FIELD_LIST
|
||||
| RECORD_EXPR_FIELD
|
||||
| MATCH_ARM_LIST
|
||||
@ -4222,11 +4214,6 @@ impl std::fmt::Display for ContinueExpr {
|
||||
std::fmt::Display::fmt(self.syntax(), f)
|
||||
}
|
||||
}
|
||||
impl std::fmt::Display for EffectExpr {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
std::fmt::Display::fmt(self.syntax(), f)
|
||||
}
|
||||
}
|
||||
impl std::fmt::Display for FieldExpr {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
std::fmt::Display::fmt(self.syntax(), f)
|
||||
@ -4322,6 +4309,11 @@ impl std::fmt::Display for YieldExpr {
|
||||
std::fmt::Display::fmt(self.syntax(), f)
|
||||
}
|
||||
}
|
||||
impl std::fmt::Display for StmtList {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
std::fmt::Display::fmt(self.syntax(), f)
|
||||
}
|
||||
}
|
||||
impl std::fmt::Display for Label {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
std::fmt::Display::fmt(self.syntax(), f)
|
||||
|
@ -247,6 +247,7 @@ pub fn record_field(
|
||||
ast_from_text(&format!("struct S {{ {}{}: {}, }}", visibility, name, ty))
|
||||
}
|
||||
|
||||
// TODO
|
||||
pub fn block_expr(
|
||||
stmts: impl IntoIterator<Item = ast::Stmt>,
|
||||
tail_expr: Option<ast::Expr>,
|
||||
|
@ -11,8 +11,8 @@ use rowan::{GreenNodeData, GreenTokenData};
|
||||
|
||||
use crate::{
|
||||
ast::{
|
||||
self, support, AstChildren, AstNode, AstToken, AttrsOwner, GenericParamsOwner, NameOwner,
|
||||
SyntaxNode,
|
||||
self, support, AstNode, AstToken, AttrsOwner, GenericParamsOwner, ModuleItemOwner,
|
||||
NameOwner, SyntaxNode,
|
||||
},
|
||||
NodeOrToken, SmolStr, SyntaxElement, SyntaxToken, TokenText, T,
|
||||
};
|
||||
@ -50,14 +50,23 @@ fn text_of_first_token(node: &SyntaxNode) -> TokenText<'_> {
|
||||
}
|
||||
}
|
||||
|
||||
impl ast::ModuleItemOwner for ast::StmtList {}
|
||||
|
||||
impl ast::BlockExpr {
|
||||
pub fn items(&self) -> AstChildren<ast::Item> {
|
||||
support::children(self.syntax())
|
||||
// FIXME: remove all these methods, they belong to ast::StmtList
|
||||
pub fn items(&self) -> impl Iterator<Item = ast::Item> {
|
||||
self.stmt_list().into_iter().flat_map(|it| it.items())
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.statements().next().is_none() && self.tail_expr().is_none()
|
||||
}
|
||||
pub fn statements(&self) -> impl Iterator<Item = ast::Stmt> {
|
||||
self.stmt_list().into_iter().flat_map(|it| it.statements())
|
||||
}
|
||||
pub fn tail_expr(&self) -> Option<ast::Expr> {
|
||||
self.stmt_list()?.tail_expr()
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq, Eq, Clone)]
|
||||
|
@ -295,7 +295,8 @@ fn api_walkthrough() {
|
||||
|
||||
// Let's get the `1 + 1` expression!
|
||||
let body: ast::BlockExpr = func.body().unwrap();
|
||||
let expr: ast::Expr = body.tail_expr().unwrap();
|
||||
let stmt_list: ast::StmtList = body.stmt_list().unwrap();
|
||||
let expr: ast::Expr = stmt_list.tail_expr().unwrap();
|
||||
|
||||
// Enums are used to group related ast nodes together, and can be used for
|
||||
// matching. However, because there are no public fields, it's possible to
|
||||
@ -331,8 +332,8 @@ fn api_walkthrough() {
|
||||
assert_eq!(text.to_string(), "1 + 1");
|
||||
|
||||
// There's a bunch of traversal methods on `SyntaxNode`:
|
||||
assert_eq!(expr_syntax.parent().as_ref(), Some(body.syntax()));
|
||||
assert_eq!(body.syntax().first_child_or_token().map(|it| it.kind()), Some(T!['{']));
|
||||
assert_eq!(expr_syntax.parent().as_ref(), Some(stmt_list.syntax()));
|
||||
assert_eq!(stmt_list.syntax().first_child_or_token().map(|it| it.kind()), Some(T!['{']));
|
||||
assert_eq!(
|
||||
expr_syntax.next_sibling_or_token().map(|it| it.kind()),
|
||||
Some(SyntaxKind::WHITESPACE)
|
||||
|
@ -162,8 +162,8 @@ fn ws_before(position: &Position, new: &SyntaxElement) -> Option<SyntaxToken> {
|
||||
}
|
||||
|
||||
if prev.kind() == T!['{'] && ast::Stmt::can_cast(new.kind()) {
|
||||
if let Some(block_expr) = prev.parent().and_then(ast::BlockExpr::cast) {
|
||||
let mut indent = IndentLevel::from_element(&block_expr.syntax().clone().into());
|
||||
if let Some(stmt_list) = prev.parent().and_then(ast::StmtList::cast) {
|
||||
let mut indent = IndentLevel::from_element(&stmt_list.syntax().clone().into());
|
||||
indent.0 += 1;
|
||||
return Some(make::tokens::whitespace(&format!("\n{}", indent)));
|
||||
}
|
||||
|
@ -149,6 +149,7 @@ pub(crate) const KINDS_SRC: KindsSrc = KindsSrc {
|
||||
"BREAK_EXPR",
|
||||
"LABEL",
|
||||
"BLOCK_EXPR",
|
||||
"STMT_LIST",
|
||||
"RETURN_EXPR",
|
||||
"YIELD_EXPR",
|
||||
"MATCH_EXPR",
|
||||
@ -158,7 +159,6 @@ pub(crate) const KINDS_SRC: KindsSrc = KindsSrc {
|
||||
"RECORD_EXPR",
|
||||
"RECORD_EXPR_FIELD_LIST",
|
||||
"RECORD_EXPR_FIELD",
|
||||
"EFFECT_EXPR",
|
||||
"BOX_EXPR",
|
||||
// postfix
|
||||
"CALL_EXPR",
|
||||
|
@ -9,14 +9,16 @@ use crate::{
|
||||
pub(crate) fn validate_block_expr(block: ast::BlockExpr, errors: &mut Vec<SyntaxError>) {
|
||||
if let Some(parent) = block.syntax().parent() {
|
||||
match parent.kind() {
|
||||
FN | EXPR_STMT | BLOCK_EXPR => return,
|
||||
FN | EXPR_STMT | STMT_LIST => return,
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
errors.extend(block.attrs().filter(|attr| attr.kind().is_inner()).map(|attr| {
|
||||
SyntaxError::new(
|
||||
"A block in this position cannot accept inner attributes",
|
||||
attr.syntax().text_range(),
|
||||
)
|
||||
}))
|
||||
if let Some(stmt_list) = block.stmt_list() {
|
||||
errors.extend(stmt_list.attrs().filter(|attr| attr.kind().is_inner()).map(|attr| {
|
||||
SyntaxError::new(
|
||||
"A block in this position cannot accept inner attributes",
|
||||
attr.syntax().text_range(),
|
||||
)
|
||||
}))
|
||||
}
|
||||
}
|
||||
|
@ -29,9 +29,10 @@ SOURCE_FILE@0..54
|
||||
R_PAREN@26..27 ")"
|
||||
WHITESPACE@27..28 " "
|
||||
BLOCK_EXPR@28..31
|
||||
L_CURLY@28..29 "{"
|
||||
WHITESPACE@29..30 "\n"
|
||||
R_CURLY@30..31 "}"
|
||||
STMT_LIST@28..31
|
||||
L_CURLY@28..29 "{"
|
||||
WHITESPACE@29..30 "\n"
|
||||
R_CURLY@30..31 "}"
|
||||
WHITESPACE@31..34 "\n\n\n"
|
||||
ATTR@34..53
|
||||
POUND@34..35 "#"
|
||||
|
@ -21,8 +21,9 @@ SOURCE_FILE@0..31
|
||||
L_PAREN@23..24 "("
|
||||
R_PAREN@24..25 ")"
|
||||
BLOCK_EXPR@25..27
|
||||
L_CURLY@25..26 "{"
|
||||
R_CURLY@26..27 "}"
|
||||
STMT_LIST@25..27
|
||||
L_CURLY@25..26 "{"
|
||||
R_CURLY@26..27 "}"
|
||||
WHITESPACE@27..29 "\n\n"
|
||||
ERROR@29..30
|
||||
R_CURLY@29..30 "}"
|
||||
|
@ -9,9 +9,10 @@ SOURCE_FILE@0..95
|
||||
R_PAREN@7..8 ")"
|
||||
WHITESPACE@8..9 " "
|
||||
BLOCK_EXPR@9..12
|
||||
L_CURLY@9..10 "{"
|
||||
WHITESPACE@10..11 "\n"
|
||||
R_CURLY@11..12 "}"
|
||||
STMT_LIST@9..12
|
||||
L_CURLY@9..10 "{"
|
||||
WHITESPACE@10..11 "\n"
|
||||
R_CURLY@11..12 "}"
|
||||
WHITESPACE@12..14 "\n\n"
|
||||
MACRO_CALL@14..19
|
||||
PATH@14..17
|
||||
@ -33,28 +34,30 @@ SOURCE_FILE@0..95
|
||||
TRUE_KW@29..33 "true"
|
||||
WHITESPACE@33..34 " "
|
||||
BLOCK_EXPR@34..51
|
||||
L_CURLY@34..35 "{"
|
||||
WHITESPACE@35..44 "\n "
|
||||
LITERAL@44..45
|
||||
INT_NUMBER@44..45 "1"
|
||||
WHITESPACE@45..50 "\n "
|
||||
R_CURLY@50..51 "}"
|
||||
STMT_LIST@34..51
|
||||
L_CURLY@34..35 "{"
|
||||
WHITESPACE@35..44 "\n "
|
||||
LITERAL@44..45
|
||||
INT_NUMBER@44..45 "1"
|
||||
WHITESPACE@45..50 "\n "
|
||||
R_CURLY@50..51 "}"
|
||||
WHITESPACE@51..52 " "
|
||||
ELSE_KW@52..56 "else"
|
||||
WHITESPACE@56..57 " "
|
||||
BLOCK_EXPR@57..78
|
||||
L_CURLY@57..58 "{"
|
||||
WHITESPACE@58..67 "\n "
|
||||
BIN_EXPR@67..72
|
||||
LITERAL@67..68
|
||||
INT_NUMBER@67..68 "2"
|
||||
WHITESPACE@68..69 " "
|
||||
PLUS@69..70 "+"
|
||||
WHITESPACE@70..71 " "
|
||||
LITERAL@71..72
|
||||
INT_NUMBER@71..72 "3"
|
||||
WHITESPACE@72..77 "\n "
|
||||
R_CURLY@77..78 "}"
|
||||
STMT_LIST@57..78
|
||||
L_CURLY@57..58 "{"
|
||||
WHITESPACE@58..67 "\n "
|
||||
BIN_EXPR@67..72
|
||||
LITERAL@67..68
|
||||
INT_NUMBER@67..68 "2"
|
||||
WHITESPACE@68..69 " "
|
||||
PLUS@69..70 "+"
|
||||
WHITESPACE@70..71 " "
|
||||
LITERAL@71..72
|
||||
INT_NUMBER@71..72 "3"
|
||||
WHITESPACE@72..77 "\n "
|
||||
R_CURLY@77..78 "}"
|
||||
WHITESPACE@78..79 "\n"
|
||||
R_CURLY@79..80 "}"
|
||||
WHITESPACE@80..82 "\n\n"
|
||||
@ -68,9 +71,10 @@ SOURCE_FILE@0..95
|
||||
R_PAREN@89..90 ")"
|
||||
WHITESPACE@90..91 " "
|
||||
BLOCK_EXPR@91..94
|
||||
L_CURLY@91..92 "{"
|
||||
WHITESPACE@92..93 "\n"
|
||||
R_CURLY@93..94 "}"
|
||||
STMT_LIST@91..94
|
||||
L_CURLY@91..92 "{"
|
||||
WHITESPACE@92..93 "\n"
|
||||
R_CURLY@93..94 "}"
|
||||
WHITESPACE@94..95 "\n"
|
||||
error 17..17: expected BANG
|
||||
error 19..19: expected SEMICOLON
|
||||
|
@ -9,36 +9,37 @@ SOURCE_FILE@0..42
|
||||
R_PAREN@8..9 ")"
|
||||
WHITESPACE@9..10 " "
|
||||
BLOCK_EXPR@10..41
|
||||
L_CURLY@10..11 "{"
|
||||
WHITESPACE@11..16 "\n "
|
||||
EXPR_STMT@16..24
|
||||
CLOSURE_EXPR@16..24
|
||||
PARAM_LIST@16..18
|
||||
PIPE@16..17 "|"
|
||||
PIPE@17..18 "|"
|
||||
WHITESPACE@18..19 " "
|
||||
RET_TYPE@19..24
|
||||
THIN_ARROW@19..21 "->"
|
||||
WHITESPACE@21..22 " "
|
||||
TUPLE_TYPE@22..24
|
||||
L_PAREN@22..23 "("
|
||||
R_PAREN@23..24 ")"
|
||||
WHITESPACE@24..25 " "
|
||||
EXPR_STMT@25..39
|
||||
EFFECT_EXPR@25..38
|
||||
UNSAFE_KW@25..31 "unsafe"
|
||||
WHITESPACE@31..32 " "
|
||||
BLOCK_EXPR@32..38
|
||||
L_CURLY@32..33 "{"
|
||||
WHITESPACE@33..34 " "
|
||||
TUPLE_EXPR@34..36
|
||||
L_PAREN@34..35 "("
|
||||
R_PAREN@35..36 ")"
|
||||
WHITESPACE@36..37 " "
|
||||
R_CURLY@37..38 "}"
|
||||
SEMICOLON@38..39 ";"
|
||||
WHITESPACE@39..40 "\n"
|
||||
R_CURLY@40..41 "}"
|
||||
STMT_LIST@10..41
|
||||
L_CURLY@10..11 "{"
|
||||
WHITESPACE@11..16 "\n "
|
||||
EXPR_STMT@16..24
|
||||
CLOSURE_EXPR@16..24
|
||||
PARAM_LIST@16..18
|
||||
PIPE@16..17 "|"
|
||||
PIPE@17..18 "|"
|
||||
WHITESPACE@18..19 " "
|
||||
RET_TYPE@19..24
|
||||
THIN_ARROW@19..21 "->"
|
||||
WHITESPACE@21..22 " "
|
||||
TUPLE_TYPE@22..24
|
||||
L_PAREN@22..23 "("
|
||||
R_PAREN@23..24 ")"
|
||||
WHITESPACE@24..25 " "
|
||||
EXPR_STMT@25..39
|
||||
BLOCK_EXPR@25..38
|
||||
UNSAFE_KW@25..31 "unsafe"
|
||||
WHITESPACE@31..32 " "
|
||||
STMT_LIST@32..38
|
||||
L_CURLY@32..33 "{"
|
||||
WHITESPACE@33..34 " "
|
||||
TUPLE_EXPR@34..36
|
||||
L_PAREN@34..35 "("
|
||||
R_PAREN@35..36 ")"
|
||||
WHITESPACE@36..37 " "
|
||||
R_CURLY@37..38 "}"
|
||||
SEMICOLON@38..39 ";"
|
||||
WHITESPACE@39..40 "\n"
|
||||
R_CURLY@40..41 "}"
|
||||
WHITESPACE@41..42 "\n"
|
||||
error 24..24: expected a block
|
||||
error 24..24: expected SEMICOLON
|
||||
|
@ -25,7 +25,8 @@ SOURCE_FILE@0..23
|
||||
IDENT@18..19 "T"
|
||||
WHITESPACE@19..20 " "
|
||||
BLOCK_EXPR@20..22
|
||||
L_CURLY@20..21 "{"
|
||||
R_CURLY@21..22 "}"
|
||||
STMT_LIST@20..22
|
||||
L_CURLY@20..21 "{"
|
||||
R_CURLY@21..22 "}"
|
||||
WHITESPACE@22..23 "\n"
|
||||
error 19..19: expected colon
|
||||
|
@ -9,35 +9,36 @@ SOURCE_FILE@0..56
|
||||
R_PAREN@7..8 ")"
|
||||
WHITESPACE@8..9 " "
|
||||
BLOCK_EXPR@9..55
|
||||
L_CURLY@9..10 "{"
|
||||
WHITESPACE@10..15 "\n "
|
||||
EXPR_STMT@15..38
|
||||
CALL_EXPR@15..38
|
||||
PATH_EXPR@15..18
|
||||
PATH@15..18
|
||||
PATH_SEGMENT@15..18
|
||||
NAME_REF@15..18
|
||||
IDENT@15..18 "foo"
|
||||
ARG_LIST@18..38
|
||||
L_PAREN@18..19 "("
|
||||
WHITESPACE@19..28 "\n "
|
||||
LITERAL@28..29
|
||||
INT_NUMBER@28..29 "1"
|
||||
COMMA@29..30 ","
|
||||
WHITESPACE@30..31 " "
|
||||
LITERAL@31..32
|
||||
INT_NUMBER@31..32 "2"
|
||||
WHITESPACE@32..37 "\n "
|
||||
R_PAREN@37..38 ")"
|
||||
WHITESPACE@38..43 "\n "
|
||||
EXPR_STMT@43..53
|
||||
RETURN_EXPR@43..52
|
||||
RETURN_KW@43..49 "return"
|
||||
WHITESPACE@49..50 " "
|
||||
LITERAL@50..52
|
||||
INT_NUMBER@50..52 "92"
|
||||
SEMICOLON@52..53 ";"
|
||||
WHITESPACE@53..54 "\n"
|
||||
R_CURLY@54..55 "}"
|
||||
STMT_LIST@9..55
|
||||
L_CURLY@9..10 "{"
|
||||
WHITESPACE@10..15 "\n "
|
||||
EXPR_STMT@15..38
|
||||
CALL_EXPR@15..38
|
||||
PATH_EXPR@15..18
|
||||
PATH@15..18
|
||||
PATH_SEGMENT@15..18
|
||||
NAME_REF@15..18
|
||||
IDENT@15..18 "foo"
|
||||
ARG_LIST@18..38
|
||||
L_PAREN@18..19 "("
|
||||
WHITESPACE@19..28 "\n "
|
||||
LITERAL@28..29
|
||||
INT_NUMBER@28..29 "1"
|
||||
COMMA@29..30 ","
|
||||
WHITESPACE@30..31 " "
|
||||
LITERAL@31..32
|
||||
INT_NUMBER@31..32 "2"
|
||||
WHITESPACE@32..37 "\n "
|
||||
R_PAREN@37..38 ")"
|
||||
WHITESPACE@38..43 "\n "
|
||||
EXPR_STMT@43..53
|
||||
RETURN_EXPR@43..52
|
||||
RETURN_KW@43..49 "return"
|
||||
WHITESPACE@49..50 " "
|
||||
LITERAL@50..52
|
||||
INT_NUMBER@50..52 "92"
|
||||
SEMICOLON@52..53 ";"
|
||||
WHITESPACE@53..54 "\n"
|
||||
R_CURLY@54..55 "}"
|
||||
WHITESPACE@55..56 "\n"
|
||||
error 38..38: expected SEMICOLON
|
||||
|
@ -20,27 +20,28 @@ SOURCE_FILE@0..47
|
||||
R_PAREN@15..16 ")"
|
||||
WHITESPACE@16..17 " "
|
||||
BLOCK_EXPR@17..46
|
||||
L_CURLY@17..18 "{"
|
||||
WHITESPACE@18..23 "\n "
|
||||
LET_STMT@23..36
|
||||
LET_KW@23..26 "let"
|
||||
WHITESPACE@26..27 " "
|
||||
IDENT_PAT@27..30
|
||||
NAME@27..30
|
||||
IDENT@27..30 "bar"
|
||||
WHITESPACE@30..31 " "
|
||||
EQ@31..32 "="
|
||||
WHITESPACE@32..33 " "
|
||||
LITERAL@33..35
|
||||
INT_NUMBER@33..35 "92"
|
||||
SEMICOLON@35..36 ";"
|
||||
WHITESPACE@36..41 "\n "
|
||||
BIN_EXPR@41..44
|
||||
LITERAL@41..42
|
||||
INT_NUMBER@41..42 "1"
|
||||
WHITESPACE@42..43 " "
|
||||
PLUS@43..44 "+"
|
||||
WHITESPACE@44..45 "\n"
|
||||
R_CURLY@45..46 "}"
|
||||
STMT_LIST@17..46
|
||||
L_CURLY@17..18 "{"
|
||||
WHITESPACE@18..23 "\n "
|
||||
LET_STMT@23..36
|
||||
LET_KW@23..26 "let"
|
||||
WHITESPACE@26..27 " "
|
||||
IDENT_PAT@27..30
|
||||
NAME@27..30
|
||||
IDENT@27..30 "bar"
|
||||
WHITESPACE@30..31 " "
|
||||
EQ@31..32 "="
|
||||
WHITESPACE@32..33 " "
|
||||
LITERAL@33..35
|
||||
INT_NUMBER@33..35 "92"
|
||||
SEMICOLON@35..36 ";"
|
||||
WHITESPACE@36..41 "\n "
|
||||
BIN_EXPR@41..44
|
||||
LITERAL@41..42
|
||||
INT_NUMBER@41..42 "1"
|
||||
WHITESPACE@42..43 " "
|
||||
PLUS@43..44 "+"
|
||||
WHITESPACE@44..45 "\n"
|
||||
R_CURLY@45..46 "}"
|
||||
WHITESPACE@46..47 "\n"
|
||||
error 44..44: expected expression
|
||||
|
@ -33,90 +33,91 @@ SOURCE_FILE@0..183
|
||||
IDENT@39..46 "ScopeId"
|
||||
WHITESPACE@46..47 " "
|
||||
BLOCK_EXPR@47..161
|
||||
L_CURLY@47..48 "{"
|
||||
WHITESPACE@48..57 "\n "
|
||||
LET_STMT@57..85
|
||||
LET_KW@57..60 "let"
|
||||
WHITESPACE@60..61 " "
|
||||
IDENT_PAT@61..64
|
||||
NAME@61..64
|
||||
IDENT@61..64 "res"
|
||||
WHITESPACE@64..65 " "
|
||||
EQ@65..66 "="
|
||||
WHITESPACE@66..67 " "
|
||||
METHOD_CALL_EXPR@67..84
|
||||
FIELD_EXPR@67..78
|
||||
PATH_EXPR@67..71
|
||||
PATH@67..71
|
||||
PATH_SEGMENT@67..71
|
||||
NAME_REF@67..71
|
||||
SELF_KW@67..71 "self"
|
||||
DOT@71..72 "."
|
||||
NAME_REF@72..78
|
||||
IDENT@72..78 "scopes"
|
||||
DOT@78..79 "."
|
||||
NAME_REF@79..82
|
||||
IDENT@79..82 "len"
|
||||
ARG_LIST@82..84
|
||||
L_PAREN@82..83 "("
|
||||
R_PAREN@83..84 ")"
|
||||
SEMICOLON@84..85 ";"
|
||||
WHITESPACE@85..94 "\n "
|
||||
METHOD_CALL_EXPR@94..155
|
||||
FIELD_EXPR@94..105
|
||||
PATH_EXPR@94..98
|
||||
PATH@94..98
|
||||
PATH_SEGMENT@94..98
|
||||
NAME_REF@94..98
|
||||
SELF_KW@94..98 "self"
|
||||
DOT@98..99 "."
|
||||
NAME_REF@99..105
|
||||
IDENT@99..105 "scopes"
|
||||
DOT@105..106 "."
|
||||
NAME_REF@106..110
|
||||
IDENT@106..110 "push"
|
||||
ARG_LIST@110..155
|
||||
L_PAREN@110..111 "("
|
||||
RECORD_EXPR@111..154
|
||||
PATH@111..120
|
||||
PATH_SEGMENT@111..120
|
||||
NAME_REF@111..120
|
||||
IDENT@111..120 "ScopeData"
|
||||
WHITESPACE@120..121 " "
|
||||
RECORD_EXPR_FIELD_LIST@121..154
|
||||
L_CURLY@121..122 "{"
|
||||
WHITESPACE@122..123 " "
|
||||
RECORD_EXPR_FIELD@123..135
|
||||
NAME_REF@123..129
|
||||
IDENT@123..129 "parent"
|
||||
COLON@129..130 ":"
|
||||
WHITESPACE@130..131 " "
|
||||
PATH_EXPR@131..135
|
||||
PATH@131..135
|
||||
PATH_SEGMENT@131..135
|
||||
NAME_REF@131..135
|
||||
IDENT@131..135 "None"
|
||||
COMMA@135..136 ","
|
||||
WHITESPACE@136..137 " "
|
||||
RECORD_EXPR_FIELD@137..152
|
||||
NAME_REF@137..144
|
||||
IDENT@137..144 "entries"
|
||||
COLON@144..145 ":"
|
||||
WHITESPACE@145..146 " "
|
||||
MACRO_CALL@146..152
|
||||
PATH@146..149
|
||||
PATH_SEGMENT@146..149
|
||||
NAME_REF@146..149
|
||||
IDENT@146..149 "vec"
|
||||
BANG@149..150 "!"
|
||||
TOKEN_TREE@150..152
|
||||
L_BRACK@150..151 "["
|
||||
R_BRACK@151..152 "]"
|
||||
WHITESPACE@152..153 " "
|
||||
R_CURLY@153..154 "}"
|
||||
R_PAREN@154..155 ")"
|
||||
WHITESPACE@155..160 "\n "
|
||||
R_CURLY@160..161 "}"
|
||||
STMT_LIST@47..161
|
||||
L_CURLY@47..48 "{"
|
||||
WHITESPACE@48..57 "\n "
|
||||
LET_STMT@57..85
|
||||
LET_KW@57..60 "let"
|
||||
WHITESPACE@60..61 " "
|
||||
IDENT_PAT@61..64
|
||||
NAME@61..64
|
||||
IDENT@61..64 "res"
|
||||
WHITESPACE@64..65 " "
|
||||
EQ@65..66 "="
|
||||
WHITESPACE@66..67 " "
|
||||
METHOD_CALL_EXPR@67..84
|
||||
FIELD_EXPR@67..78
|
||||
PATH_EXPR@67..71
|
||||
PATH@67..71
|
||||
PATH_SEGMENT@67..71
|
||||
NAME_REF@67..71
|
||||
SELF_KW@67..71 "self"
|
||||
DOT@71..72 "."
|
||||
NAME_REF@72..78
|
||||
IDENT@72..78 "scopes"
|
||||
DOT@78..79 "."
|
||||
NAME_REF@79..82
|
||||
IDENT@79..82 "len"
|
||||
ARG_LIST@82..84
|
||||
L_PAREN@82..83 "("
|
||||
R_PAREN@83..84 ")"
|
||||
SEMICOLON@84..85 ";"
|
||||
WHITESPACE@85..94 "\n "
|
||||
METHOD_CALL_EXPR@94..155
|
||||
FIELD_EXPR@94..105
|
||||
PATH_EXPR@94..98
|
||||
PATH@94..98
|
||||
PATH_SEGMENT@94..98
|
||||
NAME_REF@94..98
|
||||
SELF_KW@94..98 "self"
|
||||
DOT@98..99 "."
|
||||
NAME_REF@99..105
|
||||
IDENT@99..105 "scopes"
|
||||
DOT@105..106 "."
|
||||
NAME_REF@106..110
|
||||
IDENT@106..110 "push"
|
||||
ARG_LIST@110..155
|
||||
L_PAREN@110..111 "("
|
||||
RECORD_EXPR@111..154
|
||||
PATH@111..120
|
||||
PATH_SEGMENT@111..120
|
||||
NAME_REF@111..120
|
||||
IDENT@111..120 "ScopeData"
|
||||
WHITESPACE@120..121 " "
|
||||
RECORD_EXPR_FIELD_LIST@121..154
|
||||
L_CURLY@121..122 "{"
|
||||
WHITESPACE@122..123 " "
|
||||
RECORD_EXPR_FIELD@123..135
|
||||
NAME_REF@123..129
|
||||
IDENT@123..129 "parent"
|
||||
COLON@129..130 ":"
|
||||
WHITESPACE@130..131 " "
|
||||
PATH_EXPR@131..135
|
||||
PATH@131..135
|
||||
PATH_SEGMENT@131..135
|
||||
NAME_REF@131..135
|
||||
IDENT@131..135 "None"
|
||||
COMMA@135..136 ","
|
||||
WHITESPACE@136..137 " "
|
||||
RECORD_EXPR_FIELD@137..152
|
||||
NAME_REF@137..144
|
||||
IDENT@137..144 "entries"
|
||||
COLON@144..145 ":"
|
||||
WHITESPACE@145..146 " "
|
||||
MACRO_CALL@146..152
|
||||
PATH@146..149
|
||||
PATH_SEGMENT@146..149
|
||||
NAME_REF@146..149
|
||||
IDENT@146..149 "vec"
|
||||
BANG@149..150 "!"
|
||||
TOKEN_TREE@150..152
|
||||
L_BRACK@150..151 "["
|
||||
R_BRACK@151..152 "]"
|
||||
WHITESPACE@152..153 " "
|
||||
R_CURLY@153..154 "}"
|
||||
R_PAREN@154..155 ")"
|
||||
WHITESPACE@155..160 "\n "
|
||||
R_CURLY@160..161 "}"
|
||||
WHITESPACE@161..167 "\n\n "
|
||||
FN@167..180
|
||||
FN_KW@167..169 "fn"
|
||||
|
@ -9,87 +9,91 @@ SOURCE_FILE@0..139
|
||||
R_PAREN@7..8 ")"
|
||||
WHITESPACE@8..9 " "
|
||||
BLOCK_EXPR@9..138
|
||||
L_CURLY@9..10 "{"
|
||||
WHITESPACE@10..15 "\n "
|
||||
LET_STMT@15..24
|
||||
LET_KW@15..18 "let"
|
||||
WHITESPACE@18..19 " "
|
||||
IDENT_PAT@19..22
|
||||
NAME@19..22
|
||||
IDENT@19..22 "foo"
|
||||
WHITESPACE@22..23 " "
|
||||
EQ@23..24 "="
|
||||
WHITESPACE@24..29 "\n "
|
||||
LET_STMT@29..41
|
||||
LET_KW@29..32 "let"
|
||||
WHITESPACE@32..33 " "
|
||||
IDENT_PAT@33..36
|
||||
NAME@33..36
|
||||
IDENT@33..36 "bar"
|
||||
WHITESPACE@36..37 " "
|
||||
EQ@37..38 "="
|
||||
WHITESPACE@38..39 " "
|
||||
LITERAL@39..40
|
||||
INT_NUMBER@39..40 "1"
|
||||
SEMICOLON@40..41 ";"
|
||||
WHITESPACE@41..46 "\n "
|
||||
LET_STMT@46..49
|
||||
LET_KW@46..49 "let"
|
||||
WHITESPACE@49..54 "\n "
|
||||
LET_STMT@54..67
|
||||
LET_KW@54..57 "let"
|
||||
WHITESPACE@57..58 " "
|
||||
IDENT_PAT@58..61
|
||||
NAME@58..61
|
||||
IDENT@58..61 "baz"
|
||||
WHITESPACE@61..62 " "
|
||||
EQ@62..63 "="
|
||||
WHITESPACE@63..64 " "
|
||||
LITERAL@64..66
|
||||
INT_NUMBER@64..66 "92"
|
||||
SEMICOLON@66..67 ";"
|
||||
WHITESPACE@67..72 "\n "
|
||||
LET_STMT@72..75
|
||||
LET_KW@72..75 "let"
|
||||
WHITESPACE@75..80 "\n "
|
||||
EXPR_STMT@80..90
|
||||
IF_EXPR@80..90
|
||||
IF_KW@80..82 "if"
|
||||
WHITESPACE@82..83 " "
|
||||
CONDITION@83..87
|
||||
LITERAL@83..87
|
||||
TRUE_KW@83..87 "true"
|
||||
WHITESPACE@87..88 " "
|
||||
BLOCK_EXPR@88..90
|
||||
L_CURLY@88..89 "{"
|
||||
R_CURLY@89..90 "}"
|
||||
WHITESPACE@90..95 "\n "
|
||||
LET_STMT@95..98
|
||||
LET_KW@95..98 "let"
|
||||
WHITESPACE@98..103 "\n "
|
||||
EXPR_STMT@103..116
|
||||
WHILE_EXPR@103..116
|
||||
WHILE_KW@103..108 "while"
|
||||
WHITESPACE@108..109 " "
|
||||
CONDITION@109..113
|
||||
LITERAL@109..113
|
||||
TRUE_KW@109..113 "true"
|
||||
WHITESPACE@113..114 " "
|
||||
BLOCK_EXPR@114..116
|
||||
L_CURLY@114..115 "{"
|
||||
R_CURLY@115..116 "}"
|
||||
WHITESPACE@116..121 "\n "
|
||||
LET_STMT@121..124
|
||||
LET_KW@121..124 "let"
|
||||
WHITESPACE@124..129 "\n "
|
||||
LOOP_EXPR@129..136
|
||||
LOOP_KW@129..133 "loop"
|
||||
WHITESPACE@133..134 " "
|
||||
BLOCK_EXPR@134..136
|
||||
L_CURLY@134..135 "{"
|
||||
R_CURLY@135..136 "}"
|
||||
WHITESPACE@136..137 "\n"
|
||||
R_CURLY@137..138 "}"
|
||||
STMT_LIST@9..138
|
||||
L_CURLY@9..10 "{"
|
||||
WHITESPACE@10..15 "\n "
|
||||
LET_STMT@15..24
|
||||
LET_KW@15..18 "let"
|
||||
WHITESPACE@18..19 " "
|
||||
IDENT_PAT@19..22
|
||||
NAME@19..22
|
||||
IDENT@19..22 "foo"
|
||||
WHITESPACE@22..23 " "
|
||||
EQ@23..24 "="
|
||||
WHITESPACE@24..29 "\n "
|
||||
LET_STMT@29..41
|
||||
LET_KW@29..32 "let"
|
||||
WHITESPACE@32..33 " "
|
||||
IDENT_PAT@33..36
|
||||
NAME@33..36
|
||||
IDENT@33..36 "bar"
|
||||
WHITESPACE@36..37 " "
|
||||
EQ@37..38 "="
|
||||
WHITESPACE@38..39 " "
|
||||
LITERAL@39..40
|
||||
INT_NUMBER@39..40 "1"
|
||||
SEMICOLON@40..41 ";"
|
||||
WHITESPACE@41..46 "\n "
|
||||
LET_STMT@46..49
|
||||
LET_KW@46..49 "let"
|
||||
WHITESPACE@49..54 "\n "
|
||||
LET_STMT@54..67
|
||||
LET_KW@54..57 "let"
|
||||
WHITESPACE@57..58 " "
|
||||
IDENT_PAT@58..61
|
||||
NAME@58..61
|
||||
IDENT@58..61 "baz"
|
||||
WHITESPACE@61..62 " "
|
||||
EQ@62..63 "="
|
||||
WHITESPACE@63..64 " "
|
||||
LITERAL@64..66
|
||||
INT_NUMBER@64..66 "92"
|
||||
SEMICOLON@66..67 ";"
|
||||
WHITESPACE@67..72 "\n "
|
||||
LET_STMT@72..75
|
||||
LET_KW@72..75 "let"
|
||||
WHITESPACE@75..80 "\n "
|
||||
EXPR_STMT@80..90
|
||||
IF_EXPR@80..90
|
||||
IF_KW@80..82 "if"
|
||||
WHITESPACE@82..83 " "
|
||||
CONDITION@83..87
|
||||
LITERAL@83..87
|
||||
TRUE_KW@83..87 "true"
|
||||
WHITESPACE@87..88 " "
|
||||
BLOCK_EXPR@88..90
|
||||
STMT_LIST@88..90
|
||||
L_CURLY@88..89 "{"
|
||||
R_CURLY@89..90 "}"
|
||||
WHITESPACE@90..95 "\n "
|
||||
LET_STMT@95..98
|
||||
LET_KW@95..98 "let"
|
||||
WHITESPACE@98..103 "\n "
|
||||
EXPR_STMT@103..116
|
||||
WHILE_EXPR@103..116
|
||||
WHILE_KW@103..108 "while"
|
||||
WHITESPACE@108..109 " "
|
||||
CONDITION@109..113
|
||||
LITERAL@109..113
|
||||
TRUE_KW@109..113 "true"
|
||||
WHITESPACE@113..114 " "
|
||||
BLOCK_EXPR@114..116
|
||||
STMT_LIST@114..116
|
||||
L_CURLY@114..115 "{"
|
||||
R_CURLY@115..116 "}"
|
||||
WHITESPACE@116..121 "\n "
|
||||
LET_STMT@121..124
|
||||
LET_KW@121..124 "let"
|
||||
WHITESPACE@124..129 "\n "
|
||||
LOOP_EXPR@129..136
|
||||
LOOP_KW@129..133 "loop"
|
||||
WHITESPACE@133..134 " "
|
||||
BLOCK_EXPR@134..136
|
||||
STMT_LIST@134..136
|
||||
L_CURLY@134..135 "{"
|
||||
R_CURLY@135..136 "}"
|
||||
WHITESPACE@136..137 "\n"
|
||||
R_CURLY@137..138 "}"
|
||||
WHITESPACE@138..139 "\n"
|
||||
error 24..24: expected expression
|
||||
error 24..24: expected SEMICOLON
|
||||
|
@ -12,8 +12,9 @@ SOURCE_FILE@0..16
|
||||
R_PAREN@11..12 ")"
|
||||
WHITESPACE@12..13 " "
|
||||
BLOCK_EXPR@13..15
|
||||
L_CURLY@13..14 "{"
|
||||
R_CURLY@14..15 "}"
|
||||
STMT_LIST@13..15
|
||||
L_CURLY@13..14 "{"
|
||||
R_CURLY@14..15 "}"
|
||||
WHITESPACE@15..16 "\n"
|
||||
error 2..2: expected a name
|
||||
error 2..2: expected function arguments
|
||||
|
@ -26,8 +26,9 @@ SOURCE_FILE@0..22
|
||||
R_PAREN@16..17 ")"
|
||||
WHITESPACE@17..18 " "
|
||||
BLOCK_EXPR@18..21
|
||||
L_CURLY@18..19 "{"
|
||||
WHITESPACE@19..20 "\n"
|
||||
R_CURLY@20..21 "}"
|
||||
STMT_LIST@18..21
|
||||
L_CURLY@18..19 "{"
|
||||
WHITESPACE@19..20 "\n"
|
||||
R_CURLY@20..21 "}"
|
||||
WHITESPACE@21..22 "\n"
|
||||
error 16..16: missing type for function parameter
|
||||
|
@ -9,35 +9,36 @@ SOURCE_FILE@0..112
|
||||
R_PAREN@5..6 ")"
|
||||
WHITESPACE@6..7 " "
|
||||
BLOCK_EXPR@7..33
|
||||
L_CURLY@7..8 "{"
|
||||
WHITESPACE@8..9 " "
|
||||
EXPR_STMT@9..17
|
||||
ARRAY_EXPR@9..17
|
||||
L_BRACK@9..10 "["
|
||||
LITERAL@10..11
|
||||
INT_NUMBER@10..11 "1"
|
||||
COMMA@11..12 ","
|
||||
WHITESPACE@12..13 " "
|
||||
LITERAL@13..14
|
||||
INT_NUMBER@13..14 "2"
|
||||
COMMA@14..15 ","
|
||||
WHITESPACE@15..16 " "
|
||||
ERROR@16..17
|
||||
AT@16..17 "@"
|
||||
ERROR@17..18
|
||||
COMMA@17..18 ","
|
||||
WHITESPACE@18..19 " "
|
||||
STRUCT@19..26
|
||||
STRUCT_KW@19..25 "struct"
|
||||
ERROR@25..26
|
||||
COMMA@25..26 ","
|
||||
WHITESPACE@26..27 " "
|
||||
LET_STMT@27..31
|
||||
LET_KW@27..30 "let"
|
||||
ERROR@30..31
|
||||
R_BRACK@30..31 "]"
|
||||
WHITESPACE@31..32 " "
|
||||
R_CURLY@32..33 "}"
|
||||
STMT_LIST@7..33
|
||||
L_CURLY@7..8 "{"
|
||||
WHITESPACE@8..9 " "
|
||||
EXPR_STMT@9..17
|
||||
ARRAY_EXPR@9..17
|
||||
L_BRACK@9..10 "["
|
||||
LITERAL@10..11
|
||||
INT_NUMBER@10..11 "1"
|
||||
COMMA@11..12 ","
|
||||
WHITESPACE@12..13 " "
|
||||
LITERAL@13..14
|
||||
INT_NUMBER@13..14 "2"
|
||||
COMMA@14..15 ","
|
||||
WHITESPACE@15..16 " "
|
||||
ERROR@16..17
|
||||
AT@16..17 "@"
|
||||
ERROR@17..18
|
||||
COMMA@17..18 ","
|
||||
WHITESPACE@18..19 " "
|
||||
STRUCT@19..26
|
||||
STRUCT_KW@19..25 "struct"
|
||||
ERROR@25..26
|
||||
COMMA@25..26 ","
|
||||
WHITESPACE@26..27 " "
|
||||
LET_STMT@27..31
|
||||
LET_KW@27..30 "let"
|
||||
ERROR@30..31
|
||||
R_BRACK@30..31 "]"
|
||||
WHITESPACE@31..32 " "
|
||||
R_CURLY@32..33 "}"
|
||||
WHITESPACE@33..34 "\n"
|
||||
FN@34..68
|
||||
FN_KW@34..36 "fn"
|
||||
@ -49,41 +50,42 @@ SOURCE_FILE@0..112
|
||||
R_PAREN@39..40 ")"
|
||||
WHITESPACE@40..41 " "
|
||||
BLOCK_EXPR@41..68
|
||||
L_CURLY@41..42 "{"
|
||||
WHITESPACE@42..43 " "
|
||||
EXPR_STMT@43..54
|
||||
CALL_EXPR@43..54
|
||||
PATH_EXPR@43..46
|
||||
PATH@43..46
|
||||
PATH_SEGMENT@43..46
|
||||
NAME_REF@43..46
|
||||
IDENT@43..46 "foo"
|
||||
ARG_LIST@46..54
|
||||
L_PAREN@46..47 "("
|
||||
LITERAL@47..48
|
||||
INT_NUMBER@47..48 "1"
|
||||
COMMA@48..49 ","
|
||||
WHITESPACE@49..50 " "
|
||||
LITERAL@50..51
|
||||
INT_NUMBER@50..51 "2"
|
||||
COMMA@51..52 ","
|
||||
WHITESPACE@52..53 " "
|
||||
ERROR@53..54
|
||||
AT@53..54 "@"
|
||||
ERROR@54..55
|
||||
COMMA@54..55 ","
|
||||
WHITESPACE@55..56 " "
|
||||
IMPL@56..60
|
||||
IMPL_KW@56..60 "impl"
|
||||
ERROR@60..61
|
||||
COMMA@60..61 ","
|
||||
WHITESPACE@61..62 " "
|
||||
LET_STMT@62..65
|
||||
LET_KW@62..65 "let"
|
||||
ERROR@65..66
|
||||
R_PAREN@65..66 ")"
|
||||
WHITESPACE@66..67 " "
|
||||
R_CURLY@67..68 "}"
|
||||
STMT_LIST@41..68
|
||||
L_CURLY@41..42 "{"
|
||||
WHITESPACE@42..43 " "
|
||||
EXPR_STMT@43..54
|
||||
CALL_EXPR@43..54
|
||||
PATH_EXPR@43..46
|
||||
PATH@43..46
|
||||
PATH_SEGMENT@43..46
|
||||
NAME_REF@43..46
|
||||
IDENT@43..46 "foo"
|
||||
ARG_LIST@46..54
|
||||
L_PAREN@46..47 "("
|
||||
LITERAL@47..48
|
||||
INT_NUMBER@47..48 "1"
|
||||
COMMA@48..49 ","
|
||||
WHITESPACE@49..50 " "
|
||||
LITERAL@50..51
|
||||
INT_NUMBER@50..51 "2"
|
||||
COMMA@51..52 ","
|
||||
WHITESPACE@52..53 " "
|
||||
ERROR@53..54
|
||||
AT@53..54 "@"
|
||||
ERROR@54..55
|
||||
COMMA@54..55 ","
|
||||
WHITESPACE@55..56 " "
|
||||
IMPL@56..60
|
||||
IMPL_KW@56..60 "impl"
|
||||
ERROR@60..61
|
||||
COMMA@60..61 ","
|
||||
WHITESPACE@61..62 " "
|
||||
LET_STMT@62..65
|
||||
LET_KW@62..65 "let"
|
||||
ERROR@65..66
|
||||
R_PAREN@65..66 ")"
|
||||
WHITESPACE@66..67 " "
|
||||
R_CURLY@67..68 "}"
|
||||
WHITESPACE@68..69 "\n"
|
||||
FN@69..111
|
||||
FN_KW@69..71 "fn"
|
||||
@ -95,49 +97,50 @@ SOURCE_FILE@0..112
|
||||
R_PAREN@74..75 ")"
|
||||
WHITESPACE@75..76 " "
|
||||
BLOCK_EXPR@76..111
|
||||
L_CURLY@76..77 "{"
|
||||
WHITESPACE@77..78 " "
|
||||
EXPR_STMT@78..93
|
||||
METHOD_CALL_EXPR@78..93
|
||||
PATH_EXPR@78..81
|
||||
PATH@78..81
|
||||
PATH_SEGMENT@78..81
|
||||
NAME_REF@78..81
|
||||
IDENT@78..81 "foo"
|
||||
DOT@81..82 "."
|
||||
NAME_REF@82..85
|
||||
IDENT@82..85 "bar"
|
||||
ARG_LIST@85..93
|
||||
L_PAREN@85..86 "("
|
||||
LITERAL@86..87
|
||||
INT_NUMBER@86..87 "1"
|
||||
COMMA@87..88 ","
|
||||
WHITESPACE@88..89 " "
|
||||
LITERAL@89..90
|
||||
INT_NUMBER@89..90 "2"
|
||||
COMMA@90..91 ","
|
||||
WHITESPACE@91..92 " "
|
||||
ERROR@92..93
|
||||
AT@92..93 "@"
|
||||
ERROR@93..94
|
||||
COMMA@93..94 ","
|
||||
WHITESPACE@94..95 " "
|
||||
ERROR@95..96
|
||||
R_BRACK@95..96 "]"
|
||||
ERROR@96..97
|
||||
COMMA@96..97 ","
|
||||
WHITESPACE@97..98 " "
|
||||
TRAIT@98..104
|
||||
TRAIT_KW@98..103 "trait"
|
||||
ERROR@103..104
|
||||
COMMA@103..104 ","
|
||||
WHITESPACE@104..105 " "
|
||||
LET_STMT@105..108
|
||||
LET_KW@105..108 "let"
|
||||
ERROR@108..109
|
||||
R_PAREN@108..109 ")"
|
||||
WHITESPACE@109..110 " "
|
||||
R_CURLY@110..111 "}"
|
||||
STMT_LIST@76..111
|
||||
L_CURLY@76..77 "{"
|
||||
WHITESPACE@77..78 " "
|
||||
EXPR_STMT@78..93
|
||||
METHOD_CALL_EXPR@78..93
|
||||
PATH_EXPR@78..81
|
||||
PATH@78..81
|
||||
PATH_SEGMENT@78..81
|
||||
NAME_REF@78..81
|
||||
IDENT@78..81 "foo"
|
||||
DOT@81..82 "."
|
||||
NAME_REF@82..85
|
||||
IDENT@82..85 "bar"
|
||||
ARG_LIST@85..93
|
||||
L_PAREN@85..86 "("
|
||||
LITERAL@86..87
|
||||
INT_NUMBER@86..87 "1"
|
||||
COMMA@87..88 ","
|
||||
WHITESPACE@88..89 " "
|
||||
LITERAL@89..90
|
||||
INT_NUMBER@89..90 "2"
|
||||
COMMA@90..91 ","
|
||||
WHITESPACE@91..92 " "
|
||||
ERROR@92..93
|
||||
AT@92..93 "@"
|
||||
ERROR@93..94
|
||||
COMMA@93..94 ","
|
||||
WHITESPACE@94..95 " "
|
||||
ERROR@95..96
|
||||
R_BRACK@95..96 "]"
|
||||
ERROR@96..97
|
||||
COMMA@96..97 ","
|
||||
WHITESPACE@97..98 " "
|
||||
TRAIT@98..104
|
||||
TRAIT_KW@98..103 "trait"
|
||||
ERROR@103..104
|
||||
COMMA@103..104 ","
|
||||
WHITESPACE@104..105 " "
|
||||
LET_STMT@105..108
|
||||
LET_KW@105..108 "let"
|
||||
ERROR@108..109
|
||||
R_PAREN@108..109 ")"
|
||||
WHITESPACE@109..110 " "
|
||||
R_CURLY@110..111 "}"
|
||||
WHITESPACE@111..112 "\n"
|
||||
error 16..16: expected expression
|
||||
error 17..17: expected R_BRACK
|
||||
|
@ -9,30 +9,31 @@ SOURCE_FILE@0..94
|
||||
R_PAREN@8..9 ")"
|
||||
WHITESPACE@9..10 " "
|
||||
BLOCK_EXPR@10..55
|
||||
L_CURLY@10..11 "{"
|
||||
WHITESPACE@11..16 "\n "
|
||||
MACRO_CALL@16..49
|
||||
PATH@16..19
|
||||
PATH_SEGMENT@16..19
|
||||
NAME_REF@16..19
|
||||
IDENT@16..19 "foo"
|
||||
BANG@19..20 "!"
|
||||
WHITESPACE@20..21 " "
|
||||
TOKEN_TREE@21..49
|
||||
L_PAREN@21..22 "("
|
||||
WHITESPACE@22..31 "\n "
|
||||
IDENT@31..34 "bar"
|
||||
COMMA@34..35 ","
|
||||
WHITESPACE@35..36 " "
|
||||
STRING@36..41 "\"baz\""
|
||||
COMMA@41..42 ","
|
||||
WHITESPACE@42..43 " "
|
||||
INT_NUMBER@43..44 "1"
|
||||
COMMA@44..45 ","
|
||||
WHITESPACE@45..46 " "
|
||||
FLOAT_NUMBER@46..49 "2.0"
|
||||
WHITESPACE@49..54 "\n "
|
||||
R_CURLY@54..55 "}"
|
||||
STMT_LIST@10..55
|
||||
L_CURLY@10..11 "{"
|
||||
WHITESPACE@11..16 "\n "
|
||||
MACRO_CALL@16..49
|
||||
PATH@16..19
|
||||
PATH_SEGMENT@16..19
|
||||
NAME_REF@16..19
|
||||
IDENT@16..19 "foo"
|
||||
BANG@19..20 "!"
|
||||
WHITESPACE@20..21 " "
|
||||
TOKEN_TREE@21..49
|
||||
L_PAREN@21..22 "("
|
||||
WHITESPACE@22..31 "\n "
|
||||
IDENT@31..34 "bar"
|
||||
COMMA@34..35 ","
|
||||
WHITESPACE@35..36 " "
|
||||
STRING@36..41 "\"baz\""
|
||||
COMMA@41..42 ","
|
||||
WHITESPACE@42..43 " "
|
||||
INT_NUMBER@43..44 "1"
|
||||
COMMA@44..45 ","
|
||||
WHITESPACE@45..46 " "
|
||||
FLOAT_NUMBER@46..49 "2.0"
|
||||
WHITESPACE@49..54 "\n "
|
||||
R_CURLY@54..55 "}"
|
||||
WHITESPACE@55..56 " "
|
||||
COMMENT@56..91 "//~ ERROR incorrect c ..."
|
||||
WHITESPACE@91..92 "\n"
|
||||
|
@ -64,8 +64,9 @@ SOURCE_FILE@0..240
|
||||
R_PAREN@49..50 ")"
|
||||
WHITESPACE@50..51 " "
|
||||
BLOCK_EXPR@51..53
|
||||
L_CURLY@51..52 "{"
|
||||
R_CURLY@52..53 "}"
|
||||
STMT_LIST@51..53
|
||||
L_CURLY@51..52 "{"
|
||||
R_CURLY@52..53 "}"
|
||||
WHITESPACE@53..55 "\n\n"
|
||||
FN@55..239
|
||||
FN_KW@55..57 "fn"
|
||||
@ -77,219 +78,220 @@ SOURCE_FILE@0..240
|
||||
R_PAREN@63..64 ")"
|
||||
WHITESPACE@64..65 " "
|
||||
BLOCK_EXPR@65..239
|
||||
L_CURLY@65..66 "{"
|
||||
WHITESPACE@66..71 "\n "
|
||||
LET_STMT@71..121
|
||||
LET_KW@71..74 "let"
|
||||
WHITESPACE@74..75 " "
|
||||
WILDCARD_PAT@75..76
|
||||
UNDERSCORE@75..76 "_"
|
||||
COLON@76..77 ":"
|
||||
WHITESPACE@77..78 " "
|
||||
DYN_TRAIT_TYPE@78..121
|
||||
TYPE_BOUND_LIST@78..121
|
||||
TYPE_BOUND@78..88
|
||||
PATH_TYPE@78..88
|
||||
PATH@78..88
|
||||
PATH_SEGMENT@78..88
|
||||
NAME_REF@78..81
|
||||
IDENT@78..81 "Box"
|
||||
GENERIC_ARG_LIST@81..88
|
||||
L_ANGLE@81..82 "<"
|
||||
TYPE_ARG@82..88
|
||||
PAREN_TYPE@82..88
|
||||
L_PAREN@82..83 "("
|
||||
PATH_TYPE@83..87
|
||||
PATH@83..87
|
||||
PATH_SEGMENT@83..87
|
||||
NAME_REF@83..87
|
||||
IDENT@83..87 "Copy"
|
||||
R_PAREN@87..88 ")"
|
||||
WHITESPACE@88..89 " "
|
||||
PLUS@89..90 "+"
|
||||
WHITESPACE@90..91 " "
|
||||
TYPE_BOUND@91..99
|
||||
L_PAREN@91..92 "("
|
||||
QUESTION@92..93 "?"
|
||||
PATH_TYPE@93..98
|
||||
PATH@93..98
|
||||
PATH_SEGMENT@93..98
|
||||
NAME_REF@93..98
|
||||
IDENT@93..98 "Sized"
|
||||
R_PAREN@98..99 ")"
|
||||
WHITESPACE@99..100 " "
|
||||
PLUS@100..101 "+"
|
||||
WHITESPACE@101..102 " "
|
||||
TYPE_BOUND@102..121
|
||||
L_PAREN@102..103 "("
|
||||
FOR_TYPE@103..120
|
||||
FOR_KW@103..106 "for"
|
||||
GENERIC_PARAM_LIST@106..110
|
||||
L_ANGLE@106..107 "<"
|
||||
LIFETIME_PARAM@107..109
|
||||
LIFETIME@107..109
|
||||
LIFETIME_IDENT@107..109 "'a"
|
||||
R_ANGLE@109..110 ">"
|
||||
WHITESPACE@110..111 " "
|
||||
PATH_TYPE@111..120
|
||||
PATH@111..120
|
||||
PATH_SEGMENT@111..120
|
||||
NAME_REF@111..116
|
||||
IDENT@111..116 "Trait"
|
||||
GENERIC_ARG_LIST@116..120
|
||||
L_ANGLE@116..117 "<"
|
||||
LIFETIME_ARG@117..119
|
||||
LIFETIME@117..119
|
||||
LIFETIME_IDENT@117..119 "'a"
|
||||
R_ANGLE@119..120 ">"
|
||||
R_PAREN@120..121 ")"
|
||||
ERROR@121..122
|
||||
R_ANGLE@121..122 ">"
|
||||
SEMICOLON@122..123 ";"
|
||||
WHITESPACE@123..128 "\n "
|
||||
LET_STMT@128..141
|
||||
LET_KW@128..131 "let"
|
||||
WHITESPACE@131..132 " "
|
||||
WILDCARD_PAT@132..133
|
||||
UNDERSCORE@132..133 "_"
|
||||
COLON@133..134 ":"
|
||||
WHITESPACE@134..135 " "
|
||||
PATH_TYPE@135..141
|
||||
PATH@135..141
|
||||
PATH_SEGMENT@135..141
|
||||
NAME_REF@135..138
|
||||
IDENT@135..138 "Box"
|
||||
GENERIC_ARG_LIST@138..141
|
||||
L_ANGLE@138..139 "<"
|
||||
TYPE_ARG@139..141
|
||||
PAREN_TYPE@139..141
|
||||
L_PAREN@139..140 "("
|
||||
ERROR@140..141
|
||||
QUESTION@140..141 "?"
|
||||
EXPR_STMT@141..146
|
||||
PATH_EXPR@141..146
|
||||
PATH@141..146
|
||||
PATH_SEGMENT@141..146
|
||||
NAME_REF@141..146
|
||||
IDENT@141..146 "Sized"
|
||||
ERROR@146..147
|
||||
R_PAREN@146..147 ")"
|
||||
WHITESPACE@147..148 " "
|
||||
ERROR@148..149
|
||||
PLUS@148..149 "+"
|
||||
WHITESPACE@149..150 " "
|
||||
EXPR_STMT@150..180
|
||||
TUPLE_EXPR@150..180
|
||||
L_PAREN@150..151 "("
|
||||
FOR_EXPR@151..180
|
||||
FOR_KW@151..154 "for"
|
||||
PATH_PAT@154..158
|
||||
PATH@154..158
|
||||
PATH_SEGMENT@154..158
|
||||
L_ANGLE@154..155 "<"
|
||||
ERROR@155..157
|
||||
LIFETIME_IDENT@155..157 "'a"
|
||||
R_ANGLE@157..158 ">"
|
||||
WHITESPACE@158..159 " "
|
||||
BIN_EXPR@159..180
|
||||
BIN_EXPR@159..178
|
||||
BIN_EXPR@159..169
|
||||
BIN_EXPR@159..167
|
||||
PATH_EXPR@159..164
|
||||
PATH@159..164
|
||||
PATH_SEGMENT@159..164
|
||||
NAME_REF@159..164
|
||||
IDENT@159..164 "Trait"
|
||||
L_ANGLE@164..165 "<"
|
||||
ERROR@165..167
|
||||
LIFETIME_IDENT@165..167 "'a"
|
||||
R_ANGLE@167..168 ">"
|
||||
ERROR@168..169
|
||||
R_PAREN@168..169 ")"
|
||||
WHITESPACE@169..170 " "
|
||||
PLUS@170..171 "+"
|
||||
WHITESPACE@171..172 " "
|
||||
PAREN_EXPR@172..178
|
||||
L_PAREN@172..173 "("
|
||||
PATH_EXPR@173..177
|
||||
PATH@173..177
|
||||
PATH_SEGMENT@173..177
|
||||
NAME_REF@173..177
|
||||
IDENT@173..177 "Copy"
|
||||
R_PAREN@177..178 ")"
|
||||
R_ANGLE@178..179 ">"
|
||||
ERROR@179..180
|
||||
SEMICOLON@179..180 ";"
|
||||
WHITESPACE@180..185 "\n "
|
||||
LET_STMT@185..235
|
||||
LET_KW@185..188 "let"
|
||||
WHITESPACE@188..189 " "
|
||||
WILDCARD_PAT@189..190
|
||||
UNDERSCORE@189..190 "_"
|
||||
COLON@190..191 ":"
|
||||
WHITESPACE@191..192 " "
|
||||
DYN_TRAIT_TYPE@192..235
|
||||
TYPE_BOUND_LIST@192..235
|
||||
TYPE_BOUND@192..215
|
||||
PATH_TYPE@192..215
|
||||
PATH@192..215
|
||||
PATH_SEGMENT@192..215
|
||||
NAME_REF@192..195
|
||||
IDENT@192..195 "Box"
|
||||
GENERIC_ARG_LIST@195..215
|
||||
L_ANGLE@195..196 "<"
|
||||
TYPE_ARG@196..215
|
||||
PAREN_TYPE@196..215
|
||||
L_PAREN@196..197 "("
|
||||
FOR_TYPE@197..214
|
||||
FOR_KW@197..200 "for"
|
||||
GENERIC_PARAM_LIST@200..204
|
||||
L_ANGLE@200..201 "<"
|
||||
LIFETIME_PARAM@201..203
|
||||
LIFETIME@201..203
|
||||
LIFETIME_IDENT@201..203 "'a"
|
||||
R_ANGLE@203..204 ">"
|
||||
WHITESPACE@204..205 " "
|
||||
PATH_TYPE@205..214
|
||||
PATH@205..214
|
||||
PATH_SEGMENT@205..214
|
||||
NAME_REF@205..210
|
||||
IDENT@205..210 "Trait"
|
||||
GENERIC_ARG_LIST@210..214
|
||||
L_ANGLE@210..211 "<"
|
||||
LIFETIME_ARG@211..213
|
||||
LIFETIME@211..213
|
||||
LIFETIME_IDENT@211..213 "'a"
|
||||
R_ANGLE@213..214 ">"
|
||||
R_PAREN@214..215 ")"
|
||||
WHITESPACE@215..216 " "
|
||||
PLUS@216..217 "+"
|
||||
WHITESPACE@217..218 " "
|
||||
TYPE_BOUND@218..224
|
||||
L_PAREN@218..219 "("
|
||||
PATH_TYPE@219..223
|
||||
PATH@219..223
|
||||
PATH_SEGMENT@219..223
|
||||
NAME_REF@219..223
|
||||
IDENT@219..223 "Copy"
|
||||
R_PAREN@223..224 ")"
|
||||
WHITESPACE@224..225 " "
|
||||
PLUS@225..226 "+"
|
||||
WHITESPACE@226..227 " "
|
||||
TYPE_BOUND@227..235
|
||||
L_PAREN@227..228 "("
|
||||
QUESTION@228..229 "?"
|
||||
PATH_TYPE@229..234
|
||||
PATH@229..234
|
||||
PATH_SEGMENT@229..234
|
||||
NAME_REF@229..234
|
||||
IDENT@229..234 "Sized"
|
||||
R_PAREN@234..235 ")"
|
||||
ERROR@235..236
|
||||
R_ANGLE@235..236 ">"
|
||||
SEMICOLON@236..237 ";"
|
||||
WHITESPACE@237..238 "\n"
|
||||
R_CURLY@238..239 "}"
|
||||
STMT_LIST@65..239
|
||||
L_CURLY@65..66 "{"
|
||||
WHITESPACE@66..71 "\n "
|
||||
LET_STMT@71..121
|
||||
LET_KW@71..74 "let"
|
||||
WHITESPACE@74..75 " "
|
||||
WILDCARD_PAT@75..76
|
||||
UNDERSCORE@75..76 "_"
|
||||
COLON@76..77 ":"
|
||||
WHITESPACE@77..78 " "
|
||||
DYN_TRAIT_TYPE@78..121
|
||||
TYPE_BOUND_LIST@78..121
|
||||
TYPE_BOUND@78..88
|
||||
PATH_TYPE@78..88
|
||||
PATH@78..88
|
||||
PATH_SEGMENT@78..88
|
||||
NAME_REF@78..81
|
||||
IDENT@78..81 "Box"
|
||||
GENERIC_ARG_LIST@81..88
|
||||
L_ANGLE@81..82 "<"
|
||||
TYPE_ARG@82..88
|
||||
PAREN_TYPE@82..88
|
||||
L_PAREN@82..83 "("
|
||||
PATH_TYPE@83..87
|
||||
PATH@83..87
|
||||
PATH_SEGMENT@83..87
|
||||
NAME_REF@83..87
|
||||
IDENT@83..87 "Copy"
|
||||
R_PAREN@87..88 ")"
|
||||
WHITESPACE@88..89 " "
|
||||
PLUS@89..90 "+"
|
||||
WHITESPACE@90..91 " "
|
||||
TYPE_BOUND@91..99
|
||||
L_PAREN@91..92 "("
|
||||
QUESTION@92..93 "?"
|
||||
PATH_TYPE@93..98
|
||||
PATH@93..98
|
||||
PATH_SEGMENT@93..98
|
||||
NAME_REF@93..98
|
||||
IDENT@93..98 "Sized"
|
||||
R_PAREN@98..99 ")"
|
||||
WHITESPACE@99..100 " "
|
||||
PLUS@100..101 "+"
|
||||
WHITESPACE@101..102 " "
|
||||
TYPE_BOUND@102..121
|
||||
L_PAREN@102..103 "("
|
||||
FOR_TYPE@103..120
|
||||
FOR_KW@103..106 "for"
|
||||
GENERIC_PARAM_LIST@106..110
|
||||
L_ANGLE@106..107 "<"
|
||||
LIFETIME_PARAM@107..109
|
||||
LIFETIME@107..109
|
||||
LIFETIME_IDENT@107..109 "'a"
|
||||
R_ANGLE@109..110 ">"
|
||||
WHITESPACE@110..111 " "
|
||||
PATH_TYPE@111..120
|
||||
PATH@111..120
|
||||
PATH_SEGMENT@111..120
|
||||
NAME_REF@111..116
|
||||
IDENT@111..116 "Trait"
|
||||
GENERIC_ARG_LIST@116..120
|
||||
L_ANGLE@116..117 "<"
|
||||
LIFETIME_ARG@117..119
|
||||
LIFETIME@117..119
|
||||
LIFETIME_IDENT@117..119 "'a"
|
||||
R_ANGLE@119..120 ">"
|
||||
R_PAREN@120..121 ")"
|
||||
ERROR@121..122
|
||||
R_ANGLE@121..122 ">"
|
||||
SEMICOLON@122..123 ";"
|
||||
WHITESPACE@123..128 "\n "
|
||||
LET_STMT@128..141
|
||||
LET_KW@128..131 "let"
|
||||
WHITESPACE@131..132 " "
|
||||
WILDCARD_PAT@132..133
|
||||
UNDERSCORE@132..133 "_"
|
||||
COLON@133..134 ":"
|
||||
WHITESPACE@134..135 " "
|
||||
PATH_TYPE@135..141
|
||||
PATH@135..141
|
||||
PATH_SEGMENT@135..141
|
||||
NAME_REF@135..138
|
||||
IDENT@135..138 "Box"
|
||||
GENERIC_ARG_LIST@138..141
|
||||
L_ANGLE@138..139 "<"
|
||||
TYPE_ARG@139..141
|
||||
PAREN_TYPE@139..141
|
||||
L_PAREN@139..140 "("
|
||||
ERROR@140..141
|
||||
QUESTION@140..141 "?"
|
||||
EXPR_STMT@141..146
|
||||
PATH_EXPR@141..146
|
||||
PATH@141..146
|
||||
PATH_SEGMENT@141..146
|
||||
NAME_REF@141..146
|
||||
IDENT@141..146 "Sized"
|
||||
ERROR@146..147
|
||||
R_PAREN@146..147 ")"
|
||||
WHITESPACE@147..148 " "
|
||||
ERROR@148..149
|
||||
PLUS@148..149 "+"
|
||||
WHITESPACE@149..150 " "
|
||||
EXPR_STMT@150..180
|
||||
TUPLE_EXPR@150..180
|
||||
L_PAREN@150..151 "("
|
||||
FOR_EXPR@151..180
|
||||
FOR_KW@151..154 "for"
|
||||
PATH_PAT@154..158
|
||||
PATH@154..158
|
||||
PATH_SEGMENT@154..158
|
||||
L_ANGLE@154..155 "<"
|
||||
ERROR@155..157
|
||||
LIFETIME_IDENT@155..157 "'a"
|
||||
R_ANGLE@157..158 ">"
|
||||
WHITESPACE@158..159 " "
|
||||
BIN_EXPR@159..180
|
||||
BIN_EXPR@159..178
|
||||
BIN_EXPR@159..169
|
||||
BIN_EXPR@159..167
|
||||
PATH_EXPR@159..164
|
||||
PATH@159..164
|
||||
PATH_SEGMENT@159..164
|
||||
NAME_REF@159..164
|
||||
IDENT@159..164 "Trait"
|
||||
L_ANGLE@164..165 "<"
|
||||
ERROR@165..167
|
||||
LIFETIME_IDENT@165..167 "'a"
|
||||
R_ANGLE@167..168 ">"
|
||||
ERROR@168..169
|
||||
R_PAREN@168..169 ")"
|
||||
WHITESPACE@169..170 " "
|
||||
PLUS@170..171 "+"
|
||||
WHITESPACE@171..172 " "
|
||||
PAREN_EXPR@172..178
|
||||
L_PAREN@172..173 "("
|
||||
PATH_EXPR@173..177
|
||||
PATH@173..177
|
||||
PATH_SEGMENT@173..177
|
||||
NAME_REF@173..177
|
||||
IDENT@173..177 "Copy"
|
||||
R_PAREN@177..178 ")"
|
||||
R_ANGLE@178..179 ">"
|
||||
ERROR@179..180
|
||||
SEMICOLON@179..180 ";"
|
||||
WHITESPACE@180..185 "\n "
|
||||
LET_STMT@185..235
|
||||
LET_KW@185..188 "let"
|
||||
WHITESPACE@188..189 " "
|
||||
WILDCARD_PAT@189..190
|
||||
UNDERSCORE@189..190 "_"
|
||||
COLON@190..191 ":"
|
||||
WHITESPACE@191..192 " "
|
||||
DYN_TRAIT_TYPE@192..235
|
||||
TYPE_BOUND_LIST@192..235
|
||||
TYPE_BOUND@192..215
|
||||
PATH_TYPE@192..215
|
||||
PATH@192..215
|
||||
PATH_SEGMENT@192..215
|
||||
NAME_REF@192..195
|
||||
IDENT@192..195 "Box"
|
||||
GENERIC_ARG_LIST@195..215
|
||||
L_ANGLE@195..196 "<"
|
||||
TYPE_ARG@196..215
|
||||
PAREN_TYPE@196..215
|
||||
L_PAREN@196..197 "("
|
||||
FOR_TYPE@197..214
|
||||
FOR_KW@197..200 "for"
|
||||
GENERIC_PARAM_LIST@200..204
|
||||
L_ANGLE@200..201 "<"
|
||||
LIFETIME_PARAM@201..203
|
||||
LIFETIME@201..203
|
||||
LIFETIME_IDENT@201..203 "'a"
|
||||
R_ANGLE@203..204 ">"
|
||||
WHITESPACE@204..205 " "
|
||||
PATH_TYPE@205..214
|
||||
PATH@205..214
|
||||
PATH_SEGMENT@205..214
|
||||
NAME_REF@205..210
|
||||
IDENT@205..210 "Trait"
|
||||
GENERIC_ARG_LIST@210..214
|
||||
L_ANGLE@210..211 "<"
|
||||
LIFETIME_ARG@211..213
|
||||
LIFETIME@211..213
|
||||
LIFETIME_IDENT@211..213 "'a"
|
||||
R_ANGLE@213..214 ">"
|
||||
R_PAREN@214..215 ")"
|
||||
WHITESPACE@215..216 " "
|
||||
PLUS@216..217 "+"
|
||||
WHITESPACE@217..218 " "
|
||||
TYPE_BOUND@218..224
|
||||
L_PAREN@218..219 "("
|
||||
PATH_TYPE@219..223
|
||||
PATH@219..223
|
||||
PATH_SEGMENT@219..223
|
||||
NAME_REF@219..223
|
||||
IDENT@219..223 "Copy"
|
||||
R_PAREN@223..224 ")"
|
||||
WHITESPACE@224..225 " "
|
||||
PLUS@225..226 "+"
|
||||
WHITESPACE@226..227 " "
|
||||
TYPE_BOUND@227..235
|
||||
L_PAREN@227..228 "("
|
||||
QUESTION@228..229 "?"
|
||||
PATH_TYPE@229..234
|
||||
PATH@229..234
|
||||
PATH_SEGMENT@229..234
|
||||
NAME_REF@229..234
|
||||
IDENT@229..234 "Sized"
|
||||
R_PAREN@234..235 ")"
|
||||
ERROR@235..236
|
||||
R_ANGLE@235..236 ">"
|
||||
SEMICOLON@236..237 ";"
|
||||
WHITESPACE@237..238 "\n"
|
||||
R_CURLY@238..239 "}"
|
||||
WHITESPACE@239..240 "\n"
|
||||
error 88..88: expected COMMA
|
||||
error 88..88: expected R_ANGLE
|
||||
|
@ -9,185 +9,187 @@ SOURCE_FILE@0..575
|
||||
R_PAREN@8..9 ")"
|
||||
WHITESPACE@9..10 " "
|
||||
BLOCK_EXPR@10..574
|
||||
L_CURLY@10..11 "{"
|
||||
WHITESPACE@11..16 "\n "
|
||||
ENUM@16..152
|
||||
ENUM_KW@16..20 "enum"
|
||||
WHITESPACE@20..21 " "
|
||||
NAME@21..25
|
||||
IDENT@21..25 "Test"
|
||||
WHITESPACE@25..26 " "
|
||||
VARIANT_LIST@26..152
|
||||
L_CURLY@26..27 "{"
|
||||
WHITESPACE@27..36 "\n "
|
||||
VARIANT@36..40
|
||||
NAME@36..40
|
||||
IDENT@36..40 "Var1"
|
||||
COMMA@40..41 ","
|
||||
WHITESPACE@41..50 "\n "
|
||||
VARIANT@50..62
|
||||
NAME@50..54
|
||||
IDENT@50..54 "Var2"
|
||||
TUPLE_FIELD_LIST@54..62
|
||||
L_PAREN@54..55 "("
|
||||
TUPLE_FIELD@55..61
|
||||
PATH_TYPE@55..61
|
||||
PATH@55..61
|
||||
PATH_SEGMENT@55..61
|
||||
NAME_REF@55..61
|
||||
IDENT@55..61 "String"
|
||||
R_PAREN@61..62 ")"
|
||||
COMMA@62..63 ","
|
||||
WHITESPACE@63..72 "\n "
|
||||
VARIANT@72..145
|
||||
NAME@72..76
|
||||
IDENT@72..76 "Var3"
|
||||
WHITESPACE@76..77 " "
|
||||
RECORD_FIELD_LIST@77..145
|
||||
L_CURLY@77..78 "{"
|
||||
WHITESPACE@78..91 "\n "
|
||||
RECORD_FIELD@91..95
|
||||
NAME@91..94
|
||||
IDENT@91..94 "abc"
|
||||
COLON@94..95 ":"
|
||||
WHITESPACE@95..96 " "
|
||||
ERROR@96..98
|
||||
L_CURLY@96..97 "{"
|
||||
R_CURLY@97..98 "}"
|
||||
ERROR@98..99
|
||||
COMMA@98..99 ","
|
||||
WHITESPACE@99..100 " "
|
||||
COMMENT@100..135 "//~ ERROR: expected t ..."
|
||||
WHITESPACE@135..144 "\n "
|
||||
R_CURLY@144..145 "}"
|
||||
COMMA@145..146 ","
|
||||
WHITESPACE@146..151 "\n "
|
||||
R_CURLY@151..152 "}"
|
||||
WHITESPACE@152..158 "\n\n "
|
||||
COMMENT@158..171 "// recover..."
|
||||
WHITESPACE@171..176 "\n "
|
||||
LET_STMT@176..186
|
||||
LET_KW@176..179 "let"
|
||||
WHITESPACE@179..180 " "
|
||||
IDENT_PAT@180..181
|
||||
NAME@180..181
|
||||
IDENT@180..181 "a"
|
||||
WHITESPACE@181..182 " "
|
||||
EQ@182..183 "="
|
||||
WHITESPACE@183..184 " "
|
||||
LITERAL@184..185
|
||||
INT_NUMBER@184..185 "1"
|
||||
SEMICOLON@185..186 ";"
|
||||
WHITESPACE@186..191 "\n "
|
||||
ENUM@191..223
|
||||
ENUM_KW@191..195 "enum"
|
||||
WHITESPACE@195..196 " "
|
||||
NAME@196..201
|
||||
IDENT@196..201 "Test2"
|
||||
WHITESPACE@201..202 " "
|
||||
VARIANT_LIST@202..223
|
||||
L_CURLY@202..203 "{"
|
||||
WHITESPACE@203..212 "\n "
|
||||
VARIANT@212..216
|
||||
NAME@212..216
|
||||
IDENT@212..216 "Fine"
|
||||
COMMA@216..217 ","
|
||||
WHITESPACE@217..222 "\n "
|
||||
R_CURLY@222..223 "}"
|
||||
WHITESPACE@223..229 "\n\n "
|
||||
ENUM@229..300
|
||||
ENUM_KW@229..233 "enum"
|
||||
WHITESPACE@233..234 " "
|
||||
NAME@234..239
|
||||
IDENT@234..239 "Test3"
|
||||
WHITESPACE@239..240 " "
|
||||
VARIANT_LIST@240..300
|
||||
L_CURLY@240..241 "{"
|
||||
WHITESPACE@241..250 "\n "
|
||||
VARIANT@250..293
|
||||
NAME@250..259
|
||||
IDENT@250..259 "StillFine"
|
||||
WHITESPACE@259..260 " "
|
||||
RECORD_FIELD_LIST@260..293
|
||||
L_CURLY@260..261 "{"
|
||||
WHITESPACE@261..274 "\n "
|
||||
RECORD_FIELD@274..282
|
||||
NAME@274..277
|
||||
IDENT@274..277 "def"
|
||||
COLON@277..278 ":"
|
||||
WHITESPACE@278..279 " "
|
||||
PATH_TYPE@279..282
|
||||
PATH@279..282
|
||||
PATH_SEGMENT@279..282
|
||||
NAME_REF@279..282
|
||||
IDENT@279..282 "i32"
|
||||
COMMA@282..283 ","
|
||||
WHITESPACE@283..292 "\n "
|
||||
R_CURLY@292..293 "}"
|
||||
COMMA@293..294 ","
|
||||
WHITESPACE@294..299 "\n "
|
||||
R_CURLY@299..300 "}"
|
||||
WHITESPACE@300..306 "\n\n "
|
||||
EXPR_STMT@306..459
|
||||
BLOCK_EXPR@306..459
|
||||
L_CURLY@306..307 "{"
|
||||
WHITESPACE@307..316 "\n "
|
||||
ENUM@316..453
|
||||
COMMENT@316..329 "// fail again"
|
||||
WHITESPACE@329..338 "\n "
|
||||
ENUM_KW@338..342 "enum"
|
||||
WHITESPACE@342..343 " "
|
||||
NAME@343..348
|
||||
IDENT@343..348 "Test4"
|
||||
WHITESPACE@348..349 " "
|
||||
VARIANT_LIST@349..453
|
||||
L_CURLY@349..350 "{"
|
||||
WHITESPACE@350..363 "\n "
|
||||
VARIANT@363..372
|
||||
NAME@363..367
|
||||
IDENT@363..367 "Nope"
|
||||
TUPLE_FIELD_LIST@367..372
|
||||
L_PAREN@367..368 "("
|
||||
TUPLE_FIELD@368..371
|
||||
PATH_TYPE@368..371
|
||||
PATH@368..371
|
||||
PATH_SEGMENT@368..371
|
||||
NAME_REF@368..371
|
||||
IDENT@368..371 "i32"
|
||||
WHITESPACE@371..372 " "
|
||||
ERROR@372..372
|
||||
ERROR@372..374
|
||||
L_CURLY@372..373 "{"
|
||||
R_CURLY@373..374 "}"
|
||||
ERROR@374..375
|
||||
R_PAREN@374..375 ")"
|
||||
WHITESPACE@375..376 " "
|
||||
COMMENT@376..396 "//~ ERROR: found `{`"
|
||||
WHITESPACE@396..422 "\n ..."
|
||||
COMMENT@422..443 "//~^ ERROR: found `{`"
|
||||
WHITESPACE@443..452 "\n "
|
||||
R_CURLY@452..453 "}"
|
||||
WHITESPACE@453..458 "\n "
|
||||
R_CURLY@458..459 "}"
|
||||
WHITESPACE@459..464 "\n "
|
||||
COMMENT@464..486 "// still recover later"
|
||||
WHITESPACE@486..491 "\n "
|
||||
LET_STMT@491..510
|
||||
LET_KW@491..494 "let"
|
||||
WHITESPACE@494..495 " "
|
||||
IDENT_PAT@495..505
|
||||
NAME@495..505
|
||||
IDENT@495..505 "bad_syntax"
|
||||
WHITESPACE@505..506 " "
|
||||
EQ@506..507 "="
|
||||
WHITESPACE@507..508 " "
|
||||
ERROR@508..509
|
||||
UNDERSCORE@508..509 "_"
|
||||
SEMICOLON@509..510 ";"
|
||||
WHITESPACE@510..511 " "
|
||||
COMMENT@511..572 "//~ ERROR: expected e ..."
|
||||
WHITESPACE@572..573 "\n"
|
||||
R_CURLY@573..574 "}"
|
||||
STMT_LIST@10..574
|
||||
L_CURLY@10..11 "{"
|
||||
WHITESPACE@11..16 "\n "
|
||||
ENUM@16..152
|
||||
ENUM_KW@16..20 "enum"
|
||||
WHITESPACE@20..21 " "
|
||||
NAME@21..25
|
||||
IDENT@21..25 "Test"
|
||||
WHITESPACE@25..26 " "
|
||||
VARIANT_LIST@26..152
|
||||
L_CURLY@26..27 "{"
|
||||
WHITESPACE@27..36 "\n "
|
||||
VARIANT@36..40
|
||||
NAME@36..40
|
||||
IDENT@36..40 "Var1"
|
||||
COMMA@40..41 ","
|
||||
WHITESPACE@41..50 "\n "
|
||||
VARIANT@50..62
|
||||
NAME@50..54
|
||||
IDENT@50..54 "Var2"
|
||||
TUPLE_FIELD_LIST@54..62
|
||||
L_PAREN@54..55 "("
|
||||
TUPLE_FIELD@55..61
|
||||
PATH_TYPE@55..61
|
||||
PATH@55..61
|
||||
PATH_SEGMENT@55..61
|
||||
NAME_REF@55..61
|
||||
IDENT@55..61 "String"
|
||||
R_PAREN@61..62 ")"
|
||||
COMMA@62..63 ","
|
||||
WHITESPACE@63..72 "\n "
|
||||
VARIANT@72..145
|
||||
NAME@72..76
|
||||
IDENT@72..76 "Var3"
|
||||
WHITESPACE@76..77 " "
|
||||
RECORD_FIELD_LIST@77..145
|
||||
L_CURLY@77..78 "{"
|
||||
WHITESPACE@78..91 "\n "
|
||||
RECORD_FIELD@91..95
|
||||
NAME@91..94
|
||||
IDENT@91..94 "abc"
|
||||
COLON@94..95 ":"
|
||||
WHITESPACE@95..96 " "
|
||||
ERROR@96..98
|
||||
L_CURLY@96..97 "{"
|
||||
R_CURLY@97..98 "}"
|
||||
ERROR@98..99
|
||||
COMMA@98..99 ","
|
||||
WHITESPACE@99..100 " "
|
||||
COMMENT@100..135 "//~ ERROR: expected t ..."
|
||||
WHITESPACE@135..144 "\n "
|
||||
R_CURLY@144..145 "}"
|
||||
COMMA@145..146 ","
|
||||
WHITESPACE@146..151 "\n "
|
||||
R_CURLY@151..152 "}"
|
||||
WHITESPACE@152..158 "\n\n "
|
||||
COMMENT@158..171 "// recover..."
|
||||
WHITESPACE@171..176 "\n "
|
||||
LET_STMT@176..186
|
||||
LET_KW@176..179 "let"
|
||||
WHITESPACE@179..180 " "
|
||||
IDENT_PAT@180..181
|
||||
NAME@180..181
|
||||
IDENT@180..181 "a"
|
||||
WHITESPACE@181..182 " "
|
||||
EQ@182..183 "="
|
||||
WHITESPACE@183..184 " "
|
||||
LITERAL@184..185
|
||||
INT_NUMBER@184..185 "1"
|
||||
SEMICOLON@185..186 ";"
|
||||
WHITESPACE@186..191 "\n "
|
||||
ENUM@191..223
|
||||
ENUM_KW@191..195 "enum"
|
||||
WHITESPACE@195..196 " "
|
||||
NAME@196..201
|
||||
IDENT@196..201 "Test2"
|
||||
WHITESPACE@201..202 " "
|
||||
VARIANT_LIST@202..223
|
||||
L_CURLY@202..203 "{"
|
||||
WHITESPACE@203..212 "\n "
|
||||
VARIANT@212..216
|
||||
NAME@212..216
|
||||
IDENT@212..216 "Fine"
|
||||
COMMA@216..217 ","
|
||||
WHITESPACE@217..222 "\n "
|
||||
R_CURLY@222..223 "}"
|
||||
WHITESPACE@223..229 "\n\n "
|
||||
ENUM@229..300
|
||||
ENUM_KW@229..233 "enum"
|
||||
WHITESPACE@233..234 " "
|
||||
NAME@234..239
|
||||
IDENT@234..239 "Test3"
|
||||
WHITESPACE@239..240 " "
|
||||
VARIANT_LIST@240..300
|
||||
L_CURLY@240..241 "{"
|
||||
WHITESPACE@241..250 "\n "
|
||||
VARIANT@250..293
|
||||
NAME@250..259
|
||||
IDENT@250..259 "StillFine"
|
||||
WHITESPACE@259..260 " "
|
||||
RECORD_FIELD_LIST@260..293
|
||||
L_CURLY@260..261 "{"
|
||||
WHITESPACE@261..274 "\n "
|
||||
RECORD_FIELD@274..282
|
||||
NAME@274..277
|
||||
IDENT@274..277 "def"
|
||||
COLON@277..278 ":"
|
||||
WHITESPACE@278..279 " "
|
||||
PATH_TYPE@279..282
|
||||
PATH@279..282
|
||||
PATH_SEGMENT@279..282
|
||||
NAME_REF@279..282
|
||||
IDENT@279..282 "i32"
|
||||
COMMA@282..283 ","
|
||||
WHITESPACE@283..292 "\n "
|
||||
R_CURLY@292..293 "}"
|
||||
COMMA@293..294 ","
|
||||
WHITESPACE@294..299 "\n "
|
||||
R_CURLY@299..300 "}"
|
||||
WHITESPACE@300..306 "\n\n "
|
||||
EXPR_STMT@306..459
|
||||
BLOCK_EXPR@306..459
|
||||
STMT_LIST@306..459
|
||||
L_CURLY@306..307 "{"
|
||||
WHITESPACE@307..316 "\n "
|
||||
ENUM@316..453
|
||||
COMMENT@316..329 "// fail again"
|
||||
WHITESPACE@329..338 "\n "
|
||||
ENUM_KW@338..342 "enum"
|
||||
WHITESPACE@342..343 " "
|
||||
NAME@343..348
|
||||
IDENT@343..348 "Test4"
|
||||
WHITESPACE@348..349 " "
|
||||
VARIANT_LIST@349..453
|
||||
L_CURLY@349..350 "{"
|
||||
WHITESPACE@350..363 "\n "
|
||||
VARIANT@363..372
|
||||
NAME@363..367
|
||||
IDENT@363..367 "Nope"
|
||||
TUPLE_FIELD_LIST@367..372
|
||||
L_PAREN@367..368 "("
|
||||
TUPLE_FIELD@368..371
|
||||
PATH_TYPE@368..371
|
||||
PATH@368..371
|
||||
PATH_SEGMENT@368..371
|
||||
NAME_REF@368..371
|
||||
IDENT@368..371 "i32"
|
||||
WHITESPACE@371..372 " "
|
||||
ERROR@372..372
|
||||
ERROR@372..374
|
||||
L_CURLY@372..373 "{"
|
||||
R_CURLY@373..374 "}"
|
||||
ERROR@374..375
|
||||
R_PAREN@374..375 ")"
|
||||
WHITESPACE@375..376 " "
|
||||
COMMENT@376..396 "//~ ERROR: found `{`"
|
||||
WHITESPACE@396..422 "\n ..."
|
||||
COMMENT@422..443 "//~^ ERROR: found `{`"
|
||||
WHITESPACE@443..452 "\n "
|
||||
R_CURLY@452..453 "}"
|
||||
WHITESPACE@453..458 "\n "
|
||||
R_CURLY@458..459 "}"
|
||||
WHITESPACE@459..464 "\n "
|
||||
COMMENT@464..486 "// still recover later"
|
||||
WHITESPACE@486..491 "\n "
|
||||
LET_STMT@491..510
|
||||
LET_KW@491..494 "let"
|
||||
WHITESPACE@494..495 " "
|
||||
IDENT_PAT@495..505
|
||||
NAME@495..505
|
||||
IDENT@495..505 "bad_syntax"
|
||||
WHITESPACE@505..506 " "
|
||||
EQ@506..507 "="
|
||||
WHITESPACE@507..508 " "
|
||||
ERROR@508..509
|
||||
UNDERSCORE@508..509 "_"
|
||||
SEMICOLON@509..510 ";"
|
||||
WHITESPACE@510..511 " "
|
||||
COMMENT@511..572 "//~ ERROR: expected e ..."
|
||||
WHITESPACE@572..573 "\n"
|
||||
R_CURLY@573..574 "}"
|
||||
WHITESPACE@574..575 "\n"
|
||||
error 95..95: expected type
|
||||
error 95..95: expected COMMA
|
||||
|
@ -21,8 +21,9 @@ SOURCE_FILE@0..30
|
||||
R_ANGLE@25..26 ">"
|
||||
WHITESPACE@26..27 "\n"
|
||||
BLOCK_EXPR@27..29
|
||||
L_CURLY@27..28 "{"
|
||||
R_CURLY@28..29 "}"
|
||||
STMT_LIST@27..29
|
||||
L_CURLY@27..28 "{"
|
||||
R_CURLY@28..29 "}"
|
||||
WHITESPACE@29..30 "\n"
|
||||
error 26..26: expected type
|
||||
error 26..26: expected colon
|
||||
|
@ -20,16 +20,17 @@ SOURCE_FILE@0..24
|
||||
R_PAREN@11..12 ")"
|
||||
WHITESPACE@12..13 " "
|
||||
BLOCK_EXPR@13..23
|
||||
L_CURLY@13..14 "{"
|
||||
WHITESPACE@14..19 "\n "
|
||||
FIELD_EXPR@19..21
|
||||
PATH_EXPR@19..20
|
||||
PATH@19..20
|
||||
PATH_SEGMENT@19..20
|
||||
NAME_REF@19..20
|
||||
IDENT@19..20 "a"
|
||||
DOT@20..21 "."
|
||||
WHITESPACE@21..22 "\n"
|
||||
R_CURLY@22..23 "}"
|
||||
STMT_LIST@13..23
|
||||
L_CURLY@13..14 "{"
|
||||
WHITESPACE@14..19 "\n "
|
||||
FIELD_EXPR@19..21
|
||||
PATH_EXPR@19..20
|
||||
PATH@19..20
|
||||
PATH_SEGMENT@19..20
|
||||
NAME_REF@19..20
|
||||
IDENT@19..20 "a"
|
||||
DOT@20..21 "."
|
||||
WHITESPACE@21..22 "\n"
|
||||
R_CURLY@22..23 "}"
|
||||
WHITESPACE@23..24 "\n"
|
||||
error 21..21: expected field name or number
|
||||
|
@ -9,115 +9,119 @@ SOURCE_FILE@0..350
|
||||
R_PAREN@9..10 ")"
|
||||
WHITESPACE@10..11 " "
|
||||
BLOCK_EXPR@11..349
|
||||
L_CURLY@11..12 "{"
|
||||
WHITESPACE@12..17 "\n "
|
||||
LET_STMT@17..129
|
||||
LET_KW@17..20 "let"
|
||||
WHITESPACE@20..21 " "
|
||||
IDENT_PAT@21..26
|
||||
NAME@21..26
|
||||
IDENT@21..26 "inner"
|
||||
WHITESPACE@26..27 " "
|
||||
EQ@27..28 "="
|
||||
WHITESPACE@28..29 " "
|
||||
BLOCK_EXPR@29..128
|
||||
L_CURLY@29..30 "{"
|
||||
WHITESPACE@30..39 "\n "
|
||||
ATTR@39..83
|
||||
POUND@39..40 "#"
|
||||
BANG@40..41 "!"
|
||||
L_BRACK@41..42 "["
|
||||
META@42..82
|
||||
PATH@42..45
|
||||
PATH_SEGMENT@42..45
|
||||
NAME_REF@42..45
|
||||
IDENT@42..45 "doc"
|
||||
TOKEN_TREE@45..82
|
||||
L_PAREN@45..46 "("
|
||||
STRING@46..81 "\"Inner attributes not ..."
|
||||
R_PAREN@81..82 ")"
|
||||
R_BRACK@82..83 "]"
|
||||
WHITESPACE@83..92 "\n "
|
||||
COMMENT@92..122 "//! Nor are ModuleDoc ..."
|
||||
WHITESPACE@122..127 "\n "
|
||||
R_CURLY@127..128 "}"
|
||||
SEMICOLON@128..129 ";"
|
||||
WHITESPACE@129..134 "\n "
|
||||
EXPR_STMT@134..257
|
||||
IF_EXPR@134..257
|
||||
IF_KW@134..136 "if"
|
||||
WHITESPACE@136..137 " "
|
||||
CONDITION@137..141
|
||||
LITERAL@137..141
|
||||
TRUE_KW@137..141 "true"
|
||||
WHITESPACE@141..142 " "
|
||||
BLOCK_EXPR@142..257
|
||||
L_CURLY@142..143 "{"
|
||||
WHITESPACE@143..152 "\n "
|
||||
ATTR@152..171
|
||||
POUND@152..153 "#"
|
||||
BANG@153..154 "!"
|
||||
L_BRACK@154..155 "["
|
||||
META@155..170
|
||||
PATH@155..158
|
||||
PATH_SEGMENT@155..158
|
||||
NAME_REF@155..158
|
||||
IDENT@155..158 "doc"
|
||||
TOKEN_TREE@158..170
|
||||
L_PAREN@158..159 "("
|
||||
STRING@159..169 "\"Nor here\""
|
||||
R_PAREN@169..170 ")"
|
||||
R_BRACK@170..171 "]"
|
||||
WHITESPACE@171..180 "\n "
|
||||
ATTR@180..212
|
||||
POUND@180..181 "#"
|
||||
BANG@181..182 "!"
|
||||
L_BRACK@182..183 "["
|
||||
META@183..211
|
||||
PATH@183..186
|
||||
PATH_SEGMENT@183..186
|
||||
NAME_REF@183..186
|
||||
IDENT@183..186 "doc"
|
||||
TOKEN_TREE@186..211
|
||||
L_PAREN@186..187 "("
|
||||
STRING@187..210 "\"We error on each attr\""
|
||||
R_PAREN@210..211 ")"
|
||||
R_BRACK@211..212 "]"
|
||||
WHITESPACE@212..221 "\n "
|
||||
COMMENT@221..251 "//! Nor are ModuleDoc ..."
|
||||
WHITESPACE@251..256 "\n "
|
||||
R_CURLY@256..257 "}"
|
||||
WHITESPACE@257..262 "\n "
|
||||
WHILE_EXPR@262..347
|
||||
WHILE_KW@262..267 "while"
|
||||
WHITESPACE@267..268 " "
|
||||
CONDITION@268..272
|
||||
LITERAL@268..272
|
||||
TRUE_KW@268..272 "true"
|
||||
WHITESPACE@272..273 " "
|
||||
BLOCK_EXPR@273..347
|
||||
L_CURLY@273..274 "{"
|
||||
WHITESPACE@274..283 "\n "
|
||||
ATTR@283..302
|
||||
POUND@283..284 "#"
|
||||
BANG@284..285 "!"
|
||||
L_BRACK@285..286 "["
|
||||
META@286..301
|
||||
PATH@286..289
|
||||
PATH_SEGMENT@286..289
|
||||
NAME_REF@286..289
|
||||
IDENT@286..289 "doc"
|
||||
TOKEN_TREE@289..301
|
||||
L_PAREN@289..290 "("
|
||||
STRING@290..300 "\"Nor here\""
|
||||
R_PAREN@300..301 ")"
|
||||
R_BRACK@301..302 "]"
|
||||
WHITESPACE@302..311 "\n "
|
||||
COMMENT@311..341 "//! Nor are ModuleDoc ..."
|
||||
WHITESPACE@341..346 "\n "
|
||||
R_CURLY@346..347 "}"
|
||||
WHITESPACE@347..348 "\n"
|
||||
R_CURLY@348..349 "}"
|
||||
STMT_LIST@11..349
|
||||
L_CURLY@11..12 "{"
|
||||
WHITESPACE@12..17 "\n "
|
||||
LET_STMT@17..129
|
||||
LET_KW@17..20 "let"
|
||||
WHITESPACE@20..21 " "
|
||||
IDENT_PAT@21..26
|
||||
NAME@21..26
|
||||
IDENT@21..26 "inner"
|
||||
WHITESPACE@26..27 " "
|
||||
EQ@27..28 "="
|
||||
WHITESPACE@28..29 " "
|
||||
BLOCK_EXPR@29..128
|
||||
STMT_LIST@29..128
|
||||
L_CURLY@29..30 "{"
|
||||
WHITESPACE@30..39 "\n "
|
||||
ATTR@39..83
|
||||
POUND@39..40 "#"
|
||||
BANG@40..41 "!"
|
||||
L_BRACK@41..42 "["
|
||||
META@42..82
|
||||
PATH@42..45
|
||||
PATH_SEGMENT@42..45
|
||||
NAME_REF@42..45
|
||||
IDENT@42..45 "doc"
|
||||
TOKEN_TREE@45..82
|
||||
L_PAREN@45..46 "("
|
||||
STRING@46..81 "\"Inner attributes not ..."
|
||||
R_PAREN@81..82 ")"
|
||||
R_BRACK@82..83 "]"
|
||||
WHITESPACE@83..92 "\n "
|
||||
COMMENT@92..122 "//! Nor are ModuleDoc ..."
|
||||
WHITESPACE@122..127 "\n "
|
||||
R_CURLY@127..128 "}"
|
||||
SEMICOLON@128..129 ";"
|
||||
WHITESPACE@129..134 "\n "
|
||||
EXPR_STMT@134..257
|
||||
IF_EXPR@134..257
|
||||
IF_KW@134..136 "if"
|
||||
WHITESPACE@136..137 " "
|
||||
CONDITION@137..141
|
||||
LITERAL@137..141
|
||||
TRUE_KW@137..141 "true"
|
||||
WHITESPACE@141..142 " "
|
||||
BLOCK_EXPR@142..257
|
||||
STMT_LIST@142..257
|
||||
L_CURLY@142..143 "{"
|
||||
WHITESPACE@143..152 "\n "
|
||||
ATTR@152..171
|
||||
POUND@152..153 "#"
|
||||
BANG@153..154 "!"
|
||||
L_BRACK@154..155 "["
|
||||
META@155..170
|
||||
PATH@155..158
|
||||
PATH_SEGMENT@155..158
|
||||
NAME_REF@155..158
|
||||
IDENT@155..158 "doc"
|
||||
TOKEN_TREE@158..170
|
||||
L_PAREN@158..159 "("
|
||||
STRING@159..169 "\"Nor here\""
|
||||
R_PAREN@169..170 ")"
|
||||
R_BRACK@170..171 "]"
|
||||
WHITESPACE@171..180 "\n "
|
||||
ATTR@180..212
|
||||
POUND@180..181 "#"
|
||||
BANG@181..182 "!"
|
||||
L_BRACK@182..183 "["
|
||||
META@183..211
|
||||
PATH@183..186
|
||||
PATH_SEGMENT@183..186
|
||||
NAME_REF@183..186
|
||||
IDENT@183..186 "doc"
|
||||
TOKEN_TREE@186..211
|
||||
L_PAREN@186..187 "("
|
||||
STRING@187..210 "\"We error on each attr\""
|
||||
R_PAREN@210..211 ")"
|
||||
R_BRACK@211..212 "]"
|
||||
WHITESPACE@212..221 "\n "
|
||||
COMMENT@221..251 "//! Nor are ModuleDoc ..."
|
||||
WHITESPACE@251..256 "\n "
|
||||
R_CURLY@256..257 "}"
|
||||
WHITESPACE@257..262 "\n "
|
||||
WHILE_EXPR@262..347
|
||||
WHILE_KW@262..267 "while"
|
||||
WHITESPACE@267..268 " "
|
||||
CONDITION@268..272
|
||||
LITERAL@268..272
|
||||
TRUE_KW@268..272 "true"
|
||||
WHITESPACE@272..273 " "
|
||||
BLOCK_EXPR@273..347
|
||||
STMT_LIST@273..347
|
||||
L_CURLY@273..274 "{"
|
||||
WHITESPACE@274..283 "\n "
|
||||
ATTR@283..302
|
||||
POUND@283..284 "#"
|
||||
BANG@284..285 "!"
|
||||
L_BRACK@285..286 "["
|
||||
META@286..301
|
||||
PATH@286..289
|
||||
PATH_SEGMENT@286..289
|
||||
NAME_REF@286..289
|
||||
IDENT@286..289 "doc"
|
||||
TOKEN_TREE@289..301
|
||||
L_PAREN@289..290 "("
|
||||
STRING@290..300 "\"Nor here\""
|
||||
R_PAREN@300..301 ")"
|
||||
R_BRACK@301..302 "]"
|
||||
WHITESPACE@302..311 "\n "
|
||||
COMMENT@311..341 "//! Nor are ModuleDoc ..."
|
||||
WHITESPACE@341..346 "\n "
|
||||
R_CURLY@346..347 "}"
|
||||
WHITESPACE@347..348 "\n"
|
||||
R_CURLY@348..349 "}"
|
||||
WHITESPACE@349..350 "\n"
|
||||
error 39..83: A block in this position cannot accept inner attributes
|
||||
error 152..171: A block in this position cannot accept inner attributes
|
||||
|
@ -9,187 +9,188 @@ SOURCE_FILE@0..293
|
||||
R_PAREN@7..8 ")"
|
||||
WHITESPACE@8..9 " "
|
||||
BLOCK_EXPR@9..292
|
||||
L_CURLY@9..10 "{"
|
||||
WHITESPACE@10..15 "\n "
|
||||
EXPR_STMT@15..101
|
||||
MATCH_EXPR@15..101
|
||||
MATCH_KW@15..20 "match"
|
||||
WHITESPACE@20..21 " "
|
||||
TUPLE_EXPR@21..23
|
||||
L_PAREN@21..22 "("
|
||||
R_PAREN@22..23 ")"
|
||||
WHITESPACE@23..24 " "
|
||||
MATCH_ARM_LIST@24..101
|
||||
L_CURLY@24..25 "{"
|
||||
WHITESPACE@25..34 "\n "
|
||||
MATCH_ARM@34..42
|
||||
WILDCARD_PAT@34..35
|
||||
UNDERSCORE@34..35 "_"
|
||||
WHITESPACE@35..36 " "
|
||||
FAT_ARROW@36..38 "=>"
|
||||
WHITESPACE@38..39 " "
|
||||
TUPLE_EXPR@39..41
|
||||
L_PAREN@39..40 "("
|
||||
R_PAREN@40..41 ")"
|
||||
COMMA@41..42 ","
|
||||
WHITESPACE@42..51 "\n "
|
||||
MATCH_ARM@51..78
|
||||
ATTR@51..52
|
||||
POUND@51..52 "#"
|
||||
ERROR@52..53
|
||||
BANG@52..53 "!"
|
||||
ARRAY_EXPR@53..78
|
||||
L_BRACK@53..54 "["
|
||||
CALL_EXPR@54..77
|
||||
PATH_EXPR@54..57
|
||||
PATH@54..57
|
||||
PATH_SEGMENT@54..57
|
||||
NAME_REF@54..57
|
||||
IDENT@54..57 "doc"
|
||||
ARG_LIST@57..77
|
||||
L_PAREN@57..58 "("
|
||||
LITERAL@58..76
|
||||
STRING@58..76 "\"Not allowed here\""
|
||||
R_PAREN@76..77 ")"
|
||||
R_BRACK@77..78 "]"
|
||||
WHITESPACE@78..87 "\n "
|
||||
MATCH_ARM@87..95
|
||||
WILDCARD_PAT@87..88
|
||||
UNDERSCORE@87..88 "_"
|
||||
WHITESPACE@88..89 " "
|
||||
FAT_ARROW@89..91 "=>"
|
||||
WHITESPACE@91..92 " "
|
||||
TUPLE_EXPR@92..94
|
||||
L_PAREN@92..93 "("
|
||||
R_PAREN@93..94 ")"
|
||||
COMMA@94..95 ","
|
||||
WHITESPACE@95..100 "\n "
|
||||
R_CURLY@100..101 "}"
|
||||
WHITESPACE@101..107 "\n\n "
|
||||
EXPR_STMT@107..185
|
||||
MATCH_EXPR@107..185
|
||||
MATCH_KW@107..112 "match"
|
||||
WHITESPACE@112..113 " "
|
||||
TUPLE_EXPR@113..115
|
||||
L_PAREN@113..114 "("
|
||||
R_PAREN@114..115 ")"
|
||||
WHITESPACE@115..116 " "
|
||||
MATCH_ARM_LIST@116..185
|
||||
L_CURLY@116..117 "{"
|
||||
WHITESPACE@117..126 "\n "
|
||||
MATCH_ARM@126..134
|
||||
WILDCARD_PAT@126..127
|
||||
UNDERSCORE@126..127 "_"
|
||||
WHITESPACE@127..128 " "
|
||||
FAT_ARROW@128..130 "=>"
|
||||
WHITESPACE@130..131 " "
|
||||
TUPLE_EXPR@131..133
|
||||
L_PAREN@131..132 "("
|
||||
R_PAREN@132..133 ")"
|
||||
COMMA@133..134 ","
|
||||
WHITESPACE@134..143 "\n "
|
||||
MATCH_ARM@143..151
|
||||
WILDCARD_PAT@143..144
|
||||
UNDERSCORE@143..144 "_"
|
||||
WHITESPACE@144..145 " "
|
||||
FAT_ARROW@145..147 "=>"
|
||||
WHITESPACE@147..148 " "
|
||||
TUPLE_EXPR@148..150
|
||||
L_PAREN@148..149 "("
|
||||
R_PAREN@149..150 ")"
|
||||
COMMA@150..151 ","
|
||||
WHITESPACE@151..160 "\n "
|
||||
MATCH_ARM@160..179
|
||||
ATTR@160..161
|
||||
POUND@160..161 "#"
|
||||
ERROR@161..162
|
||||
BANG@161..162 "!"
|
||||
ARRAY_EXPR@162..179
|
||||
L_BRACK@162..163 "["
|
||||
CALL_EXPR@163..178
|
||||
PATH_EXPR@163..166
|
||||
PATH@163..166
|
||||
PATH_SEGMENT@163..166
|
||||
NAME_REF@163..166
|
||||
IDENT@163..166 "doc"
|
||||
ARG_LIST@166..178
|
||||
L_PAREN@166..167 "("
|
||||
LITERAL@167..177
|
||||
STRING@167..177 "\"Nor here\""
|
||||
R_PAREN@177..178 ")"
|
||||
R_BRACK@178..179 "]"
|
||||
WHITESPACE@179..184 "\n "
|
||||
R_CURLY@184..185 "}"
|
||||
WHITESPACE@185..191 "\n\n "
|
||||
MATCH_EXPR@191..290
|
||||
MATCH_KW@191..196 "match"
|
||||
WHITESPACE@196..197 " "
|
||||
TUPLE_EXPR@197..199
|
||||
L_PAREN@197..198 "("
|
||||
R_PAREN@198..199 ")"
|
||||
WHITESPACE@199..200 " "
|
||||
MATCH_ARM_LIST@200..290
|
||||
L_CURLY@200..201 "{"
|
||||
WHITESPACE@201..210 "\n "
|
||||
MATCH_ARM@210..250
|
||||
ATTR@210..222
|
||||
POUND@210..211 "#"
|
||||
L_BRACK@211..212 "["
|
||||
META@212..221
|
||||
PATH@212..215
|
||||
PATH_SEGMENT@212..215
|
||||
NAME_REF@212..215
|
||||
IDENT@212..215 "cfg"
|
||||
TOKEN_TREE@215..221
|
||||
L_PAREN@215..216 "("
|
||||
IDENT@216..220 "test"
|
||||
R_PAREN@220..221 ")"
|
||||
R_BRACK@221..222 "]"
|
||||
WHITESPACE@222..231 "\n "
|
||||
ATTR@231..232
|
||||
POUND@231..232 "#"
|
||||
ERROR@232..233
|
||||
BANG@232..233 "!"
|
||||
ARRAY_EXPR@233..250
|
||||
L_BRACK@233..234 "["
|
||||
CALL_EXPR@234..249
|
||||
PATH_EXPR@234..237
|
||||
PATH@234..237
|
||||
PATH_SEGMENT@234..237
|
||||
NAME_REF@234..237
|
||||
IDENT@234..237 "doc"
|
||||
ARG_LIST@237..249
|
||||
L_PAREN@237..238 "("
|
||||
LITERAL@238..248
|
||||
STRING@238..248 "\"Nor here\""
|
||||
R_PAREN@248..249 ")"
|
||||
R_BRACK@249..250 "]"
|
||||
WHITESPACE@250..259 "\n "
|
||||
MATCH_ARM@259..267
|
||||
WILDCARD_PAT@259..260
|
||||
UNDERSCORE@259..260 "_"
|
||||
WHITESPACE@260..261 " "
|
||||
FAT_ARROW@261..263 "=>"
|
||||
WHITESPACE@263..264 " "
|
||||
TUPLE_EXPR@264..266
|
||||
L_PAREN@264..265 "("
|
||||
R_PAREN@265..266 ")"
|
||||
COMMA@266..267 ","
|
||||
WHITESPACE@267..276 "\n "
|
||||
MATCH_ARM@276..284
|
||||
WILDCARD_PAT@276..277
|
||||
UNDERSCORE@276..277 "_"
|
||||
WHITESPACE@277..278 " "
|
||||
FAT_ARROW@278..280 "=>"
|
||||
WHITESPACE@280..281 " "
|
||||
TUPLE_EXPR@281..283
|
||||
L_PAREN@281..282 "("
|
||||
R_PAREN@282..283 ")"
|
||||
COMMA@283..284 ","
|
||||
WHITESPACE@284..289 "\n "
|
||||
R_CURLY@289..290 "}"
|
||||
WHITESPACE@290..291 "\n"
|
||||
R_CURLY@291..292 "}"
|
||||
STMT_LIST@9..292
|
||||
L_CURLY@9..10 "{"
|
||||
WHITESPACE@10..15 "\n "
|
||||
EXPR_STMT@15..101
|
||||
MATCH_EXPR@15..101
|
||||
MATCH_KW@15..20 "match"
|
||||
WHITESPACE@20..21 " "
|
||||
TUPLE_EXPR@21..23
|
||||
L_PAREN@21..22 "("
|
||||
R_PAREN@22..23 ")"
|
||||
WHITESPACE@23..24 " "
|
||||
MATCH_ARM_LIST@24..101
|
||||
L_CURLY@24..25 "{"
|
||||
WHITESPACE@25..34 "\n "
|
||||
MATCH_ARM@34..42
|
||||
WILDCARD_PAT@34..35
|
||||
UNDERSCORE@34..35 "_"
|
||||
WHITESPACE@35..36 " "
|
||||
FAT_ARROW@36..38 "=>"
|
||||
WHITESPACE@38..39 " "
|
||||
TUPLE_EXPR@39..41
|
||||
L_PAREN@39..40 "("
|
||||
R_PAREN@40..41 ")"
|
||||
COMMA@41..42 ","
|
||||
WHITESPACE@42..51 "\n "
|
||||
MATCH_ARM@51..78
|
||||
ATTR@51..52
|
||||
POUND@51..52 "#"
|
||||
ERROR@52..53
|
||||
BANG@52..53 "!"
|
||||
ARRAY_EXPR@53..78
|
||||
L_BRACK@53..54 "["
|
||||
CALL_EXPR@54..77
|
||||
PATH_EXPR@54..57
|
||||
PATH@54..57
|
||||
PATH_SEGMENT@54..57
|
||||
NAME_REF@54..57
|
||||
IDENT@54..57 "doc"
|
||||
ARG_LIST@57..77
|
||||
L_PAREN@57..58 "("
|
||||
LITERAL@58..76
|
||||
STRING@58..76 "\"Not allowed here\""
|
||||
R_PAREN@76..77 ")"
|
||||
R_BRACK@77..78 "]"
|
||||
WHITESPACE@78..87 "\n "
|
||||
MATCH_ARM@87..95
|
||||
WILDCARD_PAT@87..88
|
||||
UNDERSCORE@87..88 "_"
|
||||
WHITESPACE@88..89 " "
|
||||
FAT_ARROW@89..91 "=>"
|
||||
WHITESPACE@91..92 " "
|
||||
TUPLE_EXPR@92..94
|
||||
L_PAREN@92..93 "("
|
||||
R_PAREN@93..94 ")"
|
||||
COMMA@94..95 ","
|
||||
WHITESPACE@95..100 "\n "
|
||||
R_CURLY@100..101 "}"
|
||||
WHITESPACE@101..107 "\n\n "
|
||||
EXPR_STMT@107..185
|
||||
MATCH_EXPR@107..185
|
||||
MATCH_KW@107..112 "match"
|
||||
WHITESPACE@112..113 " "
|
||||
TUPLE_EXPR@113..115
|
||||
L_PAREN@113..114 "("
|
||||
R_PAREN@114..115 ")"
|
||||
WHITESPACE@115..116 " "
|
||||
MATCH_ARM_LIST@116..185
|
||||
L_CURLY@116..117 "{"
|
||||
WHITESPACE@117..126 "\n "
|
||||
MATCH_ARM@126..134
|
||||
WILDCARD_PAT@126..127
|
||||
UNDERSCORE@126..127 "_"
|
||||
WHITESPACE@127..128 " "
|
||||
FAT_ARROW@128..130 "=>"
|
||||
WHITESPACE@130..131 " "
|
||||
TUPLE_EXPR@131..133
|
||||
L_PAREN@131..132 "("
|
||||
R_PAREN@132..133 ")"
|
||||
COMMA@133..134 ","
|
||||
WHITESPACE@134..143 "\n "
|
||||
MATCH_ARM@143..151
|
||||
WILDCARD_PAT@143..144
|
||||
UNDERSCORE@143..144 "_"
|
||||
WHITESPACE@144..145 " "
|
||||
FAT_ARROW@145..147 "=>"
|
||||
WHITESPACE@147..148 " "
|
||||
TUPLE_EXPR@148..150
|
||||
L_PAREN@148..149 "("
|
||||
R_PAREN@149..150 ")"
|
||||
COMMA@150..151 ","
|
||||
WHITESPACE@151..160 "\n "
|
||||
MATCH_ARM@160..179
|
||||
ATTR@160..161
|
||||
POUND@160..161 "#"
|
||||
ERROR@161..162
|
||||
BANG@161..162 "!"
|
||||
ARRAY_EXPR@162..179
|
||||
L_BRACK@162..163 "["
|
||||
CALL_EXPR@163..178
|
||||
PATH_EXPR@163..166
|
||||
PATH@163..166
|
||||
PATH_SEGMENT@163..166
|
||||
NAME_REF@163..166
|
||||
IDENT@163..166 "doc"
|
||||
ARG_LIST@166..178
|
||||
L_PAREN@166..167 "("
|
||||
LITERAL@167..177
|
||||
STRING@167..177 "\"Nor here\""
|
||||
R_PAREN@177..178 ")"
|
||||
R_BRACK@178..179 "]"
|
||||
WHITESPACE@179..184 "\n "
|
||||
R_CURLY@184..185 "}"
|
||||
WHITESPACE@185..191 "\n\n "
|
||||
MATCH_EXPR@191..290
|
||||
MATCH_KW@191..196 "match"
|
||||
WHITESPACE@196..197 " "
|
||||
TUPLE_EXPR@197..199
|
||||
L_PAREN@197..198 "("
|
||||
R_PAREN@198..199 ")"
|
||||
WHITESPACE@199..200 " "
|
||||
MATCH_ARM_LIST@200..290
|
||||
L_CURLY@200..201 "{"
|
||||
WHITESPACE@201..210 "\n "
|
||||
MATCH_ARM@210..250
|
||||
ATTR@210..222
|
||||
POUND@210..211 "#"
|
||||
L_BRACK@211..212 "["
|
||||
META@212..221
|
||||
PATH@212..215
|
||||
PATH_SEGMENT@212..215
|
||||
NAME_REF@212..215
|
||||
IDENT@212..215 "cfg"
|
||||
TOKEN_TREE@215..221
|
||||
L_PAREN@215..216 "("
|
||||
IDENT@216..220 "test"
|
||||
R_PAREN@220..221 ")"
|
||||
R_BRACK@221..222 "]"
|
||||
WHITESPACE@222..231 "\n "
|
||||
ATTR@231..232
|
||||
POUND@231..232 "#"
|
||||
ERROR@232..233
|
||||
BANG@232..233 "!"
|
||||
ARRAY_EXPR@233..250
|
||||
L_BRACK@233..234 "["
|
||||
CALL_EXPR@234..249
|
||||
PATH_EXPR@234..237
|
||||
PATH@234..237
|
||||
PATH_SEGMENT@234..237
|
||||
NAME_REF@234..237
|
||||
IDENT@234..237 "doc"
|
||||
ARG_LIST@237..249
|
||||
L_PAREN@237..238 "("
|
||||
LITERAL@238..248
|
||||
STRING@238..248 "\"Nor here\""
|
||||
R_PAREN@248..249 ")"
|
||||
R_BRACK@249..250 "]"
|
||||
WHITESPACE@250..259 "\n "
|
||||
MATCH_ARM@259..267
|
||||
WILDCARD_PAT@259..260
|
||||
UNDERSCORE@259..260 "_"
|
||||
WHITESPACE@260..261 " "
|
||||
FAT_ARROW@261..263 "=>"
|
||||
WHITESPACE@263..264 " "
|
||||
TUPLE_EXPR@264..266
|
||||
L_PAREN@264..265 "("
|
||||
R_PAREN@265..266 ")"
|
||||
COMMA@266..267 ","
|
||||
WHITESPACE@267..276 "\n "
|
||||
MATCH_ARM@276..284
|
||||
WILDCARD_PAT@276..277
|
||||
UNDERSCORE@276..277 "_"
|
||||
WHITESPACE@277..278 " "
|
||||
FAT_ARROW@278..280 "=>"
|
||||
WHITESPACE@280..281 " "
|
||||
TUPLE_EXPR@281..283
|
||||
L_PAREN@281..282 "("
|
||||
R_PAREN@282..283 ")"
|
||||
COMMA@283..284 ","
|
||||
WHITESPACE@284..289 "\n "
|
||||
R_CURLY@289..290 "}"
|
||||
WHITESPACE@290..291 "\n"
|
||||
R_CURLY@291..292 "}"
|
||||
WHITESPACE@292..293 "\n"
|
||||
error 52..52: expected `[`
|
||||
error 52..52: expected pattern
|
||||
|
@ -9,58 +9,59 @@ SOURCE_FILE@0..89
|
||||
R_PAREN@7..8 ")"
|
||||
WHITESPACE@8..9 " "
|
||||
BLOCK_EXPR@9..88
|
||||
L_CURLY@9..10 "{"
|
||||
WHITESPACE@10..15 "\n "
|
||||
MATCH_EXPR@15..86
|
||||
MATCH_KW@15..20 "match"
|
||||
WHITESPACE@20..21 " "
|
||||
TUPLE_EXPR@21..23
|
||||
L_PAREN@21..22 "("
|
||||
R_PAREN@22..23 ")"
|
||||
WHITESPACE@23..24 " "
|
||||
MATCH_ARM_LIST@24..86
|
||||
L_CURLY@24..25 "{"
|
||||
WHITESPACE@25..34 "\n "
|
||||
MATCH_ARM@34..42
|
||||
WILDCARD_PAT@34..35
|
||||
UNDERSCORE@34..35 "_"
|
||||
WHITESPACE@35..36 " "
|
||||
FAT_ARROW@36..38 "=>"
|
||||
WHITESPACE@38..39 " "
|
||||
TUPLE_EXPR@39..41
|
||||
L_PAREN@39..40 "("
|
||||
R_PAREN@40..41 ")"
|
||||
COMMA@41..42 ","
|
||||
WHITESPACE@42..51 "\n "
|
||||
MATCH_ARM@51..59
|
||||
WILDCARD_PAT@51..52
|
||||
UNDERSCORE@51..52 "_"
|
||||
WHITESPACE@52..53 " "
|
||||
FAT_ARROW@53..55 "=>"
|
||||
WHITESPACE@55..56 " "
|
||||
TUPLE_EXPR@56..58
|
||||
L_PAREN@56..57 "("
|
||||
R_PAREN@57..58 ")"
|
||||
COMMA@58..59 ","
|
||||
WHITESPACE@59..68 "\n "
|
||||
MATCH_ARM@68..80
|
||||
ATTR@68..80
|
||||
POUND@68..69 "#"
|
||||
L_BRACK@69..70 "["
|
||||
META@70..79
|
||||
PATH@70..73
|
||||
PATH_SEGMENT@70..73
|
||||
NAME_REF@70..73
|
||||
IDENT@70..73 "cfg"
|
||||
TOKEN_TREE@73..79
|
||||
L_PAREN@73..74 "("
|
||||
IDENT@74..78 "test"
|
||||
R_PAREN@78..79 ")"
|
||||
R_BRACK@79..80 "]"
|
||||
WHITESPACE@80..85 "\n "
|
||||
R_CURLY@85..86 "}"
|
||||
WHITESPACE@86..87 "\n"
|
||||
R_CURLY@87..88 "}"
|
||||
STMT_LIST@9..88
|
||||
L_CURLY@9..10 "{"
|
||||
WHITESPACE@10..15 "\n "
|
||||
MATCH_EXPR@15..86
|
||||
MATCH_KW@15..20 "match"
|
||||
WHITESPACE@20..21 " "
|
||||
TUPLE_EXPR@21..23
|
||||
L_PAREN@21..22 "("
|
||||
R_PAREN@22..23 ")"
|
||||
WHITESPACE@23..24 " "
|
||||
MATCH_ARM_LIST@24..86
|
||||
L_CURLY@24..25 "{"
|
||||
WHITESPACE@25..34 "\n "
|
||||
MATCH_ARM@34..42
|
||||
WILDCARD_PAT@34..35
|
||||
UNDERSCORE@34..35 "_"
|
||||
WHITESPACE@35..36 " "
|
||||
FAT_ARROW@36..38 "=>"
|
||||
WHITESPACE@38..39 " "
|
||||
TUPLE_EXPR@39..41
|
||||
L_PAREN@39..40 "("
|
||||
R_PAREN@40..41 ")"
|
||||
COMMA@41..42 ","
|
||||
WHITESPACE@42..51 "\n "
|
||||
MATCH_ARM@51..59
|
||||
WILDCARD_PAT@51..52
|
||||
UNDERSCORE@51..52 "_"
|
||||
WHITESPACE@52..53 " "
|
||||
FAT_ARROW@53..55 "=>"
|
||||
WHITESPACE@55..56 " "
|
||||
TUPLE_EXPR@56..58
|
||||
L_PAREN@56..57 "("
|
||||
R_PAREN@57..58 ")"
|
||||
COMMA@58..59 ","
|
||||
WHITESPACE@59..68 "\n "
|
||||
MATCH_ARM@68..80
|
||||
ATTR@68..80
|
||||
POUND@68..69 "#"
|
||||
L_BRACK@69..70 "["
|
||||
META@70..79
|
||||
PATH@70..73
|
||||
PATH_SEGMENT@70..73
|
||||
NAME_REF@70..73
|
||||
IDENT@70..73 "cfg"
|
||||
TOKEN_TREE@73..79
|
||||
L_PAREN@73..74 "("
|
||||
IDENT@74..78 "test"
|
||||
R_PAREN@78..79 ")"
|
||||
R_BRACK@79..80 "]"
|
||||
WHITESPACE@80..85 "\n "
|
||||
R_CURLY@85..86 "}"
|
||||
WHITESPACE@86..87 "\n"
|
||||
R_CURLY@87..88 "}"
|
||||
WHITESPACE@88..89 "\n"
|
||||
error 80..80: expected pattern
|
||||
error 80..80: expected FAT_ARROW
|
||||
|
@ -9,83 +9,84 @@ SOURCE_FILE@0..91
|
||||
R_PAREN@8..9 ")"
|
||||
WHITESPACE@9..10 " "
|
||||
BLOCK_EXPR@10..89
|
||||
L_CURLY@10..11 "{"
|
||||
WHITESPACE@11..16 "\n "
|
||||
LET_STMT@16..27
|
||||
LET_KW@16..19 "let"
|
||||
WHITESPACE@19..20 " "
|
||||
IDENT_PAT@20..27
|
||||
REF_KW@20..23 "ref"
|
||||
WHITESPACE@23..24 " "
|
||||
ERROR@24..27
|
||||
BOX_KW@24..27 "box"
|
||||
WHITESPACE@27..28 " "
|
||||
EXPR_STMT@28..35
|
||||
BIN_EXPR@28..34
|
||||
PATH_EXPR@28..29
|
||||
PATH@28..29
|
||||
PATH_SEGMENT@28..29
|
||||
NAME_REF@28..29
|
||||
IDENT@28..29 "i"
|
||||
WHITESPACE@29..30 " "
|
||||
EQ@30..31 "="
|
||||
WHITESPACE@31..32 " "
|
||||
TUPLE_EXPR@32..34
|
||||
L_PAREN@32..33 "("
|
||||
R_PAREN@33..34 ")"
|
||||
SEMICOLON@34..35 ";"
|
||||
WHITESPACE@35..40 "\n "
|
||||
LET_STMT@40..51
|
||||
LET_KW@40..43 "let"
|
||||
WHITESPACE@43..44 " "
|
||||
IDENT_PAT@44..51
|
||||
MUT_KW@44..47 "mut"
|
||||
WHITESPACE@47..48 " "
|
||||
ERROR@48..51
|
||||
BOX_KW@48..51 "box"
|
||||
WHITESPACE@51..52 " "
|
||||
EXPR_STMT@52..59
|
||||
BIN_EXPR@52..58
|
||||
PATH_EXPR@52..53
|
||||
PATH@52..53
|
||||
PATH_SEGMENT@52..53
|
||||
NAME_REF@52..53
|
||||
IDENT@52..53 "i"
|
||||
WHITESPACE@53..54 " "
|
||||
EQ@54..55 "="
|
||||
WHITESPACE@55..56 " "
|
||||
TUPLE_EXPR@56..58
|
||||
L_PAREN@56..57 "("
|
||||
R_PAREN@57..58 ")"
|
||||
SEMICOLON@58..59 ";"
|
||||
WHITESPACE@59..64 "\n "
|
||||
LET_STMT@64..79
|
||||
LET_KW@64..67 "let"
|
||||
WHITESPACE@67..68 " "
|
||||
IDENT_PAT@68..79
|
||||
REF_KW@68..71 "ref"
|
||||
WHITESPACE@71..72 " "
|
||||
MUT_KW@72..75 "mut"
|
||||
WHITESPACE@75..76 " "
|
||||
ERROR@76..79
|
||||
BOX_KW@76..79 "box"
|
||||
WHITESPACE@79..80 " "
|
||||
EXPR_STMT@80..87
|
||||
BIN_EXPR@80..86
|
||||
PATH_EXPR@80..81
|
||||
PATH@80..81
|
||||
PATH_SEGMENT@80..81
|
||||
NAME_REF@80..81
|
||||
IDENT@80..81 "i"
|
||||
WHITESPACE@81..82 " "
|
||||
EQ@82..83 "="
|
||||
WHITESPACE@83..84 " "
|
||||
TUPLE_EXPR@84..86
|
||||
L_PAREN@84..85 "("
|
||||
R_PAREN@85..86 ")"
|
||||
SEMICOLON@86..87 ";"
|
||||
WHITESPACE@87..88 "\n"
|
||||
R_CURLY@88..89 "}"
|
||||
STMT_LIST@10..89
|
||||
L_CURLY@10..11 "{"
|
||||
WHITESPACE@11..16 "\n "
|
||||
LET_STMT@16..27
|
||||
LET_KW@16..19 "let"
|
||||
WHITESPACE@19..20 " "
|
||||
IDENT_PAT@20..27
|
||||
REF_KW@20..23 "ref"
|
||||
WHITESPACE@23..24 " "
|
||||
ERROR@24..27
|
||||
BOX_KW@24..27 "box"
|
||||
WHITESPACE@27..28 " "
|
||||
EXPR_STMT@28..35
|
||||
BIN_EXPR@28..34
|
||||
PATH_EXPR@28..29
|
||||
PATH@28..29
|
||||
PATH_SEGMENT@28..29
|
||||
NAME_REF@28..29
|
||||
IDENT@28..29 "i"
|
||||
WHITESPACE@29..30 " "
|
||||
EQ@30..31 "="
|
||||
WHITESPACE@31..32 " "
|
||||
TUPLE_EXPR@32..34
|
||||
L_PAREN@32..33 "("
|
||||
R_PAREN@33..34 ")"
|
||||
SEMICOLON@34..35 ";"
|
||||
WHITESPACE@35..40 "\n "
|
||||
LET_STMT@40..51
|
||||
LET_KW@40..43 "let"
|
||||
WHITESPACE@43..44 " "
|
||||
IDENT_PAT@44..51
|
||||
MUT_KW@44..47 "mut"
|
||||
WHITESPACE@47..48 " "
|
||||
ERROR@48..51
|
||||
BOX_KW@48..51 "box"
|
||||
WHITESPACE@51..52 " "
|
||||
EXPR_STMT@52..59
|
||||
BIN_EXPR@52..58
|
||||
PATH_EXPR@52..53
|
||||
PATH@52..53
|
||||
PATH_SEGMENT@52..53
|
||||
NAME_REF@52..53
|
||||
IDENT@52..53 "i"
|
||||
WHITESPACE@53..54 " "
|
||||
EQ@54..55 "="
|
||||
WHITESPACE@55..56 " "
|
||||
TUPLE_EXPR@56..58
|
||||
L_PAREN@56..57 "("
|
||||
R_PAREN@57..58 ")"
|
||||
SEMICOLON@58..59 ";"
|
||||
WHITESPACE@59..64 "\n "
|
||||
LET_STMT@64..79
|
||||
LET_KW@64..67 "let"
|
||||
WHITESPACE@67..68 " "
|
||||
IDENT_PAT@68..79
|
||||
REF_KW@68..71 "ref"
|
||||
WHITESPACE@71..72 " "
|
||||
MUT_KW@72..75 "mut"
|
||||
WHITESPACE@75..76 " "
|
||||
ERROR@76..79
|
||||
BOX_KW@76..79 "box"
|
||||
WHITESPACE@79..80 " "
|
||||
EXPR_STMT@80..87
|
||||
BIN_EXPR@80..86
|
||||
PATH_EXPR@80..81
|
||||
PATH@80..81
|
||||
PATH_SEGMENT@80..81
|
||||
NAME_REF@80..81
|
||||
IDENT@80..81 "i"
|
||||
WHITESPACE@81..82 " "
|
||||
EQ@82..83 "="
|
||||
WHITESPACE@83..84 " "
|
||||
TUPLE_EXPR@84..86
|
||||
L_PAREN@84..85 "("
|
||||
R_PAREN@85..86 ")"
|
||||
SEMICOLON@86..87 ";"
|
||||
WHITESPACE@87..88 "\n"
|
||||
R_CURLY@88..89 "}"
|
||||
WHITESPACE@89..91 "\n\n"
|
||||
error 24..24: expected a name
|
||||
error 27..27: expected SEMICOLON
|
||||
|
@ -45,8 +45,9 @@ SOURCE_FILE@0..48
|
||||
R_PAREN@43..44 ")"
|
||||
WHITESPACE@44..45 " "
|
||||
BLOCK_EXPR@45..47
|
||||
L_CURLY@45..46 "{"
|
||||
R_CURLY@46..47 "}"
|
||||
STMT_LIST@45..47
|
||||
L_CURLY@45..46 "{"
|
||||
R_CURLY@46..47 "}"
|
||||
WHITESPACE@47..48 "\n"
|
||||
error 17..17: expected one of `*`, `::`, `{`, `self`, `super` or an identifier
|
||||
error 17..17: expected SEMICOLON
|
||||
|
@ -27,8 +27,9 @@ SOURCE_FILE@0..118
|
||||
R_PAREN@27..28 ")"
|
||||
WHITESPACE@28..29 " "
|
||||
BLOCK_EXPR@29..31
|
||||
L_CURLY@29..30 "{"
|
||||
R_CURLY@30..31 "}"
|
||||
STMT_LIST@29..31
|
||||
L_CURLY@29..30 "{"
|
||||
R_CURLY@30..31 "}"
|
||||
WHITESPACE@31..36 "\n "
|
||||
FN@36..51
|
||||
VISIBILITY@36..39
|
||||
@ -43,8 +44,9 @@ SOURCE_FILE@0..118
|
||||
R_PAREN@47..48 ")"
|
||||
WHITESPACE@48..49 " "
|
||||
BLOCK_EXPR@49..51
|
||||
L_CURLY@49..50 "{"
|
||||
R_CURLY@50..51 "}"
|
||||
STMT_LIST@49..51
|
||||
L_CURLY@49..50 "{"
|
||||
R_CURLY@50..51 "}"
|
||||
WHITESPACE@51..56 "\n "
|
||||
TYPE_ALIAS@56..81
|
||||
VISIBILITY@56..66
|
||||
|
@ -9,21 +9,22 @@ SOURCE_FILE@0..33
|
||||
R_PAREN@8..9 ")"
|
||||
WHITESPACE@9..10 " "
|
||||
BLOCK_EXPR@10..32
|
||||
L_CURLY@10..11 "{"
|
||||
WHITESPACE@11..16 "\n "
|
||||
EXPR_STMT@16..21
|
||||
RANGE_EXPR@16..20
|
||||
LITERAL@16..17
|
||||
INT_NUMBER@16..17 "0"
|
||||
DOT2EQ@17..20 "..="
|
||||
SEMICOLON@20..21 ";"
|
||||
WHITESPACE@21..26 "\n "
|
||||
EXPR_STMT@26..30
|
||||
RANGE_EXPR@26..29
|
||||
DOT2EQ@26..29 "..="
|
||||
SEMICOLON@29..30 ";"
|
||||
WHITESPACE@30..31 "\n"
|
||||
R_CURLY@31..32 "}"
|
||||
STMT_LIST@10..32
|
||||
L_CURLY@10..11 "{"
|
||||
WHITESPACE@11..16 "\n "
|
||||
EXPR_STMT@16..21
|
||||
RANGE_EXPR@16..20
|
||||
LITERAL@16..17
|
||||
INT_NUMBER@16..17 "0"
|
||||
DOT2EQ@17..20 "..="
|
||||
SEMICOLON@20..21 ";"
|
||||
WHITESPACE@21..26 "\n "
|
||||
EXPR_STMT@26..30
|
||||
RANGE_EXPR@26..29
|
||||
DOT2EQ@26..29 "..="
|
||||
SEMICOLON@29..30 ";"
|
||||
WHITESPACE@30..31 "\n"
|
||||
R_CURLY@31..32 "}"
|
||||
WHITESPACE@32..33 "\n"
|
||||
error 16..20: An inclusive range must have an end expression
|
||||
error 26..29: An inclusive range must have an end expression
|
||||
|
@ -18,65 +18,66 @@ SOURCE_FILE@0..83
|
||||
IDENT@12..15 "i32"
|
||||
WHITESPACE@15..16 " "
|
||||
BLOCK_EXPR@16..82
|
||||
L_CURLY@16..17 "{"
|
||||
WHITESPACE@17..22 "\n "
|
||||
EXPR_STMT@22..80
|
||||
METHOD_CALL_EXPR@22..79
|
||||
METHOD_CALL_EXPR@22..57
|
||||
METHOD_CALL_EXPR@22..38
|
||||
ARRAY_EXPR@22..31
|
||||
L_BRACK@22..23 "["
|
||||
LITERAL@23..24
|
||||
INT_NUMBER@23..24 "1"
|
||||
COMMA@24..25 ","
|
||||
WHITESPACE@25..26 " "
|
||||
LITERAL@26..27
|
||||
INT_NUMBER@26..27 "2"
|
||||
COMMA@27..28 ","
|
||||
WHITESPACE@28..29 " "
|
||||
LITERAL@29..30
|
||||
INT_NUMBER@29..30 "3"
|
||||
R_BRACK@30..31 "]"
|
||||
DOT@31..32 "."
|
||||
NAME_REF@32..36
|
||||
IDENT@32..36 "iter"
|
||||
ARG_LIST@36..38
|
||||
L_PAREN@36..37 "("
|
||||
R_PAREN@37..38 ")"
|
||||
WHITESPACE@38..47 "\n "
|
||||
DOT@47..48 "."
|
||||
NAME_REF@48..51
|
||||
IDENT@48..51 "map"
|
||||
ARG_LIST@51..57
|
||||
L_PAREN@51..52 "("
|
||||
CLOSURE_EXPR@52..56
|
||||
PARAM_LIST@52..56
|
||||
PIPE@52..53 "|"
|
||||
PARAM@53..55
|
||||
IDENT_PAT@53..55
|
||||
NAME@53..55
|
||||
IDENT@53..55 "it"
|
||||
PIPE@55..56 "|"
|
||||
R_PAREN@56..57 ")"
|
||||
WHITESPACE@57..66 "\n "
|
||||
DOT@66..67 "."
|
||||
NAME_REF@67..70
|
||||
IDENT@67..70 "max"
|
||||
GENERIC_ARG_LIST@70..77
|
||||
COLON2@70..72 "::"
|
||||
L_ANGLE@72..73 "<"
|
||||
TYPE_ARG@73..76
|
||||
PATH_TYPE@73..76
|
||||
PATH@73..76
|
||||
PATH_SEGMENT@73..76
|
||||
NAME_REF@73..76
|
||||
IDENT@73..76 "i32"
|
||||
R_ANGLE@76..77 ">"
|
||||
ARG_LIST@77..79
|
||||
L_PAREN@77..78 "("
|
||||
R_PAREN@78..79 ")"
|
||||
SEMICOLON@79..80 ";"
|
||||
WHITESPACE@80..81 "\n"
|
||||
R_CURLY@81..82 "}"
|
||||
STMT_LIST@16..82
|
||||
L_CURLY@16..17 "{"
|
||||
WHITESPACE@17..22 "\n "
|
||||
EXPR_STMT@22..80
|
||||
METHOD_CALL_EXPR@22..79
|
||||
METHOD_CALL_EXPR@22..57
|
||||
METHOD_CALL_EXPR@22..38
|
||||
ARRAY_EXPR@22..31
|
||||
L_BRACK@22..23 "["
|
||||
LITERAL@23..24
|
||||
INT_NUMBER@23..24 "1"
|
||||
COMMA@24..25 ","
|
||||
WHITESPACE@25..26 " "
|
||||
LITERAL@26..27
|
||||
INT_NUMBER@26..27 "2"
|
||||
COMMA@27..28 ","
|
||||
WHITESPACE@28..29 " "
|
||||
LITERAL@29..30
|
||||
INT_NUMBER@29..30 "3"
|
||||
R_BRACK@30..31 "]"
|
||||
DOT@31..32 "."
|
||||
NAME_REF@32..36
|
||||
IDENT@32..36 "iter"
|
||||
ARG_LIST@36..38
|
||||
L_PAREN@36..37 "("
|
||||
R_PAREN@37..38 ")"
|
||||
WHITESPACE@38..47 "\n "
|
||||
DOT@47..48 "."
|
||||
NAME_REF@48..51
|
||||
IDENT@48..51 "map"
|
||||
ARG_LIST@51..57
|
||||
L_PAREN@51..52 "("
|
||||
CLOSURE_EXPR@52..56
|
||||
PARAM_LIST@52..56
|
||||
PIPE@52..53 "|"
|
||||
PARAM@53..55
|
||||
IDENT_PAT@53..55
|
||||
NAME@53..55
|
||||
IDENT@53..55 "it"
|
||||
PIPE@55..56 "|"
|
||||
R_PAREN@56..57 ")"
|
||||
WHITESPACE@57..66 "\n "
|
||||
DOT@66..67 "."
|
||||
NAME_REF@67..70
|
||||
IDENT@67..70 "max"
|
||||
GENERIC_ARG_LIST@70..77
|
||||
COLON2@70..72 "::"
|
||||
L_ANGLE@72..73 "<"
|
||||
TYPE_ARG@73..76
|
||||
PATH_TYPE@73..76
|
||||
PATH@73..76
|
||||
PATH_SEGMENT@73..76
|
||||
NAME_REF@73..76
|
||||
IDENT@73..76 "i32"
|
||||
R_ANGLE@76..77 ">"
|
||||
ARG_LIST@77..79
|
||||
L_PAREN@77..78 "("
|
||||
R_PAREN@78..79 ")"
|
||||
SEMICOLON@79..80 ";"
|
||||
WHITESPACE@80..81 "\n"
|
||||
R_CURLY@81..82 "}"
|
||||
WHITESPACE@82..83 "\n"
|
||||
error 56..56: expected expression
|
||||
|
@ -9,60 +9,65 @@ SOURCE_FILE@0..83
|
||||
R_PAREN@8..9 ")"
|
||||
WHITESPACE@9..10 " "
|
||||
BLOCK_EXPR@10..82
|
||||
L_CURLY@10..11 "{"
|
||||
WHITESPACE@11..16 "\n "
|
||||
EXPR_STMT@16..29
|
||||
BLOCK_EXPR@16..29
|
||||
L_CURLY@16..17 "{"
|
||||
WHITESPACE@17..18 " "
|
||||
ERROR@18..24
|
||||
UNSAFE_KW@18..24 "unsafe"
|
||||
WHITESPACE@24..25 " "
|
||||
LITERAL@25..27
|
||||
INT_NUMBER@25..27 "92"
|
||||
WHITESPACE@27..28 " "
|
||||
R_CURLY@28..29 "}"
|
||||
WHITESPACE@29..34 "\n "
|
||||
EXPR_STMT@34..46
|
||||
BLOCK_EXPR@34..46
|
||||
L_CURLY@34..35 "{"
|
||||
WHITESPACE@35..36 " "
|
||||
ERROR@36..41
|
||||
ASYNC_KW@36..41 "async"
|
||||
WHITESPACE@41..42 " "
|
||||
LITERAL@42..44
|
||||
INT_NUMBER@42..44 "92"
|
||||
WHITESPACE@44..45 " "
|
||||
R_CURLY@45..46 "}"
|
||||
WHITESPACE@46..51 "\n "
|
||||
EXPR_STMT@51..61
|
||||
BLOCK_EXPR@51..61
|
||||
L_CURLY@51..52 "{"
|
||||
WHITESPACE@52..53 " "
|
||||
EXPR_STMT@53..56
|
||||
EFFECT_EXPR@53..56
|
||||
TRY_KW@53..56 "try"
|
||||
WHITESPACE@56..57 " "
|
||||
LITERAL@57..59
|
||||
INT_NUMBER@57..59 "92"
|
||||
WHITESPACE@59..60 " "
|
||||
R_CURLY@60..61 "}"
|
||||
WHITESPACE@61..66 "\n "
|
||||
BLOCK_EXPR@66..80
|
||||
L_CURLY@66..67 "{"
|
||||
WHITESPACE@67..68 " "
|
||||
ERROR@68..75
|
||||
LABEL@68..75
|
||||
LIFETIME@68..74
|
||||
LIFETIME_IDENT@68..74 "'label"
|
||||
COLON@74..75 ":"
|
||||
WHITESPACE@75..76 " "
|
||||
LITERAL@76..78
|
||||
INT_NUMBER@76..78 "92"
|
||||
WHITESPACE@78..79 " "
|
||||
R_CURLY@79..80 "}"
|
||||
WHITESPACE@80..81 "\n"
|
||||
R_CURLY@81..82 "}"
|
||||
STMT_LIST@10..82
|
||||
L_CURLY@10..11 "{"
|
||||
WHITESPACE@11..16 "\n "
|
||||
EXPR_STMT@16..29
|
||||
BLOCK_EXPR@16..29
|
||||
STMT_LIST@16..29
|
||||
L_CURLY@16..17 "{"
|
||||
WHITESPACE@17..18 " "
|
||||
ERROR@18..24
|
||||
UNSAFE_KW@18..24 "unsafe"
|
||||
WHITESPACE@24..25 " "
|
||||
LITERAL@25..27
|
||||
INT_NUMBER@25..27 "92"
|
||||
WHITESPACE@27..28 " "
|
||||
R_CURLY@28..29 "}"
|
||||
WHITESPACE@29..34 "\n "
|
||||
EXPR_STMT@34..46
|
||||
BLOCK_EXPR@34..46
|
||||
STMT_LIST@34..46
|
||||
L_CURLY@34..35 "{"
|
||||
WHITESPACE@35..36 " "
|
||||
ERROR@36..41
|
||||
ASYNC_KW@36..41 "async"
|
||||
WHITESPACE@41..42 " "
|
||||
LITERAL@42..44
|
||||
INT_NUMBER@42..44 "92"
|
||||
WHITESPACE@44..45 " "
|
||||
R_CURLY@45..46 "}"
|
||||
WHITESPACE@46..51 "\n "
|
||||
EXPR_STMT@51..61
|
||||
BLOCK_EXPR@51..61
|
||||
STMT_LIST@51..61
|
||||
L_CURLY@51..52 "{"
|
||||
WHITESPACE@52..53 " "
|
||||
EXPR_STMT@53..56
|
||||
BLOCK_EXPR@53..56
|
||||
TRY_KW@53..56 "try"
|
||||
WHITESPACE@56..57 " "
|
||||
LITERAL@57..59
|
||||
INT_NUMBER@57..59 "92"
|
||||
WHITESPACE@59..60 " "
|
||||
R_CURLY@60..61 "}"
|
||||
WHITESPACE@61..66 "\n "
|
||||
BLOCK_EXPR@66..80
|
||||
STMT_LIST@66..80
|
||||
L_CURLY@66..67 "{"
|
||||
WHITESPACE@67..68 " "
|
||||
ERROR@68..75
|
||||
LABEL@68..75
|
||||
LIFETIME@68..74
|
||||
LIFETIME_IDENT@68..74 "'label"
|
||||
COLON@74..75 ":"
|
||||
WHITESPACE@75..76 " "
|
||||
LITERAL@76..78
|
||||
INT_NUMBER@76..78 "92"
|
||||
WHITESPACE@78..79 " "
|
||||
R_CURLY@79..80 "}"
|
||||
WHITESPACE@80..81 "\n"
|
||||
R_CURLY@81..82 "}"
|
||||
WHITESPACE@82..83 "\n"
|
||||
error 24..24: expected existential, fn, trait or impl
|
||||
error 41..41: expected existential, fn, trait or impl
|
||||
|
@ -244,9 +244,10 @@ SOURCE_FILE@0..239
|
||||
COMMA@233..234 ","
|
||||
WHITESPACE@234..235 "\n"
|
||||
BLOCK_EXPR@235..238
|
||||
L_CURLY@235..236 "{"
|
||||
WHITESPACE@236..237 "\n"
|
||||
R_CURLY@237..238 "}"
|
||||
STMT_LIST@235..238
|
||||
L_CURLY@235..236 "{"
|
||||
WHITESPACE@236..237 "\n"
|
||||
R_CURLY@237..238 "}"
|
||||
WHITESPACE@238..239 "\n"
|
||||
error 21..21: expected a function pointer or path
|
||||
error 52..52: expected a function pointer or path
|
||||
|
@ -14,8 +14,9 @@ SOURCE_FILE@0..50
|
||||
R_PAREN@20..21 ")"
|
||||
WHITESPACE@21..22 " "
|
||||
BLOCK_EXPR@22..24
|
||||
L_CURLY@22..23 "{"
|
||||
R_CURLY@23..24 "}"
|
||||
STMT_LIST@22..24
|
||||
L_CURLY@22..23 "{"
|
||||
R_CURLY@23..24 "}"
|
||||
WHITESPACE@24..25 "\n"
|
||||
CONST@25..40
|
||||
UNSAFE_KW@25..31 "unsafe"
|
||||
|
@ -117,77 +117,78 @@ SOURCE_FILE@0..187
|
||||
R_PAREN@118..119 ")"
|
||||
WHITESPACE@119..120 " "
|
||||
BLOCK_EXPR@120..186
|
||||
L_CURLY@120..121 "{"
|
||||
WHITESPACE@121..126 "\n "
|
||||
LET_STMT@126..184
|
||||
LET_KW@126..129 "let"
|
||||
WHITESPACE@129..130 " "
|
||||
IDENT_PAT@130..131
|
||||
NAME@130..131
|
||||
IDENT@130..131 "b"
|
||||
WHITESPACE@131..132 " "
|
||||
EQ@132..133 "="
|
||||
WHITESPACE@133..134 " "
|
||||
CAST_EXPR@134..183
|
||||
PAREN_EXPR@134..138
|
||||
L_PAREN@134..135 "("
|
||||
REF_EXPR@135..137
|
||||
AMP@135..136 "&"
|
||||
PATH_EXPR@136..137
|
||||
PATH@136..137
|
||||
PATH_SEGMENT@136..137
|
||||
NAME_REF@136..137
|
||||
IDENT@136..137 "a"
|
||||
R_PAREN@137..138 ")"
|
||||
WHITESPACE@138..139 " "
|
||||
AS_KW@139..141 "as"
|
||||
WHITESPACE@141..142 " "
|
||||
REF_TYPE@142..183
|
||||
AMP@142..143 "&"
|
||||
DYN_TRAIT_TYPE@143..183
|
||||
DYN_KW@143..146 "dyn"
|
||||
WHITESPACE@146..147 " "
|
||||
TYPE_BOUND_LIST@147..183
|
||||
TYPE_BOUND@147..175
|
||||
PATH_TYPE@147..175
|
||||
PATH@147..175
|
||||
PATH_SEGMENT@147..175
|
||||
NAME_REF@147..150
|
||||
IDENT@147..150 "Add"
|
||||
GENERIC_ARG_LIST@150..175
|
||||
L_ANGLE@150..151 "<"
|
||||
TYPE_ARG@151..156
|
||||
PATH_TYPE@151..156
|
||||
PATH@151..156
|
||||
PATH_SEGMENT@151..156
|
||||
NAME_REF@151..156
|
||||
IDENT@151..156 "Other"
|
||||
COMMA@156..157 ","
|
||||
WHITESPACE@157..158 " "
|
||||
ASSOC_TYPE_ARG@158..174
|
||||
NAME_REF@158..164
|
||||
IDENT@158..164 "Output"
|
||||
WHITESPACE@164..165 " "
|
||||
EQ@165..166 "="
|
||||
WHITESPACE@166..167 " "
|
||||
PATH_TYPE@167..174
|
||||
PATH@167..174
|
||||
PATH_SEGMENT@167..174
|
||||
NAME_REF@167..174
|
||||
IDENT@167..174 "Addable"
|
||||
R_ANGLE@174..175 ">"
|
||||
WHITESPACE@175..176 " "
|
||||
PLUS@176..177 "+"
|
||||
WHITESPACE@177..178 " "
|
||||
TYPE_BOUND@178..183
|
||||
PATH_TYPE@178..183
|
||||
PATH@178..183
|
||||
PATH_SEGMENT@178..183
|
||||
NAME_REF@178..183
|
||||
IDENT@178..183 "Other"
|
||||
SEMICOLON@183..184 ";"
|
||||
WHITESPACE@184..185 "\n"
|
||||
R_CURLY@185..186 "}"
|
||||
STMT_LIST@120..186
|
||||
L_CURLY@120..121 "{"
|
||||
WHITESPACE@121..126 "\n "
|
||||
LET_STMT@126..184
|
||||
LET_KW@126..129 "let"
|
||||
WHITESPACE@129..130 " "
|
||||
IDENT_PAT@130..131
|
||||
NAME@130..131
|
||||
IDENT@130..131 "b"
|
||||
WHITESPACE@131..132 " "
|
||||
EQ@132..133 "="
|
||||
WHITESPACE@133..134 " "
|
||||
CAST_EXPR@134..183
|
||||
PAREN_EXPR@134..138
|
||||
L_PAREN@134..135 "("
|
||||
REF_EXPR@135..137
|
||||
AMP@135..136 "&"
|
||||
PATH_EXPR@136..137
|
||||
PATH@136..137
|
||||
PATH_SEGMENT@136..137
|
||||
NAME_REF@136..137
|
||||
IDENT@136..137 "a"
|
||||
R_PAREN@137..138 ")"
|
||||
WHITESPACE@138..139 " "
|
||||
AS_KW@139..141 "as"
|
||||
WHITESPACE@141..142 " "
|
||||
REF_TYPE@142..183
|
||||
AMP@142..143 "&"
|
||||
DYN_TRAIT_TYPE@143..183
|
||||
DYN_KW@143..146 "dyn"
|
||||
WHITESPACE@146..147 " "
|
||||
TYPE_BOUND_LIST@147..183
|
||||
TYPE_BOUND@147..175
|
||||
PATH_TYPE@147..175
|
||||
PATH@147..175
|
||||
PATH_SEGMENT@147..175
|
||||
NAME_REF@147..150
|
||||
IDENT@147..150 "Add"
|
||||
GENERIC_ARG_LIST@150..175
|
||||
L_ANGLE@150..151 "<"
|
||||
TYPE_ARG@151..156
|
||||
PATH_TYPE@151..156
|
||||
PATH@151..156
|
||||
PATH_SEGMENT@151..156
|
||||
NAME_REF@151..156
|
||||
IDENT@151..156 "Other"
|
||||
COMMA@156..157 ","
|
||||
WHITESPACE@157..158 " "
|
||||
ASSOC_TYPE_ARG@158..174
|
||||
NAME_REF@158..164
|
||||
IDENT@158..164 "Output"
|
||||
WHITESPACE@164..165 " "
|
||||
EQ@165..166 "="
|
||||
WHITESPACE@166..167 " "
|
||||
PATH_TYPE@167..174
|
||||
PATH@167..174
|
||||
PATH_SEGMENT@167..174
|
||||
NAME_REF@167..174
|
||||
IDENT@167..174 "Addable"
|
||||
R_ANGLE@174..175 ">"
|
||||
WHITESPACE@175..176 " "
|
||||
PLUS@176..177 "+"
|
||||
WHITESPACE@177..178 " "
|
||||
TYPE_BOUND@178..183
|
||||
PATH_TYPE@178..183
|
||||
PATH@178..183
|
||||
PATH_SEGMENT@178..183
|
||||
NAME_REF@178..183
|
||||
IDENT@178..183 "Other"
|
||||
SEMICOLON@183..184 ";"
|
||||
WHITESPACE@184..185 "\n"
|
||||
R_CURLY@185..186 "}"
|
||||
WHITESPACE@186..187 "\n"
|
||||
error 19..34: ambiguous `+` in a type
|
||||
error 54..69: ambiguous `+` in a type
|
||||
|
@ -9,48 +9,49 @@ SOURCE_FILE@0..90
|
||||
R_PAREN@5..6 ")"
|
||||
WHITESPACE@6..7 " "
|
||||
BLOCK_EXPR@7..40
|
||||
L_CURLY@7..8 "{"
|
||||
WHITESPACE@8..13 "\n "
|
||||
EXPR_STMT@13..31
|
||||
PATH_EXPR@13..31
|
||||
PATH@13..31
|
||||
PATH_SEGMENT@13..31
|
||||
NAME_REF@13..14
|
||||
IDENT@13..14 "S"
|
||||
GENERIC_ARG_LIST@14..31
|
||||
COLON2@14..16 "::"
|
||||
L_ANGLE@16..17 "<"
|
||||
TYPE_ARG@17..31
|
||||
PATH_TYPE@17..31
|
||||
PATH@17..31
|
||||
PATH@17..28
|
||||
PATH_SEGMENT@17..28
|
||||
NAME_REF@17..21
|
||||
IDENT@17..21 "Item"
|
||||
GENERIC_ARG_LIST@21..28
|
||||
COLON2@21..23 "::"
|
||||
L_ANGLE@23..24 "<"
|
||||
TYPE_ARG@24..27
|
||||
PATH_TYPE@24..27
|
||||
PATH@24..27
|
||||
PATH_SEGMENT@24..27
|
||||
NAME_REF@24..27
|
||||
IDENT@24..27 "lol"
|
||||
R_ANGLE@27..28 ">"
|
||||
COLON2@28..30 "::"
|
||||
ERROR@30..31
|
||||
L_ANGLE@30..31 "<"
|
||||
BIN_EXPR@31..38
|
||||
PATH_EXPR@31..35
|
||||
PATH@31..35
|
||||
PATH_SEGMENT@31..35
|
||||
NAME_REF@31..35
|
||||
IDENT@31..35 "nope"
|
||||
SHR@35..37 ">>"
|
||||
ERROR@37..38
|
||||
SEMICOLON@37..38 ";"
|
||||
WHITESPACE@38..39 "\n"
|
||||
R_CURLY@39..40 "}"
|
||||
STMT_LIST@7..40
|
||||
L_CURLY@7..8 "{"
|
||||
WHITESPACE@8..13 "\n "
|
||||
EXPR_STMT@13..31
|
||||
PATH_EXPR@13..31
|
||||
PATH@13..31
|
||||
PATH_SEGMENT@13..31
|
||||
NAME_REF@13..14
|
||||
IDENT@13..14 "S"
|
||||
GENERIC_ARG_LIST@14..31
|
||||
COLON2@14..16 "::"
|
||||
L_ANGLE@16..17 "<"
|
||||
TYPE_ARG@17..31
|
||||
PATH_TYPE@17..31
|
||||
PATH@17..31
|
||||
PATH@17..28
|
||||
PATH_SEGMENT@17..28
|
||||
NAME_REF@17..21
|
||||
IDENT@17..21 "Item"
|
||||
GENERIC_ARG_LIST@21..28
|
||||
COLON2@21..23 "::"
|
||||
L_ANGLE@23..24 "<"
|
||||
TYPE_ARG@24..27
|
||||
PATH_TYPE@24..27
|
||||
PATH@24..27
|
||||
PATH_SEGMENT@24..27
|
||||
NAME_REF@24..27
|
||||
IDENT@24..27 "lol"
|
||||
R_ANGLE@27..28 ">"
|
||||
COLON2@28..30 "::"
|
||||
ERROR@30..31
|
||||
L_ANGLE@30..31 "<"
|
||||
BIN_EXPR@31..38
|
||||
PATH_EXPR@31..35
|
||||
PATH@31..35
|
||||
PATH_SEGMENT@31..35
|
||||
NAME_REF@31..35
|
||||
IDENT@31..35 "nope"
|
||||
SHR@35..37 ">>"
|
||||
ERROR@37..38
|
||||
SEMICOLON@37..38 ";"
|
||||
WHITESPACE@38..39 "\n"
|
||||
R_CURLY@39..40 "}"
|
||||
WHITESPACE@40..42 "\n\n"
|
||||
FN@42..89
|
||||
FN_KW@42..44 "fn"
|
||||
@ -62,53 +63,54 @@ SOURCE_FILE@0..90
|
||||
R_PAREN@47..48 ")"
|
||||
WHITESPACE@48..49 " "
|
||||
BLOCK_EXPR@49..89
|
||||
L_CURLY@49..50 "{"
|
||||
WHITESPACE@50..55 "\n "
|
||||
LET_STMT@55..76
|
||||
LET_KW@55..58 "let"
|
||||
WHITESPACE@58..59 " "
|
||||
WILDCARD_PAT@59..60
|
||||
UNDERSCORE@59..60 "_"
|
||||
COLON@60..61 ":"
|
||||
WHITESPACE@61..62 " "
|
||||
PATH_TYPE@62..76
|
||||
PATH@62..76
|
||||
PATH@62..73
|
||||
PATH_SEGMENT@62..73
|
||||
NAME_REF@62..66
|
||||
IDENT@62..66 "Item"
|
||||
GENERIC_ARG_LIST@66..73
|
||||
COLON2@66..68 "::"
|
||||
L_ANGLE@68..69 "<"
|
||||
TYPE_ARG@69..72
|
||||
PATH_TYPE@69..72
|
||||
PATH@69..72
|
||||
PATH_SEGMENT@69..72
|
||||
NAME_REF@69..72
|
||||
IDENT@69..72 "lol"
|
||||
R_ANGLE@72..73 ">"
|
||||
COLON2@73..75 "::"
|
||||
ERROR@75..76
|
||||
L_ANGLE@75..76 "<"
|
||||
EXPR_STMT@76..83
|
||||
BIN_EXPR@76..83
|
||||
PATH_EXPR@76..80
|
||||
PATH@76..80
|
||||
PATH_SEGMENT@76..80
|
||||
NAME_REF@76..80
|
||||
IDENT@76..80 "nope"
|
||||
R_ANGLE@80..81 ">"
|
||||
WHITESPACE@81..82 " "
|
||||
ERROR@82..83
|
||||
EQ@82..83 "="
|
||||
WHITESPACE@83..84 " "
|
||||
EXPR_STMT@84..87
|
||||
TUPLE_EXPR@84..86
|
||||
L_PAREN@84..85 "("
|
||||
R_PAREN@85..86 ")"
|
||||
SEMICOLON@86..87 ";"
|
||||
WHITESPACE@87..88 "\n"
|
||||
R_CURLY@88..89 "}"
|
||||
STMT_LIST@49..89
|
||||
L_CURLY@49..50 "{"
|
||||
WHITESPACE@50..55 "\n "
|
||||
LET_STMT@55..76
|
||||
LET_KW@55..58 "let"
|
||||
WHITESPACE@58..59 " "
|
||||
WILDCARD_PAT@59..60
|
||||
UNDERSCORE@59..60 "_"
|
||||
COLON@60..61 ":"
|
||||
WHITESPACE@61..62 " "
|
||||
PATH_TYPE@62..76
|
||||
PATH@62..76
|
||||
PATH@62..73
|
||||
PATH_SEGMENT@62..73
|
||||
NAME_REF@62..66
|
||||
IDENT@62..66 "Item"
|
||||
GENERIC_ARG_LIST@66..73
|
||||
COLON2@66..68 "::"
|
||||
L_ANGLE@68..69 "<"
|
||||
TYPE_ARG@69..72
|
||||
PATH_TYPE@69..72
|
||||
PATH@69..72
|
||||
PATH_SEGMENT@69..72
|
||||
NAME_REF@69..72
|
||||
IDENT@69..72 "lol"
|
||||
R_ANGLE@72..73 ">"
|
||||
COLON2@73..75 "::"
|
||||
ERROR@75..76
|
||||
L_ANGLE@75..76 "<"
|
||||
EXPR_STMT@76..83
|
||||
BIN_EXPR@76..83
|
||||
PATH_EXPR@76..80
|
||||
PATH@76..80
|
||||
PATH_SEGMENT@76..80
|
||||
NAME_REF@76..80
|
||||
IDENT@76..80 "nope"
|
||||
R_ANGLE@80..81 ">"
|
||||
WHITESPACE@81..82 " "
|
||||
ERROR@82..83
|
||||
EQ@82..83 "="
|
||||
WHITESPACE@83..84 " "
|
||||
EXPR_STMT@84..87
|
||||
TUPLE_EXPR@84..86
|
||||
L_PAREN@84..85 "("
|
||||
R_PAREN@85..86 ")"
|
||||
SEMICOLON@86..87 ";"
|
||||
WHITESPACE@87..88 "\n"
|
||||
R_CURLY@88..89 "}"
|
||||
WHITESPACE@89..90 "\n"
|
||||
error 30..30: expected identifier
|
||||
error 31..31: expected COMMA
|
||||
|
@ -8,5 +8,6 @@ FN@0..11
|
||||
R_PAREN@7..8 ")"
|
||||
WHITESPACE@8..9 " "
|
||||
BLOCK_EXPR@9..11
|
||||
L_CURLY@9..10 "{"
|
||||
R_CURLY@10..11 "}"
|
||||
STMT_LIST@9..11
|
||||
L_CURLY@9..10 "{"
|
||||
R_CURLY@10..11 "}"
|
||||
|
@ -1,69 +1,70 @@
|
||||
EXPR_STMT@0..55
|
||||
BLOCK_EXPR@0..55
|
||||
L_CURLY@0..1 "{"
|
||||
WHITESPACE@1..6 "\n "
|
||||
LET_STMT@6..20
|
||||
LET_KW@6..9 "let"
|
||||
WHITESPACE@9..10 " "
|
||||
IDENT_PAT@10..11
|
||||
NAME@10..11
|
||||
IDENT@10..11 "x"
|
||||
WHITESPACE@11..12 " "
|
||||
EQ@12..13 "="
|
||||
WHITESPACE@13..14 " "
|
||||
CALL_EXPR@14..19
|
||||
PATH_EXPR@14..17
|
||||
PATH@14..17
|
||||
PATH_SEGMENT@14..17
|
||||
NAME_REF@14..17
|
||||
IDENT@14..17 "foo"
|
||||
ARG_LIST@17..19
|
||||
L_PAREN@17..18 "("
|
||||
R_PAREN@18..19 ")"
|
||||
SEMICOLON@19..20 ";"
|
||||
WHITESPACE@20..25 "\n "
|
||||
LET_STMT@25..39
|
||||
LET_KW@25..28 "let"
|
||||
WHITESPACE@28..29 " "
|
||||
IDENT_PAT@29..30
|
||||
NAME@29..30
|
||||
IDENT@29..30 "y"
|
||||
WHITESPACE@30..31 " "
|
||||
EQ@31..32 "="
|
||||
WHITESPACE@32..33 " "
|
||||
CALL_EXPR@33..38
|
||||
PATH_EXPR@33..36
|
||||
PATH@33..36
|
||||
PATH_SEGMENT@33..36
|
||||
NAME_REF@33..36
|
||||
IDENT@33..36 "bar"
|
||||
ARG_LIST@36..38
|
||||
L_PAREN@36..37 "("
|
||||
R_PAREN@37..38 ")"
|
||||
SEMICOLON@38..39 ";"
|
||||
WHITESPACE@39..44 "\n "
|
||||
CALL_EXPR@44..53
|
||||
PATH_EXPR@44..46
|
||||
PATH@44..46
|
||||
PATH_SEGMENT@44..46
|
||||
NAME_REF@44..46
|
||||
IDENT@44..46 "Ok"
|
||||
ARG_LIST@46..53
|
||||
L_PAREN@46..47 "("
|
||||
BIN_EXPR@47..52
|
||||
PATH_EXPR@47..48
|
||||
PATH@47..48
|
||||
PATH_SEGMENT@47..48
|
||||
NAME_REF@47..48
|
||||
IDENT@47..48 "x"
|
||||
WHITESPACE@48..49 " "
|
||||
PLUS@49..50 "+"
|
||||
WHITESPACE@50..51 " "
|
||||
PATH_EXPR@51..52
|
||||
PATH@51..52
|
||||
PATH_SEGMENT@51..52
|
||||
NAME_REF@51..52
|
||||
IDENT@51..52 "y"
|
||||
R_PAREN@52..53 ")"
|
||||
WHITESPACE@53..54 "\n"
|
||||
R_CURLY@54..55 "}"
|
||||
STMT_LIST@0..55
|
||||
L_CURLY@0..1 "{"
|
||||
WHITESPACE@1..6 "\n "
|
||||
LET_STMT@6..20
|
||||
LET_KW@6..9 "let"
|
||||
WHITESPACE@9..10 " "
|
||||
IDENT_PAT@10..11
|
||||
NAME@10..11
|
||||
IDENT@10..11 "x"
|
||||
WHITESPACE@11..12 " "
|
||||
EQ@12..13 "="
|
||||
WHITESPACE@13..14 " "
|
||||
CALL_EXPR@14..19
|
||||
PATH_EXPR@14..17
|
||||
PATH@14..17
|
||||
PATH_SEGMENT@14..17
|
||||
NAME_REF@14..17
|
||||
IDENT@14..17 "foo"
|
||||
ARG_LIST@17..19
|
||||
L_PAREN@17..18 "("
|
||||
R_PAREN@18..19 ")"
|
||||
SEMICOLON@19..20 ";"
|
||||
WHITESPACE@20..25 "\n "
|
||||
LET_STMT@25..39
|
||||
LET_KW@25..28 "let"
|
||||
WHITESPACE@28..29 " "
|
||||
IDENT_PAT@29..30
|
||||
NAME@29..30
|
||||
IDENT@29..30 "y"
|
||||
WHITESPACE@30..31 " "
|
||||
EQ@31..32 "="
|
||||
WHITESPACE@32..33 " "
|
||||
CALL_EXPR@33..38
|
||||
PATH_EXPR@33..36
|
||||
PATH@33..36
|
||||
PATH_SEGMENT@33..36
|
||||
NAME_REF@33..36
|
||||
IDENT@33..36 "bar"
|
||||
ARG_LIST@36..38
|
||||
L_PAREN@36..37 "("
|
||||
R_PAREN@37..38 ")"
|
||||
SEMICOLON@38..39 ";"
|
||||
WHITESPACE@39..44 "\n "
|
||||
CALL_EXPR@44..53
|
||||
PATH_EXPR@44..46
|
||||
PATH@44..46
|
||||
PATH_SEGMENT@44..46
|
||||
NAME_REF@44..46
|
||||
IDENT@44..46 "Ok"
|
||||
ARG_LIST@46..53
|
||||
L_PAREN@46..47 "("
|
||||
BIN_EXPR@47..52
|
||||
PATH_EXPR@47..48
|
||||
PATH@47..48
|
||||
PATH_SEGMENT@47..48
|
||||
NAME_REF@47..48
|
||||
IDENT@47..48 "x"
|
||||
WHITESPACE@48..49 " "
|
||||
PLUS@49..50 "+"
|
||||
WHITESPACE@50..51 " "
|
||||
PATH_EXPR@51..52
|
||||
PATH@51..52
|
||||
PATH_SEGMENT@51..52
|
||||
NAME_REF@51..52
|
||||
IDENT@51..52 "y"
|
||||
R_PAREN@52..53 ")"
|
||||
WHITESPACE@53..54 "\n"
|
||||
R_CURLY@54..55 "}"
|
||||
|
@ -9,18 +9,19 @@ SOURCE_FILE@0..30
|
||||
R_PAREN@8..9 ")"
|
||||
WHITESPACE@9..10 " "
|
||||
BLOCK_EXPR@10..29
|
||||
L_CURLY@10..11 "{"
|
||||
WHITESPACE@11..16 "\n "
|
||||
ERROR@16..22
|
||||
LABEL@16..22
|
||||
LIFETIME@16..21
|
||||
LIFETIME_IDENT@16..21 "'loop"
|
||||
COLON@21..22 ":"
|
||||
WHITESPACE@22..23 " "
|
||||
IMPL@23..27
|
||||
IMPL_KW@23..27 "impl"
|
||||
WHITESPACE@27..28 "\n"
|
||||
R_CURLY@28..29 "}"
|
||||
STMT_LIST@10..29
|
||||
L_CURLY@10..11 "{"
|
||||
WHITESPACE@11..16 "\n "
|
||||
ERROR@16..22
|
||||
LABEL@16..22
|
||||
LIFETIME@16..21
|
||||
LIFETIME_IDENT@16..21 "'loop"
|
||||
COLON@21..22 ":"
|
||||
WHITESPACE@22..23 " "
|
||||
IMPL@23..27
|
||||
IMPL_KW@23..27 "impl"
|
||||
WHITESPACE@27..28 "\n"
|
||||
R_CURLY@28..29 "}"
|
||||
WHITESPACE@29..30 "\n"
|
||||
error 22..22: expected a loop
|
||||
error 27..27: expected type
|
||||
|
@ -8,8 +8,9 @@ SOURCE_FILE@0..33
|
||||
L_PAREN@6..7 "("
|
||||
R_PAREN@7..8 ")"
|
||||
BLOCK_EXPR@8..10
|
||||
L_CURLY@8..9 "{"
|
||||
R_CURLY@9..10 "}"
|
||||
STMT_LIST@8..10
|
||||
L_CURLY@8..9 "{"
|
||||
R_CURLY@9..10 "}"
|
||||
WHITESPACE@10..11 " "
|
||||
ERROR@11..17
|
||||
UNSAFE_KW@11..17 "unsafe"
|
||||
@ -28,8 +29,9 @@ SOURCE_FILE@0..33
|
||||
L_PAREN@28..29 "("
|
||||
R_PAREN@29..30 ")"
|
||||
BLOCK_EXPR@30..32
|
||||
L_CURLY@30..31 "{"
|
||||
R_CURLY@31..32 "}"
|
||||
STMT_LIST@30..32
|
||||
L_CURLY@30..31 "{"
|
||||
R_CURLY@31..32 "}"
|
||||
WHITESPACE@32..33 "\n"
|
||||
error 11..11: expected an item
|
||||
error 18..18: expected an item
|
||||
|
@ -9,23 +9,24 @@ SOURCE_FILE@0..30
|
||||
R_PAREN@7..8 ")"
|
||||
WHITESPACE@8..9 " "
|
||||
BLOCK_EXPR@9..29
|
||||
L_CURLY@9..10 "{"
|
||||
WHITESPACE@10..11 " "
|
||||
LET_STMT@11..27
|
||||
LET_KW@11..14 "let"
|
||||
WHITESPACE@14..15 " "
|
||||
WILDCARD_PAT@15..16
|
||||
UNDERSCORE@15..16 "_"
|
||||
WHITESPACE@16..17 " "
|
||||
EQ@17..18 "="
|
||||
WHITESPACE@18..19 " "
|
||||
EFFECT_EXPR@19..27
|
||||
ASYNC_KW@19..24 "async"
|
||||
WHITESPACE@24..25 " "
|
||||
BLOCK_EXPR@25..27
|
||||
L_CURLY@25..26 "{"
|
||||
R_CURLY@26..27 "}"
|
||||
WHITESPACE@27..28 " "
|
||||
R_CURLY@28..29 "}"
|
||||
STMT_LIST@9..29
|
||||
L_CURLY@9..10 "{"
|
||||
WHITESPACE@10..11 " "
|
||||
LET_STMT@11..27
|
||||
LET_KW@11..14 "let"
|
||||
WHITESPACE@14..15 " "
|
||||
WILDCARD_PAT@15..16
|
||||
UNDERSCORE@15..16 "_"
|
||||
WHITESPACE@16..17 " "
|
||||
EQ@17..18 "="
|
||||
WHITESPACE@18..19 " "
|
||||
BLOCK_EXPR@19..27
|
||||
ASYNC_KW@19..24 "async"
|
||||
WHITESPACE@24..25 " "
|
||||
STMT_LIST@25..27
|
||||
L_CURLY@25..26 "{"
|
||||
R_CURLY@26..27 "}"
|
||||
WHITESPACE@27..28 " "
|
||||
R_CURLY@28..29 "}"
|
||||
WHITESPACE@29..30 "\n"
|
||||
error 27..27: expected SEMICOLON
|
||||
|
@ -9,17 +9,18 @@ SOURCE_FILE@0..21
|
||||
R_PAREN@7..8 ")"
|
||||
WHITESPACE@8..9 " "
|
||||
BLOCK_EXPR@9..20
|
||||
L_CURLY@9..10 "{"
|
||||
WHITESPACE@10..11 " "
|
||||
ERROR@11..14
|
||||
VISIBILITY@11..14
|
||||
PUB_KW@11..14 "pub"
|
||||
WHITESPACE@14..15 " "
|
||||
EXPR_STMT@15..18
|
||||
LITERAL@15..17
|
||||
INT_NUMBER@15..17 "92"
|
||||
SEMICOLON@17..18 ";"
|
||||
WHITESPACE@18..19 " "
|
||||
R_CURLY@19..20 "}"
|
||||
STMT_LIST@9..20
|
||||
L_CURLY@9..10 "{"
|
||||
WHITESPACE@10..11 " "
|
||||
ERROR@11..14
|
||||
VISIBILITY@11..14
|
||||
PUB_KW@11..14 "pub"
|
||||
WHITESPACE@14..15 " "
|
||||
EXPR_STMT@15..18
|
||||
LITERAL@15..17
|
||||
INT_NUMBER@15..17 "92"
|
||||
SEMICOLON@17..18 ";"
|
||||
WHITESPACE@18..19 " "
|
||||
R_CURLY@19..20 "}"
|
||||
WHITESPACE@20..21 "\n"
|
||||
error 14..14: expected an item
|
||||
|
@ -9,44 +9,45 @@ SOURCE_FILE@0..47
|
||||
R_PAREN@7..8 ")"
|
||||
WHITESPACE@8..9 " "
|
||||
BLOCK_EXPR@9..46
|
||||
L_CURLY@9..10 "{"
|
||||
WHITESPACE@10..15 "\n "
|
||||
EXPR_STMT@15..20
|
||||
FIELD_EXPR@15..19
|
||||
PATH_EXPR@15..16
|
||||
PATH@15..16
|
||||
PATH_SEGMENT@15..16
|
||||
NAME_REF@15..16
|
||||
IDENT@15..16 "x"
|
||||
DOT@16..17 "."
|
||||
FLOAT_NUMBER@17..19 "0."
|
||||
SEMICOLON@19..20 ";"
|
||||
WHITESPACE@20..25 "\n "
|
||||
EXPR_STMT@25..32
|
||||
FIELD_EXPR@25..31
|
||||
PATH_EXPR@25..26
|
||||
PATH@25..26
|
||||
PATH_SEGMENT@25..26
|
||||
NAME_REF@25..26
|
||||
IDENT@25..26 "x"
|
||||
DOT@26..27 "."
|
||||
NAME_REF@27..31
|
||||
INT_NUMBER@27..31 "1i32"
|
||||
SEMICOLON@31..32 ";"
|
||||
WHITESPACE@32..37 "\n "
|
||||
EXPR_STMT@37..44
|
||||
FIELD_EXPR@37..43
|
||||
PATH_EXPR@37..38
|
||||
PATH@37..38
|
||||
PATH_SEGMENT@37..38
|
||||
NAME_REF@37..38
|
||||
IDENT@37..38 "x"
|
||||
DOT@38..39 "."
|
||||
NAME_REF@39..43
|
||||
INT_NUMBER@39..43 "0x01"
|
||||
SEMICOLON@43..44 ";"
|
||||
WHITESPACE@44..45 "\n"
|
||||
R_CURLY@45..46 "}"
|
||||
STMT_LIST@9..46
|
||||
L_CURLY@9..10 "{"
|
||||
WHITESPACE@10..15 "\n "
|
||||
EXPR_STMT@15..20
|
||||
FIELD_EXPR@15..19
|
||||
PATH_EXPR@15..16
|
||||
PATH@15..16
|
||||
PATH_SEGMENT@15..16
|
||||
NAME_REF@15..16
|
||||
IDENT@15..16 "x"
|
||||
DOT@16..17 "."
|
||||
FLOAT_NUMBER@17..19 "0."
|
||||
SEMICOLON@19..20 ";"
|
||||
WHITESPACE@20..25 "\n "
|
||||
EXPR_STMT@25..32
|
||||
FIELD_EXPR@25..31
|
||||
PATH_EXPR@25..26
|
||||
PATH@25..26
|
||||
PATH_SEGMENT@25..26
|
||||
NAME_REF@25..26
|
||||
IDENT@25..26 "x"
|
||||
DOT@26..27 "."
|
||||
NAME_REF@27..31
|
||||
INT_NUMBER@27..31 "1i32"
|
||||
SEMICOLON@31..32 ";"
|
||||
WHITESPACE@32..37 "\n "
|
||||
EXPR_STMT@37..44
|
||||
FIELD_EXPR@37..43
|
||||
PATH_EXPR@37..38
|
||||
PATH@37..38
|
||||
PATH_SEGMENT@37..38
|
||||
NAME_REF@37..38
|
||||
IDENT@37..38 "x"
|
||||
DOT@38..39 "."
|
||||
NAME_REF@39..43
|
||||
INT_NUMBER@39..43 "0x01"
|
||||
SEMICOLON@43..44 ";"
|
||||
WHITESPACE@44..45 "\n"
|
||||
R_CURLY@45..46 "}"
|
||||
WHITESPACE@46..47 "\n"
|
||||
error 27..31: Tuple (struct) field access is only allowed through decimal integers with no underscores or suffix
|
||||
error 39..43: Tuple (struct) field access is only allowed through decimal integers with no underscores or suffix
|
||||
|
@ -9,40 +9,41 @@ SOURCE_FILE@0..45
|
||||
R_PAREN@8..9 ")"
|
||||
WHITESPACE@9..10 " "
|
||||
BLOCK_EXPR@10..44
|
||||
L_CURLY@10..11 "{"
|
||||
WHITESPACE@11..16 "\n "
|
||||
RECORD_EXPR@16..42
|
||||
PATH@16..17
|
||||
PATH_SEGMENT@16..17
|
||||
NAME_REF@16..17
|
||||
IDENT@16..17 "S"
|
||||
WHITESPACE@17..18 " "
|
||||
RECORD_EXPR_FIELD_LIST@18..42
|
||||
L_CURLY@18..19 "{"
|
||||
WHITESPACE@19..20 " "
|
||||
RECORD_EXPR_FIELD@20..40
|
||||
NAME_REF@20..25
|
||||
IDENT@20..25 "field"
|
||||
WHITESPACE@25..26 " "
|
||||
RANGE_EXPR@26..40
|
||||
DOT2@26..28 ".."
|
||||
CALL_EXPR@28..40
|
||||
PATH_EXPR@28..38
|
||||
PATH@28..38
|
||||
PATH@28..29
|
||||
PATH_SEGMENT@28..29
|
||||
NAME_REF@28..29
|
||||
IDENT@28..29 "S"
|
||||
COLON2@29..31 "::"
|
||||
PATH_SEGMENT@31..38
|
||||
NAME_REF@31..38
|
||||
IDENT@31..38 "default"
|
||||
ARG_LIST@38..40
|
||||
L_PAREN@38..39 "("
|
||||
R_PAREN@39..40 ")"
|
||||
WHITESPACE@40..41 " "
|
||||
R_CURLY@41..42 "}"
|
||||
WHITESPACE@42..43 "\n"
|
||||
R_CURLY@43..44 "}"
|
||||
STMT_LIST@10..44
|
||||
L_CURLY@10..11 "{"
|
||||
WHITESPACE@11..16 "\n "
|
||||
RECORD_EXPR@16..42
|
||||
PATH@16..17
|
||||
PATH_SEGMENT@16..17
|
||||
NAME_REF@16..17
|
||||
IDENT@16..17 "S"
|
||||
WHITESPACE@17..18 " "
|
||||
RECORD_EXPR_FIELD_LIST@18..42
|
||||
L_CURLY@18..19 "{"
|
||||
WHITESPACE@19..20 " "
|
||||
RECORD_EXPR_FIELD@20..40
|
||||
NAME_REF@20..25
|
||||
IDENT@20..25 "field"
|
||||
WHITESPACE@25..26 " "
|
||||
RANGE_EXPR@26..40
|
||||
DOT2@26..28 ".."
|
||||
CALL_EXPR@28..40
|
||||
PATH_EXPR@28..38
|
||||
PATH@28..38
|
||||
PATH@28..29
|
||||
PATH_SEGMENT@28..29
|
||||
NAME_REF@28..29
|
||||
IDENT@28..29 "S"
|
||||
COLON2@29..31 "::"
|
||||
PATH_SEGMENT@31..38
|
||||
NAME_REF@31..38
|
||||
IDENT@31..38 "default"
|
||||
ARG_LIST@38..40
|
||||
L_PAREN@38..39 "("
|
||||
R_PAREN@39..40 ")"
|
||||
WHITESPACE@40..41 " "
|
||||
R_CURLY@41..42 "}"
|
||||
WHITESPACE@42..43 "\n"
|
||||
R_CURLY@43..44 "}"
|
||||
WHITESPACE@44..45 "\n"
|
||||
error 25..25: expected COLON
|
||||
|
@ -44,8 +44,9 @@ SOURCE_FILE@0..29
|
||||
R_PAREN@24..25 ")"
|
||||
WHITESPACE@25..26 " "
|
||||
BLOCK_EXPR@26..28
|
||||
L_CURLY@26..27 "{"
|
||||
R_CURLY@27..28 "}"
|
||||
STMT_LIST@26..28
|
||||
L_CURLY@26..27 "{"
|
||||
R_CURLY@27..28 "}"
|
||||
WHITESPACE@28..29 "\n"
|
||||
error 6..6: missing type for function parameter
|
||||
error 6..6: expected COMMA
|
||||
|
@ -56,7 +56,8 @@ SOURCE_FILE@0..54
|
||||
R_PAREN@48..49 ")"
|
||||
WHITESPACE@49..50 "\n"
|
||||
BLOCK_EXPR@50..53
|
||||
L_CURLY@50..51 "{"
|
||||
WHITESPACE@51..52 " "
|
||||
R_CURLY@52..53 "}"
|
||||
STMT_LIST@50..53
|
||||
L_CURLY@50..51 "{"
|
||||
WHITESPACE@51..52 " "
|
||||
R_CURLY@52..53 "}"
|
||||
WHITESPACE@53..54 "\n"
|
||||
|
@ -32,6 +32,7 @@ SOURCE_FILE@0..28
|
||||
L_PAREN@23..24 "("
|
||||
R_PAREN@24..25 ")"
|
||||
BLOCK_EXPR@25..27
|
||||
L_CURLY@25..26 "{"
|
||||
R_CURLY@26..27 "}"
|
||||
STMT_LIST@25..27
|
||||
L_CURLY@25..26 "{"
|
||||
R_CURLY@26..27 "}"
|
||||
WHITESPACE@27..28 "\n"
|
||||
|
@ -24,8 +24,9 @@ SOURCE_FILE@0..128
|
||||
R_PAREN@22..23 ")"
|
||||
WHITESPACE@23..24 " "
|
||||
BLOCK_EXPR@24..26
|
||||
L_CURLY@24..25 "{"
|
||||
R_CURLY@25..26 "}"
|
||||
STMT_LIST@24..26
|
||||
L_CURLY@24..25 "{"
|
||||
R_CURLY@25..26 "}"
|
||||
WHITESPACE@26..31 "\n "
|
||||
FN@31..46
|
||||
FN_KW@31..33 "fn"
|
||||
@ -42,8 +43,9 @@ SOURCE_FILE@0..128
|
||||
R_PAREN@42..43 ")"
|
||||
WHITESPACE@43..44 " "
|
||||
BLOCK_EXPR@44..46
|
||||
L_CURLY@44..45 "{"
|
||||
R_CURLY@45..46 "}"
|
||||
STMT_LIST@44..46
|
||||
L_CURLY@44..45 "{"
|
||||
R_CURLY@45..46 "}"
|
||||
WHITESPACE@46..51 "\n "
|
||||
FN@51..69
|
||||
FN_KW@51..53 "fn"
|
||||
@ -63,8 +65,9 @@ SOURCE_FILE@0..128
|
||||
R_PAREN@65..66 ")"
|
||||
WHITESPACE@66..67 " "
|
||||
BLOCK_EXPR@67..69
|
||||
L_CURLY@67..68 "{"
|
||||
R_CURLY@68..69 "}"
|
||||
STMT_LIST@67..69
|
||||
L_CURLY@67..68 "{"
|
||||
R_CURLY@68..69 "}"
|
||||
WHITESPACE@69..74 "\n "
|
||||
FN@74..103
|
||||
FN_KW@74..76 "fn"
|
||||
@ -98,8 +101,9 @@ SOURCE_FILE@0..128
|
||||
R_PAREN@99..100 ")"
|
||||
WHITESPACE@100..101 " "
|
||||
BLOCK_EXPR@101..103
|
||||
L_CURLY@101..102 "{"
|
||||
R_CURLY@102..103 "}"
|
||||
STMT_LIST@101..103
|
||||
L_CURLY@101..102 "{"
|
||||
R_CURLY@102..103 "}"
|
||||
WHITESPACE@103..108 "\n "
|
||||
FN@108..125
|
||||
FN_KW@108..110 "fn"
|
||||
@ -116,8 +120,9 @@ SOURCE_FILE@0..128
|
||||
R_PAREN@121..122 ")"
|
||||
WHITESPACE@122..123 " "
|
||||
BLOCK_EXPR@123..125
|
||||
L_CURLY@123..124 "{"
|
||||
R_CURLY@124..125 "}"
|
||||
STMT_LIST@123..125
|
||||
L_CURLY@123..124 "{"
|
||||
R_CURLY@124..125 "}"
|
||||
WHITESPACE@125..126 "\n"
|
||||
R_CURLY@126..127 "}"
|
||||
WHITESPACE@127..128 "\n"
|
||||
|
@ -9,88 +9,89 @@ SOURCE_FILE@0..103
|
||||
R_PAREN@7..8 ")"
|
||||
WHITESPACE@8..9 " "
|
||||
BLOCK_EXPR@9..102
|
||||
L_CURLY@9..10 "{"
|
||||
WHITESPACE@10..15 "\n "
|
||||
LET_STMT@15..33
|
||||
LET_KW@15..18 "let"
|
||||
WHITESPACE@18..19 " "
|
||||
PATH_PAT@19..27
|
||||
PATH@19..27
|
||||
PATH@19..22
|
||||
PATH_SEGMENT@19..22
|
||||
NAME_REF@19..22
|
||||
IDENT@19..22 "foo"
|
||||
COLON2@22..24 "::"
|
||||
PATH_SEGMENT@24..27
|
||||
NAME_REF@24..27
|
||||
IDENT@24..27 "Bar"
|
||||
WHITESPACE@27..28 " "
|
||||
EQ@28..29 "="
|
||||
WHITESPACE@29..30 " "
|
||||
TUPLE_EXPR@30..32
|
||||
L_PAREN@30..31 "("
|
||||
R_PAREN@31..32 ")"
|
||||
SEMICOLON@32..33 ";"
|
||||
WHITESPACE@33..38 "\n "
|
||||
LET_STMT@38..53
|
||||
LET_KW@38..41 "let"
|
||||
WHITESPACE@41..42 " "
|
||||
PATH_PAT@42..47
|
||||
PATH@42..47
|
||||
PATH_SEGMENT@42..47
|
||||
COLON2@42..44 "::"
|
||||
NAME_REF@44..47
|
||||
IDENT@44..47 "Bar"
|
||||
WHITESPACE@47..48 " "
|
||||
EQ@48..49 "="
|
||||
WHITESPACE@49..50 " "
|
||||
TUPLE_EXPR@50..52
|
||||
L_PAREN@50..51 "("
|
||||
R_PAREN@51..52 ")"
|
||||
SEMICOLON@52..53 ";"
|
||||
WHITESPACE@53..58 "\n "
|
||||
LET_STMT@58..78
|
||||
LET_KW@58..61 "let"
|
||||
WHITESPACE@61..62 " "
|
||||
RECORD_PAT@62..72
|
||||
PATH@62..65
|
||||
PATH_SEGMENT@62..65
|
||||
NAME_REF@62..65
|
||||
IDENT@62..65 "Bar"
|
||||
WHITESPACE@65..66 " "
|
||||
RECORD_PAT_FIELD_LIST@66..72
|
||||
L_CURLY@66..67 "{"
|
||||
WHITESPACE@67..68 " "
|
||||
DOT2@68..70 ".."
|
||||
WHITESPACE@70..71 " "
|
||||
R_CURLY@71..72 "}"
|
||||
WHITESPACE@72..73 " "
|
||||
EQ@73..74 "="
|
||||
WHITESPACE@74..75 " "
|
||||
TUPLE_EXPR@75..77
|
||||
L_PAREN@75..76 "("
|
||||
R_PAREN@76..77 ")"
|
||||
SEMICOLON@77..78 ";"
|
||||
WHITESPACE@78..83 "\n "
|
||||
LET_STMT@83..100
|
||||
LET_KW@83..86 "let"
|
||||
WHITESPACE@86..87 " "
|
||||
TUPLE_STRUCT_PAT@87..94
|
||||
PATH@87..90
|
||||
PATH_SEGMENT@87..90
|
||||
NAME_REF@87..90
|
||||
IDENT@87..90 "Bar"
|
||||
L_PAREN@90..91 "("
|
||||
REST_PAT@91..93
|
||||
DOT2@91..93 ".."
|
||||
R_PAREN@93..94 ")"
|
||||
WHITESPACE@94..95 " "
|
||||
EQ@95..96 "="
|
||||
WHITESPACE@96..97 " "
|
||||
TUPLE_EXPR@97..99
|
||||
L_PAREN@97..98 "("
|
||||
R_PAREN@98..99 ")"
|
||||
SEMICOLON@99..100 ";"
|
||||
WHITESPACE@100..101 "\n"
|
||||
R_CURLY@101..102 "}"
|
||||
STMT_LIST@9..102
|
||||
L_CURLY@9..10 "{"
|
||||
WHITESPACE@10..15 "\n "
|
||||
LET_STMT@15..33
|
||||
LET_KW@15..18 "let"
|
||||
WHITESPACE@18..19 " "
|
||||
PATH_PAT@19..27
|
||||
PATH@19..27
|
||||
PATH@19..22
|
||||
PATH_SEGMENT@19..22
|
||||
NAME_REF@19..22
|
||||
IDENT@19..22 "foo"
|
||||
COLON2@22..24 "::"
|
||||
PATH_SEGMENT@24..27
|
||||
NAME_REF@24..27
|
||||
IDENT@24..27 "Bar"
|
||||
WHITESPACE@27..28 " "
|
||||
EQ@28..29 "="
|
||||
WHITESPACE@29..30 " "
|
||||
TUPLE_EXPR@30..32
|
||||
L_PAREN@30..31 "("
|
||||
R_PAREN@31..32 ")"
|
||||
SEMICOLON@32..33 ";"
|
||||
WHITESPACE@33..38 "\n "
|
||||
LET_STMT@38..53
|
||||
LET_KW@38..41 "let"
|
||||
WHITESPACE@41..42 " "
|
||||
PATH_PAT@42..47
|
||||
PATH@42..47
|
||||
PATH_SEGMENT@42..47
|
||||
COLON2@42..44 "::"
|
||||
NAME_REF@44..47
|
||||
IDENT@44..47 "Bar"
|
||||
WHITESPACE@47..48 " "
|
||||
EQ@48..49 "="
|
||||
WHITESPACE@49..50 " "
|
||||
TUPLE_EXPR@50..52
|
||||
L_PAREN@50..51 "("
|
||||
R_PAREN@51..52 ")"
|
||||
SEMICOLON@52..53 ";"
|
||||
WHITESPACE@53..58 "\n "
|
||||
LET_STMT@58..78
|
||||
LET_KW@58..61 "let"
|
||||
WHITESPACE@61..62 " "
|
||||
RECORD_PAT@62..72
|
||||
PATH@62..65
|
||||
PATH_SEGMENT@62..65
|
||||
NAME_REF@62..65
|
||||
IDENT@62..65 "Bar"
|
||||
WHITESPACE@65..66 " "
|
||||
RECORD_PAT_FIELD_LIST@66..72
|
||||
L_CURLY@66..67 "{"
|
||||
WHITESPACE@67..68 " "
|
||||
DOT2@68..70 ".."
|
||||
WHITESPACE@70..71 " "
|
||||
R_CURLY@71..72 "}"
|
||||
WHITESPACE@72..73 " "
|
||||
EQ@73..74 "="
|
||||
WHITESPACE@74..75 " "
|
||||
TUPLE_EXPR@75..77
|
||||
L_PAREN@75..76 "("
|
||||
R_PAREN@76..77 ")"
|
||||
SEMICOLON@77..78 ";"
|
||||
WHITESPACE@78..83 "\n "
|
||||
LET_STMT@83..100
|
||||
LET_KW@83..86 "let"
|
||||
WHITESPACE@86..87 " "
|
||||
TUPLE_STRUCT_PAT@87..94
|
||||
PATH@87..90
|
||||
PATH_SEGMENT@87..90
|
||||
NAME_REF@87..90
|
||||
IDENT@87..90 "Bar"
|
||||
L_PAREN@90..91 "("
|
||||
REST_PAT@91..93
|
||||
DOT2@91..93 ".."
|
||||
R_PAREN@93..94 ")"
|
||||
WHITESPACE@94..95 " "
|
||||
EQ@95..96 "="
|
||||
WHITESPACE@96..97 " "
|
||||
TUPLE_EXPR@97..99
|
||||
L_PAREN@97..98 "("
|
||||
R_PAREN@98..99 ")"
|
||||
SEMICOLON@99..100 ";"
|
||||
WHITESPACE@100..101 "\n"
|
||||
R_CURLY@101..102 "}"
|
||||
WHITESPACE@102..103 "\n"
|
||||
|
@ -9,16 +9,18 @@ SOURCE_FILE@0..26
|
||||
R_PAREN@7..8 ")"
|
||||
WHITESPACE@8..9 " "
|
||||
BLOCK_EXPR@9..25
|
||||
L_CURLY@9..10 "{"
|
||||
WHITESPACE@10..15 "\n "
|
||||
EXPR_STMT@15..23
|
||||
LOOP_EXPR@15..22
|
||||
LOOP_KW@15..19 "loop"
|
||||
WHITESPACE@19..20 " "
|
||||
BLOCK_EXPR@20..22
|
||||
L_CURLY@20..21 "{"
|
||||
R_CURLY@21..22 "}"
|
||||
SEMICOLON@22..23 ";"
|
||||
WHITESPACE@23..24 "\n"
|
||||
R_CURLY@24..25 "}"
|
||||
STMT_LIST@9..25
|
||||
L_CURLY@9..10 "{"
|
||||
WHITESPACE@10..15 "\n "
|
||||
EXPR_STMT@15..23
|
||||
LOOP_EXPR@15..22
|
||||
LOOP_KW@15..19 "loop"
|
||||
WHITESPACE@19..20 " "
|
||||
BLOCK_EXPR@20..22
|
||||
STMT_LIST@20..22
|
||||
L_CURLY@20..21 "{"
|
||||
R_CURLY@21..22 "}"
|
||||
SEMICOLON@22..23 ";"
|
||||
WHITESPACE@23..24 "\n"
|
||||
R_CURLY@24..25 "}"
|
||||
WHITESPACE@25..26 "\n"
|
||||
|
@ -9,51 +9,52 @@ SOURCE_FILE@0..48
|
||||
R_PAREN@7..8 ")"
|
||||
WHITESPACE@8..9 " "
|
||||
BLOCK_EXPR@9..47
|
||||
L_CURLY@9..10 "{"
|
||||
WHITESPACE@10..15 "\n "
|
||||
EXPR_STMT@15..21
|
||||
FIELD_EXPR@15..20
|
||||
PATH_EXPR@15..16
|
||||
PATH@15..16
|
||||
PATH_SEGMENT@15..16
|
||||
NAME_REF@15..16
|
||||
IDENT@15..16 "x"
|
||||
DOT@16..17 "."
|
||||
NAME_REF@17..20
|
||||
IDENT@17..20 "foo"
|
||||
SEMICOLON@20..21 ";"
|
||||
WHITESPACE@21..26 "\n "
|
||||
EXPR_STMT@26..34
|
||||
FIELD_EXPR@26..33
|
||||
FIELD_EXPR@26..29
|
||||
PATH_EXPR@26..27
|
||||
PATH@26..27
|
||||
PATH_SEGMENT@26..27
|
||||
NAME_REF@26..27
|
||||
IDENT@26..27 "x"
|
||||
DOT@27..28 "."
|
||||
NAME_REF@28..29
|
||||
INT_NUMBER@28..29 "0"
|
||||
DOT@29..30 "."
|
||||
NAME_REF@30..33
|
||||
IDENT@30..33 "bar"
|
||||
SEMICOLON@33..34 ";"
|
||||
WHITESPACE@34..39 "\n "
|
||||
EXPR_STMT@39..45
|
||||
CALL_EXPR@39..44
|
||||
FIELD_EXPR@39..42
|
||||
PATH_EXPR@39..40
|
||||
PATH@39..40
|
||||
PATH_SEGMENT@39..40
|
||||
NAME_REF@39..40
|
||||
IDENT@39..40 "x"
|
||||
DOT@40..41 "."
|
||||
NAME_REF@41..42
|
||||
INT_NUMBER@41..42 "0"
|
||||
ARG_LIST@42..44
|
||||
L_PAREN@42..43 "("
|
||||
R_PAREN@43..44 ")"
|
||||
SEMICOLON@44..45 ";"
|
||||
WHITESPACE@45..46 "\n"
|
||||
R_CURLY@46..47 "}"
|
||||
STMT_LIST@9..47
|
||||
L_CURLY@9..10 "{"
|
||||
WHITESPACE@10..15 "\n "
|
||||
EXPR_STMT@15..21
|
||||
FIELD_EXPR@15..20
|
||||
PATH_EXPR@15..16
|
||||
PATH@15..16
|
||||
PATH_SEGMENT@15..16
|
||||
NAME_REF@15..16
|
||||
IDENT@15..16 "x"
|
||||
DOT@16..17 "."
|
||||
NAME_REF@17..20
|
||||
IDENT@17..20 "foo"
|
||||
SEMICOLON@20..21 ";"
|
||||
WHITESPACE@21..26 "\n "
|
||||
EXPR_STMT@26..34
|
||||
FIELD_EXPR@26..33
|
||||
FIELD_EXPR@26..29
|
||||
PATH_EXPR@26..27
|
||||
PATH@26..27
|
||||
PATH_SEGMENT@26..27
|
||||
NAME_REF@26..27
|
||||
IDENT@26..27 "x"
|
||||
DOT@27..28 "."
|
||||
NAME_REF@28..29
|
||||
INT_NUMBER@28..29 "0"
|
||||
DOT@29..30 "."
|
||||
NAME_REF@30..33
|
||||
IDENT@30..33 "bar"
|
||||
SEMICOLON@33..34 ";"
|
||||
WHITESPACE@34..39 "\n "
|
||||
EXPR_STMT@39..45
|
||||
CALL_EXPR@39..44
|
||||
FIELD_EXPR@39..42
|
||||
PATH_EXPR@39..40
|
||||
PATH@39..40
|
||||
PATH_SEGMENT@39..40
|
||||
NAME_REF@39..40
|
||||
IDENT@39..40 "x"
|
||||
DOT@40..41 "."
|
||||
NAME_REF@41..42
|
||||
INT_NUMBER@41..42 "0"
|
||||
ARG_LIST@42..44
|
||||
L_PAREN@42..43 "("
|
||||
R_PAREN@43..44 ")"
|
||||
SEMICOLON@44..45 ";"
|
||||
WHITESPACE@45..46 "\n"
|
||||
R_CURLY@46..47 "}"
|
||||
WHITESPACE@47..48 "\n"
|
||||
|
@ -9,28 +9,30 @@ SOURCE_FILE@0..69
|
||||
R_PAREN@7..8 ")"
|
||||
WHITESPACE@8..9 " "
|
||||
BLOCK_EXPR@9..68
|
||||
L_CURLY@9..10 "{"
|
||||
WHITESPACE@10..15 "\n "
|
||||
LOOP_EXPR@15..66
|
||||
LOOP_KW@15..19 "loop"
|
||||
WHITESPACE@19..20 " "
|
||||
BLOCK_EXPR@20..66
|
||||
L_CURLY@20..21 "{"
|
||||
WHITESPACE@21..30 "\n "
|
||||
EXPR_STMT@30..39
|
||||
CONTINUE_EXPR@30..38
|
||||
CONTINUE_KW@30..38 "continue"
|
||||
SEMICOLON@38..39 ";"
|
||||
WHITESPACE@39..48 "\n "
|
||||
EXPR_STMT@48..60
|
||||
CONTINUE_EXPR@48..59
|
||||
CONTINUE_KW@48..56 "continue"
|
||||
WHITESPACE@56..57 " "
|
||||
LIFETIME@57..59
|
||||
LIFETIME_IDENT@57..59 "'l"
|
||||
SEMICOLON@59..60 ";"
|
||||
WHITESPACE@60..65 "\n "
|
||||
R_CURLY@65..66 "}"
|
||||
WHITESPACE@66..67 "\n"
|
||||
R_CURLY@67..68 "}"
|
||||
STMT_LIST@9..68
|
||||
L_CURLY@9..10 "{"
|
||||
WHITESPACE@10..15 "\n "
|
||||
LOOP_EXPR@15..66
|
||||
LOOP_KW@15..19 "loop"
|
||||
WHITESPACE@19..20 " "
|
||||
BLOCK_EXPR@20..66
|
||||
STMT_LIST@20..66
|
||||
L_CURLY@20..21 "{"
|
||||
WHITESPACE@21..30 "\n "
|
||||
EXPR_STMT@30..39
|
||||
CONTINUE_EXPR@30..38
|
||||
CONTINUE_KW@30..38 "continue"
|
||||
SEMICOLON@38..39 ";"
|
||||
WHITESPACE@39..48 "\n "
|
||||
EXPR_STMT@48..60
|
||||
CONTINUE_EXPR@48..59
|
||||
CONTINUE_KW@48..56 "continue"
|
||||
WHITESPACE@56..57 " "
|
||||
LIFETIME@57..59
|
||||
LIFETIME_IDENT@57..59 "'l"
|
||||
SEMICOLON@59..60 ";"
|
||||
WHITESPACE@60..65 "\n "
|
||||
R_CURLY@65..66 "}"
|
||||
WHITESPACE@66..67 "\n"
|
||||
R_CURLY@67..68 "}"
|
||||
WHITESPACE@68..69 "\n"
|
||||
|
@ -33,8 +33,9 @@ SOURCE_FILE@0..69
|
||||
R_PAREN@29..30 ")"
|
||||
WHITESPACE@30..31 " "
|
||||
BLOCK_EXPR@31..33
|
||||
L_CURLY@31..32 "{"
|
||||
R_CURLY@32..33 "}"
|
||||
STMT_LIST@31..33
|
||||
L_CURLY@31..32 "{"
|
||||
R_CURLY@32..33 "}"
|
||||
WHITESPACE@33..38 "\n "
|
||||
FN@38..66
|
||||
FN_KW@38..40 "fn"
|
||||
@ -67,8 +68,9 @@ SOURCE_FILE@0..69
|
||||
R_PAREN@62..63 ")"
|
||||
WHITESPACE@63..64 " "
|
||||
BLOCK_EXPR@64..66
|
||||
L_CURLY@64..65 "{"
|
||||
R_CURLY@65..66 "}"
|
||||
STMT_LIST@64..66
|
||||
L_CURLY@64..65 "{"
|
||||
R_CURLY@65..66 "}"
|
||||
WHITESPACE@66..67 "\n"
|
||||
R_CURLY@67..68 "}"
|
||||
WHITESPACE@68..69 "\n"
|
||||
|
@ -9,36 +9,37 @@ SOURCE_FILE@0..44
|
||||
R_PAREN@7..8 ")"
|
||||
WHITESPACE@8..9 " "
|
||||
BLOCK_EXPR@9..43
|
||||
L_CURLY@9..10 "{"
|
||||
WHITESPACE@10..15 "\n "
|
||||
EXPR_STMT@15..20
|
||||
PREFIX_EXPR@15..19
|
||||
STAR@15..16 "*"
|
||||
PREFIX_EXPR@16..19
|
||||
STAR@16..17 "*"
|
||||
REF_EXPR@17..19
|
||||
AMP@17..18 "&"
|
||||
LITERAL@18..19
|
||||
INT_NUMBER@18..19 "1"
|
||||
SEMICOLON@19..20 ";"
|
||||
WHITESPACE@20..25 "\n "
|
||||
EXPR_STMT@25..32
|
||||
PREFIX_EXPR@25..31
|
||||
BANG@25..26 "!"
|
||||
PREFIX_EXPR@26..31
|
||||
BANG@26..27 "!"
|
||||
LITERAL@27..31
|
||||
TRUE_KW@27..31 "true"
|
||||
SEMICOLON@31..32 ";"
|
||||
WHITESPACE@32..37 "\n "
|
||||
EXPR_STMT@37..41
|
||||
PREFIX_EXPR@37..40
|
||||
MINUS@37..38 "-"
|
||||
PREFIX_EXPR@38..40
|
||||
MINUS@38..39 "-"
|
||||
LITERAL@39..40
|
||||
INT_NUMBER@39..40 "1"
|
||||
SEMICOLON@40..41 ";"
|
||||
WHITESPACE@41..42 "\n"
|
||||
R_CURLY@42..43 "}"
|
||||
STMT_LIST@9..43
|
||||
L_CURLY@9..10 "{"
|
||||
WHITESPACE@10..15 "\n "
|
||||
EXPR_STMT@15..20
|
||||
PREFIX_EXPR@15..19
|
||||
STAR@15..16 "*"
|
||||
PREFIX_EXPR@16..19
|
||||
STAR@16..17 "*"
|
||||
REF_EXPR@17..19
|
||||
AMP@17..18 "&"
|
||||
LITERAL@18..19
|
||||
INT_NUMBER@18..19 "1"
|
||||
SEMICOLON@19..20 ";"
|
||||
WHITESPACE@20..25 "\n "
|
||||
EXPR_STMT@25..32
|
||||
PREFIX_EXPR@25..31
|
||||
BANG@25..26 "!"
|
||||
PREFIX_EXPR@26..31
|
||||
BANG@26..27 "!"
|
||||
LITERAL@27..31
|
||||
TRUE_KW@27..31 "true"
|
||||
SEMICOLON@31..32 ";"
|
||||
WHITESPACE@32..37 "\n "
|
||||
EXPR_STMT@37..41
|
||||
PREFIX_EXPR@37..40
|
||||
MINUS@37..38 "-"
|
||||
PREFIX_EXPR@38..40
|
||||
MINUS@38..39 "-"
|
||||
LITERAL@39..40
|
||||
INT_NUMBER@39..40 "1"
|
||||
SEMICOLON@40..41 ";"
|
||||
WHITESPACE@41..42 "\n"
|
||||
R_CURLY@42..43 "}"
|
||||
WHITESPACE@43..44 "\n"
|
||||
|
@ -55,8 +55,9 @@ SOURCE_FILE@0..89
|
||||
R_PAREN@61..62 ")"
|
||||
WHITESPACE@62..63 " "
|
||||
BLOCK_EXPR@63..65
|
||||
L_CURLY@63..64 "{"
|
||||
R_CURLY@64..65 "}"
|
||||
STMT_LIST@63..65
|
||||
L_CURLY@63..64 "{"
|
||||
R_CURLY@64..65 "}"
|
||||
WHITESPACE@65..70 "\n "
|
||||
FN@70..86
|
||||
FN_KW@70..72 "fn"
|
||||
@ -72,8 +73,9 @@ SOURCE_FILE@0..89
|
||||
R_PAREN@82..83 ")"
|
||||
WHITESPACE@83..84 " "
|
||||
BLOCK_EXPR@84..86
|
||||
L_CURLY@84..85 "{"
|
||||
R_CURLY@85..86 "}"
|
||||
STMT_LIST@84..86
|
||||
L_CURLY@84..85 "{"
|
||||
R_CURLY@85..86 "}"
|
||||
WHITESPACE@86..87 "\n"
|
||||
R_CURLY@87..88 "}"
|
||||
WHITESPACE@88..89 "\n"
|
||||
|
@ -9,33 +9,34 @@ SOURCE_FILE@0..39
|
||||
R_PAREN@8..9 ")"
|
||||
WHITESPACE@9..10 " "
|
||||
BLOCK_EXPR@10..38
|
||||
L_CURLY@10..11 "{"
|
||||
WHITESPACE@11..16 "\n "
|
||||
LET_STMT@16..36
|
||||
LET_KW@16..19 "let"
|
||||
WHITESPACE@19..20 " "
|
||||
SLICE_PAT@20..30
|
||||
L_BRACK@20..21 "["
|
||||
IDENT_PAT@21..22
|
||||
NAME@21..22
|
||||
IDENT@21..22 "a"
|
||||
COMMA@22..23 ","
|
||||
WHITESPACE@23..24 " "
|
||||
IDENT_PAT@24..25
|
||||
NAME@24..25
|
||||
IDENT@24..25 "b"
|
||||
COMMA@25..26 ","
|
||||
WHITESPACE@26..27 " "
|
||||
REST_PAT@27..29
|
||||
DOT2@27..29 ".."
|
||||
R_BRACK@29..30 "]"
|
||||
WHITESPACE@30..31 " "
|
||||
EQ@31..32 "="
|
||||
WHITESPACE@32..33 " "
|
||||
ARRAY_EXPR@33..35
|
||||
L_BRACK@33..34 "["
|
||||
R_BRACK@34..35 "]"
|
||||
SEMICOLON@35..36 ";"
|
||||
WHITESPACE@36..37 "\n"
|
||||
R_CURLY@37..38 "}"
|
||||
STMT_LIST@10..38
|
||||
L_CURLY@10..11 "{"
|
||||
WHITESPACE@11..16 "\n "
|
||||
LET_STMT@16..36
|
||||
LET_KW@16..19 "let"
|
||||
WHITESPACE@19..20 " "
|
||||
SLICE_PAT@20..30
|
||||
L_BRACK@20..21 "["
|
||||
IDENT_PAT@21..22
|
||||
NAME@21..22
|
||||
IDENT@21..22 "a"
|
||||
COMMA@22..23 ","
|
||||
WHITESPACE@23..24 " "
|
||||
IDENT_PAT@24..25
|
||||
NAME@24..25
|
||||
IDENT@24..25 "b"
|
||||
COMMA@25..26 ","
|
||||
WHITESPACE@26..27 " "
|
||||
REST_PAT@27..29
|
||||
DOT2@27..29 ".."
|
||||
R_BRACK@29..30 "]"
|
||||
WHITESPACE@30..31 " "
|
||||
EQ@31..32 "="
|
||||
WHITESPACE@32..33 " "
|
||||
ARRAY_EXPR@33..35
|
||||
L_BRACK@33..34 "["
|
||||
R_BRACK@34..35 "]"
|
||||
SEMICOLON@35..36 ";"
|
||||
WHITESPACE@36..37 "\n"
|
||||
R_CURLY@37..38 "}"
|
||||
WHITESPACE@38..39 "\n"
|
||||
|
@ -9,96 +9,97 @@ SOURCE_FILE@0..97
|
||||
R_PAREN@7..8 ")"
|
||||
WHITESPACE@8..9 " "
|
||||
BLOCK_EXPR@9..96
|
||||
L_CURLY@9..10 "{"
|
||||
WHITESPACE@10..15 "\n "
|
||||
LET_STMT@15..28
|
||||
LET_KW@15..18 "let"
|
||||
WHITESPACE@18..19 " "
|
||||
TUPLE_STRUCT_PAT@19..22
|
||||
PATH@19..20
|
||||
PATH_SEGMENT@19..20
|
||||
NAME_REF@19..20
|
||||
IDENT@19..20 "S"
|
||||
L_PAREN@20..21 "("
|
||||
R_PAREN@21..22 ")"
|
||||
WHITESPACE@22..23 " "
|
||||
EQ@23..24 "="
|
||||
WHITESPACE@24..25 " "
|
||||
TUPLE_EXPR@25..27
|
||||
L_PAREN@25..26 "("
|
||||
R_PAREN@26..27 ")"
|
||||
SEMICOLON@27..28 ";"
|
||||
WHITESPACE@28..33 "\n "
|
||||
LET_STMT@33..47
|
||||
LET_KW@33..36 "let"
|
||||
WHITESPACE@36..37 " "
|
||||
TUPLE_STRUCT_PAT@37..41
|
||||
PATH@37..38
|
||||
PATH_SEGMENT@37..38
|
||||
NAME_REF@37..38
|
||||
IDENT@37..38 "S"
|
||||
L_PAREN@38..39 "("
|
||||
WILDCARD_PAT@39..40
|
||||
UNDERSCORE@39..40 "_"
|
||||
R_PAREN@40..41 ")"
|
||||
WHITESPACE@41..42 " "
|
||||
EQ@42..43 "="
|
||||
WHITESPACE@43..44 " "
|
||||
TUPLE_EXPR@44..46
|
||||
L_PAREN@44..45 "("
|
||||
R_PAREN@45..46 ")"
|
||||
SEMICOLON@46..47 ";"
|
||||
WHITESPACE@47..52 "\n "
|
||||
LET_STMT@52..67
|
||||
LET_KW@52..55 "let"
|
||||
WHITESPACE@55..56 " "
|
||||
TUPLE_STRUCT_PAT@56..61
|
||||
PATH@56..57
|
||||
PATH_SEGMENT@56..57
|
||||
NAME_REF@56..57
|
||||
IDENT@56..57 "S"
|
||||
L_PAREN@57..58 "("
|
||||
WILDCARD_PAT@58..59
|
||||
UNDERSCORE@58..59 "_"
|
||||
COMMA@59..60 ","
|
||||
R_PAREN@60..61 ")"
|
||||
WHITESPACE@61..62 " "
|
||||
EQ@62..63 "="
|
||||
WHITESPACE@63..64 " "
|
||||
TUPLE_EXPR@64..66
|
||||
L_PAREN@64..65 "("
|
||||
R_PAREN@65..66 ")"
|
||||
SEMICOLON@66..67 ";"
|
||||
WHITESPACE@67..72 "\n "
|
||||
LET_STMT@72..94
|
||||
LET_KW@72..75 "let"
|
||||
WHITESPACE@75..76 " "
|
||||
TUPLE_STRUCT_PAT@76..88
|
||||
PATH@76..77
|
||||
PATH_SEGMENT@76..77
|
||||
NAME_REF@76..77
|
||||
IDENT@76..77 "S"
|
||||
L_PAREN@77..78 "("
|
||||
WILDCARD_PAT@78..79
|
||||
UNDERSCORE@78..79 "_"
|
||||
COMMA@79..80 ","
|
||||
WHITESPACE@80..81 " "
|
||||
REST_PAT@81..83
|
||||
DOT2@81..83 ".."
|
||||
WHITESPACE@83..84 " "
|
||||
COMMA@84..85 ","
|
||||
WHITESPACE@85..86 " "
|
||||
IDENT_PAT@86..87
|
||||
NAME@86..87
|
||||
IDENT@86..87 "x"
|
||||
R_PAREN@87..88 ")"
|
||||
WHITESPACE@88..89 " "
|
||||
EQ@89..90 "="
|
||||
WHITESPACE@90..91 " "
|
||||
TUPLE_EXPR@91..93
|
||||
L_PAREN@91..92 "("
|
||||
R_PAREN@92..93 ")"
|
||||
SEMICOLON@93..94 ";"
|
||||
WHITESPACE@94..95 "\n"
|
||||
R_CURLY@95..96 "}"
|
||||
STMT_LIST@9..96
|
||||
L_CURLY@9..10 "{"
|
||||
WHITESPACE@10..15 "\n "
|
||||
LET_STMT@15..28
|
||||
LET_KW@15..18 "let"
|
||||
WHITESPACE@18..19 " "
|
||||
TUPLE_STRUCT_PAT@19..22
|
||||
PATH@19..20
|
||||
PATH_SEGMENT@19..20
|
||||
NAME_REF@19..20
|
||||
IDENT@19..20 "S"
|
||||
L_PAREN@20..21 "("
|
||||
R_PAREN@21..22 ")"
|
||||
WHITESPACE@22..23 " "
|
||||
EQ@23..24 "="
|
||||
WHITESPACE@24..25 " "
|
||||
TUPLE_EXPR@25..27
|
||||
L_PAREN@25..26 "("
|
||||
R_PAREN@26..27 ")"
|
||||
SEMICOLON@27..28 ";"
|
||||
WHITESPACE@28..33 "\n "
|
||||
LET_STMT@33..47
|
||||
LET_KW@33..36 "let"
|
||||
WHITESPACE@36..37 " "
|
||||
TUPLE_STRUCT_PAT@37..41
|
||||
PATH@37..38
|
||||
PATH_SEGMENT@37..38
|
||||
NAME_REF@37..38
|
||||
IDENT@37..38 "S"
|
||||
L_PAREN@38..39 "("
|
||||
WILDCARD_PAT@39..40
|
||||
UNDERSCORE@39..40 "_"
|
||||
R_PAREN@40..41 ")"
|
||||
WHITESPACE@41..42 " "
|
||||
EQ@42..43 "="
|
||||
WHITESPACE@43..44 " "
|
||||
TUPLE_EXPR@44..46
|
||||
L_PAREN@44..45 "("
|
||||
R_PAREN@45..46 ")"
|
||||
SEMICOLON@46..47 ";"
|
||||
WHITESPACE@47..52 "\n "
|
||||
LET_STMT@52..67
|
||||
LET_KW@52..55 "let"
|
||||
WHITESPACE@55..56 " "
|
||||
TUPLE_STRUCT_PAT@56..61
|
||||
PATH@56..57
|
||||
PATH_SEGMENT@56..57
|
||||
NAME_REF@56..57
|
||||
IDENT@56..57 "S"
|
||||
L_PAREN@57..58 "("
|
||||
WILDCARD_PAT@58..59
|
||||
UNDERSCORE@58..59 "_"
|
||||
COMMA@59..60 ","
|
||||
R_PAREN@60..61 ")"
|
||||
WHITESPACE@61..62 " "
|
||||
EQ@62..63 "="
|
||||
WHITESPACE@63..64 " "
|
||||
TUPLE_EXPR@64..66
|
||||
L_PAREN@64..65 "("
|
||||
R_PAREN@65..66 ")"
|
||||
SEMICOLON@66..67 ";"
|
||||
WHITESPACE@67..72 "\n "
|
||||
LET_STMT@72..94
|
||||
LET_KW@72..75 "let"
|
||||
WHITESPACE@75..76 " "
|
||||
TUPLE_STRUCT_PAT@76..88
|
||||
PATH@76..77
|
||||
PATH_SEGMENT@76..77
|
||||
NAME_REF@76..77
|
||||
IDENT@76..77 "S"
|
||||
L_PAREN@77..78 "("
|
||||
WILDCARD_PAT@78..79
|
||||
UNDERSCORE@78..79 "_"
|
||||
COMMA@79..80 ","
|
||||
WHITESPACE@80..81 " "
|
||||
REST_PAT@81..83
|
||||
DOT2@81..83 ".."
|
||||
WHITESPACE@83..84 " "
|
||||
COMMA@84..85 ","
|
||||
WHITESPACE@85..86 " "
|
||||
IDENT_PAT@86..87
|
||||
NAME@86..87
|
||||
IDENT@86..87 "x"
|
||||
R_PAREN@87..88 ")"
|
||||
WHITESPACE@88..89 " "
|
||||
EQ@89..90 "="
|
||||
WHITESPACE@90..91 " "
|
||||
TUPLE_EXPR@91..93
|
||||
L_PAREN@91..92 "("
|
||||
R_PAREN@92..93 ")"
|
||||
SEMICOLON@93..94 ";"
|
||||
WHITESPACE@94..95 "\n"
|
||||
R_CURLY@95..96 "}"
|
||||
WHITESPACE@96..97 "\n"
|
||||
|
@ -9,41 +9,42 @@ SOURCE_FILE@0..52
|
||||
R_PAREN@8..9 ")"
|
||||
WHITESPACE@9..10 " "
|
||||
BLOCK_EXPR@10..51
|
||||
L_CURLY@10..11 "{"
|
||||
WHITESPACE@11..16 "\n "
|
||||
LET_STMT@16..28
|
||||
LET_KW@16..19 "let"
|
||||
WHITESPACE@19..20 " "
|
||||
REF_PAT@20..22
|
||||
AMP@20..21 "&"
|
||||
IDENT_PAT@21..22
|
||||
NAME@21..22
|
||||
IDENT@21..22 "a"
|
||||
WHITESPACE@22..23 " "
|
||||
EQ@23..24 "="
|
||||
WHITESPACE@24..25 " "
|
||||
TUPLE_EXPR@25..27
|
||||
L_PAREN@25..26 "("
|
||||
R_PAREN@26..27 ")"
|
||||
SEMICOLON@27..28 ";"
|
||||
WHITESPACE@28..33 "\n "
|
||||
LET_STMT@33..49
|
||||
LET_KW@33..36 "let"
|
||||
WHITESPACE@36..37 " "
|
||||
REF_PAT@37..43
|
||||
AMP@37..38 "&"
|
||||
MUT_KW@38..41 "mut"
|
||||
WHITESPACE@41..42 " "
|
||||
IDENT_PAT@42..43
|
||||
NAME@42..43
|
||||
IDENT@42..43 "b"
|
||||
WHITESPACE@43..44 " "
|
||||
EQ@44..45 "="
|
||||
WHITESPACE@45..46 " "
|
||||
TUPLE_EXPR@46..48
|
||||
L_PAREN@46..47 "("
|
||||
R_PAREN@47..48 ")"
|
||||
SEMICOLON@48..49 ";"
|
||||
WHITESPACE@49..50 "\n"
|
||||
R_CURLY@50..51 "}"
|
||||
STMT_LIST@10..51
|
||||
L_CURLY@10..11 "{"
|
||||
WHITESPACE@11..16 "\n "
|
||||
LET_STMT@16..28
|
||||
LET_KW@16..19 "let"
|
||||
WHITESPACE@19..20 " "
|
||||
REF_PAT@20..22
|
||||
AMP@20..21 "&"
|
||||
IDENT_PAT@21..22
|
||||
NAME@21..22
|
||||
IDENT@21..22 "a"
|
||||
WHITESPACE@22..23 " "
|
||||
EQ@23..24 "="
|
||||
WHITESPACE@24..25 " "
|
||||
TUPLE_EXPR@25..27
|
||||
L_PAREN@25..26 "("
|
||||
R_PAREN@26..27 ")"
|
||||
SEMICOLON@27..28 ";"
|
||||
WHITESPACE@28..33 "\n "
|
||||
LET_STMT@33..49
|
||||
LET_KW@33..36 "let"
|
||||
WHITESPACE@36..37 " "
|
||||
REF_PAT@37..43
|
||||
AMP@37..38 "&"
|
||||
MUT_KW@38..41 "mut"
|
||||
WHITESPACE@41..42 " "
|
||||
IDENT_PAT@42..43
|
||||
NAME@42..43
|
||||
IDENT@42..43 "b"
|
||||
WHITESPACE@43..44 " "
|
||||
EQ@44..45 "="
|
||||
WHITESPACE@45..46 " "
|
||||
TUPLE_EXPR@46..48
|
||||
L_PAREN@46..47 "("
|
||||
R_PAREN@47..48 ")"
|
||||
SEMICOLON@48..49 ";"
|
||||
WHITESPACE@49..50 "\n"
|
||||
R_CURLY@50..51 "}"
|
||||
WHITESPACE@51..52 "\n"
|
||||
|
@ -9,81 +9,82 @@ SOURCE_FILE@0..89
|
||||
R_PAREN@7..8 ")"
|
||||
WHITESPACE@8..9 " "
|
||||
BLOCK_EXPR@9..88
|
||||
L_CURLY@9..10 "{"
|
||||
WHITESPACE@10..15 "\n "
|
||||
EXPR_STMT@15..25
|
||||
CAST_EXPR@15..24
|
||||
LITERAL@15..17
|
||||
INT_NUMBER@15..17 "82"
|
||||
WHITESPACE@17..18 " "
|
||||
AS_KW@18..20 "as"
|
||||
WHITESPACE@20..21 " "
|
||||
PATH_TYPE@21..24
|
||||
PATH@21..24
|
||||
PATH_SEGMENT@21..24
|
||||
NAME_REF@21..24
|
||||
IDENT@21..24 "i32"
|
||||
SEMICOLON@24..25 ";"
|
||||
WHITESPACE@25..30 "\n "
|
||||
EXPR_STMT@30..43
|
||||
BIN_EXPR@30..42
|
||||
CAST_EXPR@30..38
|
||||
LITERAL@30..32
|
||||
INT_NUMBER@30..32 "81"
|
||||
WHITESPACE@32..33 " "
|
||||
AS_KW@33..35 "as"
|
||||
WHITESPACE@35..36 " "
|
||||
PATH_TYPE@36..38
|
||||
PATH@36..38
|
||||
PATH_SEGMENT@36..38
|
||||
NAME_REF@36..38
|
||||
IDENT@36..38 "i8"
|
||||
WHITESPACE@38..39 " "
|
||||
PLUS@39..40 "+"
|
||||
WHITESPACE@40..41 " "
|
||||
LITERAL@41..42
|
||||
INT_NUMBER@41..42 "1"
|
||||
SEMICOLON@42..43 ";"
|
||||
WHITESPACE@43..48 "\n "
|
||||
EXPR_STMT@48..62
|
||||
BIN_EXPR@48..61
|
||||
CAST_EXPR@48..57
|
||||
LITERAL@48..50
|
||||
INT_NUMBER@48..50 "79"
|
||||
WHITESPACE@50..51 " "
|
||||
AS_KW@51..53 "as"
|
||||
WHITESPACE@53..54 " "
|
||||
PATH_TYPE@54..57
|
||||
PATH@54..57
|
||||
PATH_SEGMENT@54..57
|
||||
NAME_REF@54..57
|
||||
IDENT@54..57 "i16"
|
||||
WHITESPACE@57..58 " "
|
||||
MINUS@58..59 "-"
|
||||
WHITESPACE@59..60 " "
|
||||
LITERAL@60..61
|
||||
INT_NUMBER@60..61 "1"
|
||||
SEMICOLON@61..62 ";"
|
||||
WHITESPACE@62..67 "\n "
|
||||
EXPR_STMT@67..86
|
||||
BIN_EXPR@67..85
|
||||
CAST_EXPR@67..77
|
||||
LITERAL@67..71
|
||||
INT_NUMBER@67..71 "0x36"
|
||||
WHITESPACE@71..72 " "
|
||||
AS_KW@72..74 "as"
|
||||
WHITESPACE@74..75 " "
|
||||
PATH_TYPE@75..77
|
||||
PATH@75..77
|
||||
PATH_SEGMENT@75..77
|
||||
NAME_REF@75..77
|
||||
IDENT@75..77 "u8"
|
||||
WHITESPACE@77..78 " "
|
||||
LTEQ@78..80 "<="
|
||||
WHITESPACE@80..81 " "
|
||||
LITERAL@81..85
|
||||
INT_NUMBER@81..85 "0x37"
|
||||
SEMICOLON@85..86 ";"
|
||||
WHITESPACE@86..87 "\n"
|
||||
R_CURLY@87..88 "}"
|
||||
STMT_LIST@9..88
|
||||
L_CURLY@9..10 "{"
|
||||
WHITESPACE@10..15 "\n "
|
||||
EXPR_STMT@15..25
|
||||
CAST_EXPR@15..24
|
||||
LITERAL@15..17
|
||||
INT_NUMBER@15..17 "82"
|
||||
WHITESPACE@17..18 " "
|
||||
AS_KW@18..20 "as"
|
||||
WHITESPACE@20..21 " "
|
||||
PATH_TYPE@21..24
|
||||
PATH@21..24
|
||||
PATH_SEGMENT@21..24
|
||||
NAME_REF@21..24
|
||||
IDENT@21..24 "i32"
|
||||
SEMICOLON@24..25 ";"
|
||||
WHITESPACE@25..30 "\n "
|
||||
EXPR_STMT@30..43
|
||||
BIN_EXPR@30..42
|
||||
CAST_EXPR@30..38
|
||||
LITERAL@30..32
|
||||
INT_NUMBER@30..32 "81"
|
||||
WHITESPACE@32..33 " "
|
||||
AS_KW@33..35 "as"
|
||||
WHITESPACE@35..36 " "
|
||||
PATH_TYPE@36..38
|
||||
PATH@36..38
|
||||
PATH_SEGMENT@36..38
|
||||
NAME_REF@36..38
|
||||
IDENT@36..38 "i8"
|
||||
WHITESPACE@38..39 " "
|
||||
PLUS@39..40 "+"
|
||||
WHITESPACE@40..41 " "
|
||||
LITERAL@41..42
|
||||
INT_NUMBER@41..42 "1"
|
||||
SEMICOLON@42..43 ";"
|
||||
WHITESPACE@43..48 "\n "
|
||||
EXPR_STMT@48..62
|
||||
BIN_EXPR@48..61
|
||||
CAST_EXPR@48..57
|
||||
LITERAL@48..50
|
||||
INT_NUMBER@48..50 "79"
|
||||
WHITESPACE@50..51 " "
|
||||
AS_KW@51..53 "as"
|
||||
WHITESPACE@53..54 " "
|
||||
PATH_TYPE@54..57
|
||||
PATH@54..57
|
||||
PATH_SEGMENT@54..57
|
||||
NAME_REF@54..57
|
||||
IDENT@54..57 "i16"
|
||||
WHITESPACE@57..58 " "
|
||||
MINUS@58..59 "-"
|
||||
WHITESPACE@59..60 " "
|
||||
LITERAL@60..61
|
||||
INT_NUMBER@60..61 "1"
|
||||
SEMICOLON@61..62 ";"
|
||||
WHITESPACE@62..67 "\n "
|
||||
EXPR_STMT@67..86
|
||||
BIN_EXPR@67..85
|
||||
CAST_EXPR@67..77
|
||||
LITERAL@67..71
|
||||
INT_NUMBER@67..71 "0x36"
|
||||
WHITESPACE@71..72 " "
|
||||
AS_KW@72..74 "as"
|
||||
WHITESPACE@74..75 " "
|
||||
PATH_TYPE@75..77
|
||||
PATH@75..77
|
||||
PATH_SEGMENT@75..77
|
||||
NAME_REF@75..77
|
||||
IDENT@75..77 "u8"
|
||||
WHITESPACE@77..78 " "
|
||||
LTEQ@78..80 "<="
|
||||
WHITESPACE@80..81 " "
|
||||
LITERAL@81..85
|
||||
INT_NUMBER@81..85 "0x37"
|
||||
SEMICOLON@85..86 ";"
|
||||
WHITESPACE@86..87 "\n"
|
||||
R_CURLY@87..88 "}"
|
||||
WHITESPACE@88..89 "\n"
|
||||
|
@ -9,37 +9,39 @@ SOURCE_FILE@0..197
|
||||
R_PAREN@7..8 ")"
|
||||
WHITESPACE@8..9 " "
|
||||
BLOCK_EXPR@9..37
|
||||
L_CURLY@9..10 "{"
|
||||
WHITESPACE@10..11 " "
|
||||
IF_EXPR@11..35
|
||||
IF_KW@11..13 "if"
|
||||
WHITESPACE@13..14 " "
|
||||
CONDITION@14..32
|
||||
LET_KW@14..17 "let"
|
||||
WHITESPACE@17..18 " "
|
||||
TUPLE_STRUCT_PAT@18..25
|
||||
PATH@18..22
|
||||
PATH_SEGMENT@18..22
|
||||
NAME_REF@18..22
|
||||
IDENT@18..22 "Some"
|
||||
L_PAREN@22..23 "("
|
||||
WILDCARD_PAT@23..24
|
||||
UNDERSCORE@23..24 "_"
|
||||
R_PAREN@24..25 ")"
|
||||
WHITESPACE@25..26 " "
|
||||
EQ@26..27 "="
|
||||
WHITESPACE@27..28 " "
|
||||
PATH_EXPR@28..32
|
||||
PATH@28..32
|
||||
PATH_SEGMENT@28..32
|
||||
NAME_REF@28..32
|
||||
IDENT@28..32 "None"
|
||||
WHITESPACE@32..33 " "
|
||||
BLOCK_EXPR@33..35
|
||||
L_CURLY@33..34 "{"
|
||||
R_CURLY@34..35 "}"
|
||||
WHITESPACE@35..36 " "
|
||||
R_CURLY@36..37 "}"
|
||||
STMT_LIST@9..37
|
||||
L_CURLY@9..10 "{"
|
||||
WHITESPACE@10..11 " "
|
||||
IF_EXPR@11..35
|
||||
IF_KW@11..13 "if"
|
||||
WHITESPACE@13..14 " "
|
||||
CONDITION@14..32
|
||||
LET_KW@14..17 "let"
|
||||
WHITESPACE@17..18 " "
|
||||
TUPLE_STRUCT_PAT@18..25
|
||||
PATH@18..22
|
||||
PATH_SEGMENT@18..22
|
||||
NAME_REF@18..22
|
||||
IDENT@18..22 "Some"
|
||||
L_PAREN@22..23 "("
|
||||
WILDCARD_PAT@23..24
|
||||
UNDERSCORE@23..24 "_"
|
||||
R_PAREN@24..25 ")"
|
||||
WHITESPACE@25..26 " "
|
||||
EQ@26..27 "="
|
||||
WHITESPACE@27..28 " "
|
||||
PATH_EXPR@28..32
|
||||
PATH@28..32
|
||||
PATH_SEGMENT@28..32
|
||||
NAME_REF@28..32
|
||||
IDENT@28..32 "None"
|
||||
WHITESPACE@32..33 " "
|
||||
BLOCK_EXPR@33..35
|
||||
STMT_LIST@33..35
|
||||
L_CURLY@33..34 "{"
|
||||
R_CURLY@34..35 "}"
|
||||
WHITESPACE@35..36 " "
|
||||
R_CURLY@36..37 "}"
|
||||
WHITESPACE@37..38 "\n"
|
||||
FN@38..196
|
||||
FN_KW@38..40 "fn"
|
||||
@ -51,152 +53,157 @@ SOURCE_FILE@0..197
|
||||
R_PAREN@45..46 ")"
|
||||
WHITESPACE@46..47 " "
|
||||
BLOCK_EXPR@47..196
|
||||
L_CURLY@47..48 "{"
|
||||
WHITESPACE@48..53 "\n "
|
||||
EXPR_STMT@53..87
|
||||
IF_EXPR@53..87
|
||||
IF_KW@53..55 "if"
|
||||
WHITESPACE@55..56 " "
|
||||
CONDITION@56..84
|
||||
LET_KW@56..59 "let"
|
||||
WHITESPACE@59..60 " "
|
||||
OR_PAT@60..77
|
||||
TUPLE_STRUCT_PAT@60..67
|
||||
PATH@60..64
|
||||
PATH_SEGMENT@60..64
|
||||
NAME_REF@60..64
|
||||
IDENT@60..64 "Some"
|
||||
L_PAREN@64..65 "("
|
||||
WILDCARD_PAT@65..66
|
||||
UNDERSCORE@65..66 "_"
|
||||
R_PAREN@66..67 ")"
|
||||
WHITESPACE@67..68 " "
|
||||
PIPE@68..69 "|"
|
||||
WHITESPACE@69..70 " "
|
||||
TUPLE_STRUCT_PAT@70..77
|
||||
PATH@70..74
|
||||
PATH_SEGMENT@70..74
|
||||
NAME_REF@70..74
|
||||
IDENT@70..74 "Some"
|
||||
L_PAREN@74..75 "("
|
||||
WILDCARD_PAT@75..76
|
||||
UNDERSCORE@75..76 "_"
|
||||
R_PAREN@76..77 ")"
|
||||
WHITESPACE@77..78 " "
|
||||
EQ@78..79 "="
|
||||
WHITESPACE@79..80 " "
|
||||
PATH_EXPR@80..84
|
||||
PATH@80..84
|
||||
PATH_SEGMENT@80..84
|
||||
NAME_REF@80..84
|
||||
IDENT@80..84 "None"
|
||||
WHITESPACE@84..85 " "
|
||||
BLOCK_EXPR@85..87
|
||||
L_CURLY@85..86 "{"
|
||||
R_CURLY@86..87 "}"
|
||||
WHITESPACE@87..92 "\n "
|
||||
EXPR_STMT@92..118
|
||||
IF_EXPR@92..118
|
||||
IF_KW@92..94 "if"
|
||||
WHITESPACE@94..95 " "
|
||||
CONDITION@95..115
|
||||
LET_KW@95..98 "let"
|
||||
WHITESPACE@98..99 " "
|
||||
PIPE@99..100 "|"
|
||||
WHITESPACE@100..101 " "
|
||||
TUPLE_STRUCT_PAT@101..108
|
||||
PATH@101..105
|
||||
PATH_SEGMENT@101..105
|
||||
NAME_REF@101..105
|
||||
IDENT@101..105 "Some"
|
||||
L_PAREN@105..106 "("
|
||||
WILDCARD_PAT@106..107
|
||||
UNDERSCORE@106..107 "_"
|
||||
R_PAREN@107..108 ")"
|
||||
WHITESPACE@108..109 " "
|
||||
EQ@109..110 "="
|
||||
WHITESPACE@110..111 " "
|
||||
PATH_EXPR@111..115
|
||||
PATH@111..115
|
||||
PATH_SEGMENT@111..115
|
||||
NAME_REF@111..115
|
||||
IDENT@111..115 "None"
|
||||
WHITESPACE@115..116 " "
|
||||
BLOCK_EXPR@116..118
|
||||
L_CURLY@116..117 "{"
|
||||
R_CURLY@117..118 "}"
|
||||
WHITESPACE@118..123 "\n "
|
||||
EXPR_STMT@123..160
|
||||
WHILE_EXPR@123..160
|
||||
WHILE_KW@123..128 "while"
|
||||
WHITESPACE@128..129 " "
|
||||
CONDITION@129..157
|
||||
LET_KW@129..132 "let"
|
||||
WHITESPACE@132..133 " "
|
||||
OR_PAT@133..150
|
||||
TUPLE_STRUCT_PAT@133..140
|
||||
PATH@133..137
|
||||
PATH_SEGMENT@133..137
|
||||
NAME_REF@133..137
|
||||
IDENT@133..137 "Some"
|
||||
L_PAREN@137..138 "("
|
||||
WILDCARD_PAT@138..139
|
||||
UNDERSCORE@138..139 "_"
|
||||
R_PAREN@139..140 ")"
|
||||
WHITESPACE@140..141 " "
|
||||
PIPE@141..142 "|"
|
||||
WHITESPACE@142..143 " "
|
||||
TUPLE_STRUCT_PAT@143..150
|
||||
PATH@143..147
|
||||
PATH_SEGMENT@143..147
|
||||
NAME_REF@143..147
|
||||
IDENT@143..147 "Some"
|
||||
L_PAREN@147..148 "("
|
||||
WILDCARD_PAT@148..149
|
||||
UNDERSCORE@148..149 "_"
|
||||
R_PAREN@149..150 ")"
|
||||
WHITESPACE@150..151 " "
|
||||
EQ@151..152 "="
|
||||
WHITESPACE@152..153 " "
|
||||
PATH_EXPR@153..157
|
||||
PATH@153..157
|
||||
PATH_SEGMENT@153..157
|
||||
NAME_REF@153..157
|
||||
IDENT@153..157 "None"
|
||||
WHITESPACE@157..158 " "
|
||||
BLOCK_EXPR@158..160
|
||||
L_CURLY@158..159 "{"
|
||||
R_CURLY@159..160 "}"
|
||||
WHITESPACE@160..165 "\n "
|
||||
WHILE_EXPR@165..194
|
||||
WHILE_KW@165..170 "while"
|
||||
WHITESPACE@170..171 " "
|
||||
CONDITION@171..191
|
||||
LET_KW@171..174 "let"
|
||||
WHITESPACE@174..175 " "
|
||||
PIPE@175..176 "|"
|
||||
WHITESPACE@176..177 " "
|
||||
TUPLE_STRUCT_PAT@177..184
|
||||
PATH@177..181
|
||||
PATH_SEGMENT@177..181
|
||||
NAME_REF@177..181
|
||||
IDENT@177..181 "Some"
|
||||
L_PAREN@181..182 "("
|
||||
WILDCARD_PAT@182..183
|
||||
UNDERSCORE@182..183 "_"
|
||||
R_PAREN@183..184 ")"
|
||||
WHITESPACE@184..185 " "
|
||||
EQ@185..186 "="
|
||||
WHITESPACE@186..187 " "
|
||||
PATH_EXPR@187..191
|
||||
PATH@187..191
|
||||
PATH_SEGMENT@187..191
|
||||
NAME_REF@187..191
|
||||
IDENT@187..191 "None"
|
||||
WHITESPACE@191..192 " "
|
||||
BLOCK_EXPR@192..194
|
||||
L_CURLY@192..193 "{"
|
||||
R_CURLY@193..194 "}"
|
||||
WHITESPACE@194..195 "\n"
|
||||
R_CURLY@195..196 "}"
|
||||
STMT_LIST@47..196
|
||||
L_CURLY@47..48 "{"
|
||||
WHITESPACE@48..53 "\n "
|
||||
EXPR_STMT@53..87
|
||||
IF_EXPR@53..87
|
||||
IF_KW@53..55 "if"
|
||||
WHITESPACE@55..56 " "
|
||||
CONDITION@56..84
|
||||
LET_KW@56..59 "let"
|
||||
WHITESPACE@59..60 " "
|
||||
OR_PAT@60..77
|
||||
TUPLE_STRUCT_PAT@60..67
|
||||
PATH@60..64
|
||||
PATH_SEGMENT@60..64
|
||||
NAME_REF@60..64
|
||||
IDENT@60..64 "Some"
|
||||
L_PAREN@64..65 "("
|
||||
WILDCARD_PAT@65..66
|
||||
UNDERSCORE@65..66 "_"
|
||||
R_PAREN@66..67 ")"
|
||||
WHITESPACE@67..68 " "
|
||||
PIPE@68..69 "|"
|
||||
WHITESPACE@69..70 " "
|
||||
TUPLE_STRUCT_PAT@70..77
|
||||
PATH@70..74
|
||||
PATH_SEGMENT@70..74
|
||||
NAME_REF@70..74
|
||||
IDENT@70..74 "Some"
|
||||
L_PAREN@74..75 "("
|
||||
WILDCARD_PAT@75..76
|
||||
UNDERSCORE@75..76 "_"
|
||||
R_PAREN@76..77 ")"
|
||||
WHITESPACE@77..78 " "
|
||||
EQ@78..79 "="
|
||||
WHITESPACE@79..80 " "
|
||||
PATH_EXPR@80..84
|
||||
PATH@80..84
|
||||
PATH_SEGMENT@80..84
|
||||
NAME_REF@80..84
|
||||
IDENT@80..84 "None"
|
||||
WHITESPACE@84..85 " "
|
||||
BLOCK_EXPR@85..87
|
||||
STMT_LIST@85..87
|
||||
L_CURLY@85..86 "{"
|
||||
R_CURLY@86..87 "}"
|
||||
WHITESPACE@87..92 "\n "
|
||||
EXPR_STMT@92..118
|
||||
IF_EXPR@92..118
|
||||
IF_KW@92..94 "if"
|
||||
WHITESPACE@94..95 " "
|
||||
CONDITION@95..115
|
||||
LET_KW@95..98 "let"
|
||||
WHITESPACE@98..99 " "
|
||||
PIPE@99..100 "|"
|
||||
WHITESPACE@100..101 " "
|
||||
TUPLE_STRUCT_PAT@101..108
|
||||
PATH@101..105
|
||||
PATH_SEGMENT@101..105
|
||||
NAME_REF@101..105
|
||||
IDENT@101..105 "Some"
|
||||
L_PAREN@105..106 "("
|
||||
WILDCARD_PAT@106..107
|
||||
UNDERSCORE@106..107 "_"
|
||||
R_PAREN@107..108 ")"
|
||||
WHITESPACE@108..109 " "
|
||||
EQ@109..110 "="
|
||||
WHITESPACE@110..111 " "
|
||||
PATH_EXPR@111..115
|
||||
PATH@111..115
|
||||
PATH_SEGMENT@111..115
|
||||
NAME_REF@111..115
|
||||
IDENT@111..115 "None"
|
||||
WHITESPACE@115..116 " "
|
||||
BLOCK_EXPR@116..118
|
||||
STMT_LIST@116..118
|
||||
L_CURLY@116..117 "{"
|
||||
R_CURLY@117..118 "}"
|
||||
WHITESPACE@118..123 "\n "
|
||||
EXPR_STMT@123..160
|
||||
WHILE_EXPR@123..160
|
||||
WHILE_KW@123..128 "while"
|
||||
WHITESPACE@128..129 " "
|
||||
CONDITION@129..157
|
||||
LET_KW@129..132 "let"
|
||||
WHITESPACE@132..133 " "
|
||||
OR_PAT@133..150
|
||||
TUPLE_STRUCT_PAT@133..140
|
||||
PATH@133..137
|
||||
PATH_SEGMENT@133..137
|
||||
NAME_REF@133..137
|
||||
IDENT@133..137 "Some"
|
||||
L_PAREN@137..138 "("
|
||||
WILDCARD_PAT@138..139
|
||||
UNDERSCORE@138..139 "_"
|
||||
R_PAREN@139..140 ")"
|
||||
WHITESPACE@140..141 " "
|
||||
PIPE@141..142 "|"
|
||||
WHITESPACE@142..143 " "
|
||||
TUPLE_STRUCT_PAT@143..150
|
||||
PATH@143..147
|
||||
PATH_SEGMENT@143..147
|
||||
NAME_REF@143..147
|
||||
IDENT@143..147 "Some"
|
||||
L_PAREN@147..148 "("
|
||||
WILDCARD_PAT@148..149
|
||||
UNDERSCORE@148..149 "_"
|
||||
R_PAREN@149..150 ")"
|
||||
WHITESPACE@150..151 " "
|
||||
EQ@151..152 "="
|
||||
WHITESPACE@152..153 " "
|
||||
PATH_EXPR@153..157
|
||||
PATH@153..157
|
||||
PATH_SEGMENT@153..157
|
||||
NAME_REF@153..157
|
||||
IDENT@153..157 "None"
|
||||
WHITESPACE@157..158 " "
|
||||
BLOCK_EXPR@158..160
|
||||
STMT_LIST@158..160
|
||||
L_CURLY@158..159 "{"
|
||||
R_CURLY@159..160 "}"
|
||||
WHITESPACE@160..165 "\n "
|
||||
WHILE_EXPR@165..194
|
||||
WHILE_KW@165..170 "while"
|
||||
WHITESPACE@170..171 " "
|
||||
CONDITION@171..191
|
||||
LET_KW@171..174 "let"
|
||||
WHITESPACE@174..175 " "
|
||||
PIPE@175..176 "|"
|
||||
WHITESPACE@176..177 " "
|
||||
TUPLE_STRUCT_PAT@177..184
|
||||
PATH@177..181
|
||||
PATH_SEGMENT@177..181
|
||||
NAME_REF@177..181
|
||||
IDENT@177..181 "Some"
|
||||
L_PAREN@181..182 "("
|
||||
WILDCARD_PAT@182..183
|
||||
UNDERSCORE@182..183 "_"
|
||||
R_PAREN@183..184 ")"
|
||||
WHITESPACE@184..185 " "
|
||||
EQ@185..186 "="
|
||||
WHITESPACE@186..187 " "
|
||||
PATH_EXPR@187..191
|
||||
PATH@187..191
|
||||
PATH_SEGMENT@187..191
|
||||
NAME_REF@187..191
|
||||
IDENT@187..191 "None"
|
||||
WHITESPACE@191..192 " "
|
||||
BLOCK_EXPR@192..194
|
||||
STMT_LIST@192..194
|
||||
L_CURLY@192..193 "{"
|
||||
R_CURLY@193..194 "}"
|
||||
WHITESPACE@194..195 "\n"
|
||||
R_CURLY@195..196 "}"
|
||||
WHITESPACE@196..197 "\n"
|
||||
|
@ -9,76 +9,81 @@ SOURCE_FILE@0..93
|
||||
R_PAREN@7..8 ")"
|
||||
WHITESPACE@8..9 " "
|
||||
BLOCK_EXPR@9..92
|
||||
L_CURLY@9..10 "{"
|
||||
WHITESPACE@10..15 "\n "
|
||||
EXPR_STMT@15..29
|
||||
WHILE_EXPR@15..28
|
||||
WHILE_KW@15..20 "while"
|
||||
WHITESPACE@20..21 " "
|
||||
CONDITION@21..25
|
||||
LITERAL@21..25
|
||||
TRUE_KW@21..25 "true"
|
||||
WHITESPACE@25..26 " "
|
||||
BLOCK_EXPR@26..28
|
||||
L_CURLY@26..27 "{"
|
||||
R_CURLY@27..28 "}"
|
||||
SEMICOLON@28..29 ";"
|
||||
WHITESPACE@29..34 "\n "
|
||||
EXPR_STMT@34..67
|
||||
WHILE_EXPR@34..66
|
||||
WHILE_KW@34..39 "while"
|
||||
WHITESPACE@39..40 " "
|
||||
CONDITION@40..63
|
||||
LET_KW@40..43 "let"
|
||||
WHITESPACE@43..44 " "
|
||||
TUPLE_STRUCT_PAT@44..51
|
||||
PATH@44..48
|
||||
PATH_SEGMENT@44..48
|
||||
NAME_REF@44..48
|
||||
IDENT@44..48 "Some"
|
||||
L_PAREN@48..49 "("
|
||||
IDENT_PAT@49..50
|
||||
NAME@49..50
|
||||
IDENT@49..50 "x"
|
||||
R_PAREN@50..51 ")"
|
||||
WHITESPACE@51..52 " "
|
||||
EQ@52..53 "="
|
||||
WHITESPACE@53..54 " "
|
||||
METHOD_CALL_EXPR@54..63
|
||||
PATH_EXPR@54..56
|
||||
PATH@54..56
|
||||
PATH_SEGMENT@54..56
|
||||
NAME_REF@54..56
|
||||
IDENT@54..56 "it"
|
||||
DOT@56..57 "."
|
||||
NAME_REF@57..61
|
||||
IDENT@57..61 "next"
|
||||
ARG_LIST@61..63
|
||||
L_PAREN@61..62 "("
|
||||
R_PAREN@62..63 ")"
|
||||
WHITESPACE@63..64 " "
|
||||
BLOCK_EXPR@64..66
|
||||
L_CURLY@64..65 "{"
|
||||
R_CURLY@65..66 "}"
|
||||
SEMICOLON@66..67 ";"
|
||||
WHITESPACE@67..72 "\n "
|
||||
EXPR_STMT@72..90
|
||||
WHILE_EXPR@72..89
|
||||
WHILE_KW@72..77 "while"
|
||||
WHITESPACE@77..78 " "
|
||||
CONDITION@78..86
|
||||
BLOCK_EXPR@78..86
|
||||
L_CURLY@78..79 "{"
|
||||
WHITESPACE@79..80 " "
|
||||
LITERAL@80..84
|
||||
TRUE_KW@80..84 "true"
|
||||
WHITESPACE@84..85 " "
|
||||
R_CURLY@85..86 "}"
|
||||
WHITESPACE@86..87 " "
|
||||
BLOCK_EXPR@87..89
|
||||
L_CURLY@87..88 "{"
|
||||
R_CURLY@88..89 "}"
|
||||
SEMICOLON@89..90 ";"
|
||||
WHITESPACE@90..91 "\n"
|
||||
R_CURLY@91..92 "}"
|
||||
STMT_LIST@9..92
|
||||
L_CURLY@9..10 "{"
|
||||
WHITESPACE@10..15 "\n "
|
||||
EXPR_STMT@15..29
|
||||
WHILE_EXPR@15..28
|
||||
WHILE_KW@15..20 "while"
|
||||
WHITESPACE@20..21 " "
|
||||
CONDITION@21..25
|
||||
LITERAL@21..25
|
||||
TRUE_KW@21..25 "true"
|
||||
WHITESPACE@25..26 " "
|
||||
BLOCK_EXPR@26..28
|
||||
STMT_LIST@26..28
|
||||
L_CURLY@26..27 "{"
|
||||
R_CURLY@27..28 "}"
|
||||
SEMICOLON@28..29 ";"
|
||||
WHITESPACE@29..34 "\n "
|
||||
EXPR_STMT@34..67
|
||||
WHILE_EXPR@34..66
|
||||
WHILE_KW@34..39 "while"
|
||||
WHITESPACE@39..40 " "
|
||||
CONDITION@40..63
|
||||
LET_KW@40..43 "let"
|
||||
WHITESPACE@43..44 " "
|
||||
TUPLE_STRUCT_PAT@44..51
|
||||
PATH@44..48
|
||||
PATH_SEGMENT@44..48
|
||||
NAME_REF@44..48
|
||||
IDENT@44..48 "Some"
|
||||
L_PAREN@48..49 "("
|
||||
IDENT_PAT@49..50
|
||||
NAME@49..50
|
||||
IDENT@49..50 "x"
|
||||
R_PAREN@50..51 ")"
|
||||
WHITESPACE@51..52 " "
|
||||
EQ@52..53 "="
|
||||
WHITESPACE@53..54 " "
|
||||
METHOD_CALL_EXPR@54..63
|
||||
PATH_EXPR@54..56
|
||||
PATH@54..56
|
||||
PATH_SEGMENT@54..56
|
||||
NAME_REF@54..56
|
||||
IDENT@54..56 "it"
|
||||
DOT@56..57 "."
|
||||
NAME_REF@57..61
|
||||
IDENT@57..61 "next"
|
||||
ARG_LIST@61..63
|
||||
L_PAREN@61..62 "("
|
||||
R_PAREN@62..63 ")"
|
||||
WHITESPACE@63..64 " "
|
||||
BLOCK_EXPR@64..66
|
||||
STMT_LIST@64..66
|
||||
L_CURLY@64..65 "{"
|
||||
R_CURLY@65..66 "}"
|
||||
SEMICOLON@66..67 ";"
|
||||
WHITESPACE@67..72 "\n "
|
||||
EXPR_STMT@72..90
|
||||
WHILE_EXPR@72..89
|
||||
WHILE_KW@72..77 "while"
|
||||
WHITESPACE@77..78 " "
|
||||
CONDITION@78..86
|
||||
BLOCK_EXPR@78..86
|
||||
STMT_LIST@78..86
|
||||
L_CURLY@78..79 "{"
|
||||
WHITESPACE@79..80 " "
|
||||
LITERAL@80..84
|
||||
TRUE_KW@80..84 "true"
|
||||
WHITESPACE@84..85 " "
|
||||
R_CURLY@85..86 "}"
|
||||
WHITESPACE@86..87 " "
|
||||
BLOCK_EXPR@87..89
|
||||
STMT_LIST@87..89
|
||||
L_CURLY@87..88 "{"
|
||||
R_CURLY@88..89 "}"
|
||||
SEMICOLON@89..90 ";"
|
||||
WHITESPACE@90..91 "\n"
|
||||
R_CURLY@91..92 "}"
|
||||
WHITESPACE@92..93 "\n"
|
||||
|
@ -9,47 +9,49 @@ SOURCE_FILE@0..102
|
||||
R_PAREN@7..8 ")"
|
||||
WHITESPACE@8..9 " "
|
||||
BLOCK_EXPR@9..101
|
||||
L_CURLY@9..10 "{"
|
||||
WHITESPACE@10..15 "\n "
|
||||
LOOP_EXPR@15..99
|
||||
LOOP_KW@15..19 "loop"
|
||||
WHITESPACE@19..20 " "
|
||||
BLOCK_EXPR@20..99
|
||||
L_CURLY@20..21 "{"
|
||||
WHITESPACE@21..30 "\n "
|
||||
EXPR_STMT@30..36
|
||||
BREAK_EXPR@30..35
|
||||
BREAK_KW@30..35 "break"
|
||||
SEMICOLON@35..36 ";"
|
||||
WHITESPACE@36..45 "\n "
|
||||
EXPR_STMT@45..54
|
||||
BREAK_EXPR@45..53
|
||||
BREAK_KW@45..50 "break"
|
||||
WHITESPACE@50..51 " "
|
||||
LIFETIME@51..53
|
||||
LIFETIME_IDENT@51..53 "'l"
|
||||
SEMICOLON@53..54 ";"
|
||||
WHITESPACE@54..63 "\n "
|
||||
EXPR_STMT@63..72
|
||||
BREAK_EXPR@63..71
|
||||
BREAK_KW@63..68 "break"
|
||||
WHITESPACE@68..69 " "
|
||||
LITERAL@69..71
|
||||
INT_NUMBER@69..71 "92"
|
||||
SEMICOLON@71..72 ";"
|
||||
WHITESPACE@72..81 "\n "
|
||||
EXPR_STMT@81..93
|
||||
BREAK_EXPR@81..92
|
||||
BREAK_KW@81..86 "break"
|
||||
WHITESPACE@86..87 " "
|
||||
LIFETIME@87..89
|
||||
LIFETIME_IDENT@87..89 "'l"
|
||||
WHITESPACE@89..90 " "
|
||||
LITERAL@90..92
|
||||
INT_NUMBER@90..92 "92"
|
||||
SEMICOLON@92..93 ";"
|
||||
WHITESPACE@93..98 "\n "
|
||||
R_CURLY@98..99 "}"
|
||||
WHITESPACE@99..100 "\n"
|
||||
R_CURLY@100..101 "}"
|
||||
STMT_LIST@9..101
|
||||
L_CURLY@9..10 "{"
|
||||
WHITESPACE@10..15 "\n "
|
||||
LOOP_EXPR@15..99
|
||||
LOOP_KW@15..19 "loop"
|
||||
WHITESPACE@19..20 " "
|
||||
BLOCK_EXPR@20..99
|
||||
STMT_LIST@20..99
|
||||
L_CURLY@20..21 "{"
|
||||
WHITESPACE@21..30 "\n "
|
||||
EXPR_STMT@30..36
|
||||
BREAK_EXPR@30..35
|
||||
BREAK_KW@30..35 "break"
|
||||
SEMICOLON@35..36 ";"
|
||||
WHITESPACE@36..45 "\n "
|
||||
EXPR_STMT@45..54
|
||||
BREAK_EXPR@45..53
|
||||
BREAK_KW@45..50 "break"
|
||||
WHITESPACE@50..51 " "
|
||||
LIFETIME@51..53
|
||||
LIFETIME_IDENT@51..53 "'l"
|
||||
SEMICOLON@53..54 ";"
|
||||
WHITESPACE@54..63 "\n "
|
||||
EXPR_STMT@63..72
|
||||
BREAK_EXPR@63..71
|
||||
BREAK_KW@63..68 "break"
|
||||
WHITESPACE@68..69 " "
|
||||
LITERAL@69..71
|
||||
INT_NUMBER@69..71 "92"
|
||||
SEMICOLON@71..72 ";"
|
||||
WHITESPACE@72..81 "\n "
|
||||
EXPR_STMT@81..93
|
||||
BREAK_EXPR@81..92
|
||||
BREAK_KW@81..86 "break"
|
||||
WHITESPACE@86..87 " "
|
||||
LIFETIME@87..89
|
||||
LIFETIME_IDENT@87..89 "'l"
|
||||
WHITESPACE@89..90 " "
|
||||
LITERAL@90..92
|
||||
INT_NUMBER@90..92 "92"
|
||||
SEMICOLON@92..93 ";"
|
||||
WHITESPACE@93..98 "\n "
|
||||
R_CURLY@98..99 "}"
|
||||
WHITESPACE@99..100 "\n"
|
||||
R_CURLY@100..101 "}"
|
||||
WHITESPACE@101..102 "\n"
|
||||
|
@ -42,37 +42,38 @@ SOURCE_FILE@0..71
|
||||
R_PAREN@34..35 ")"
|
||||
WHITESPACE@35..36 " "
|
||||
BLOCK_EXPR@36..70
|
||||
L_CURLY@36..37 "{"
|
||||
WHITESPACE@37..38 " "
|
||||
EXPR_STMT@38..68
|
||||
CALL_EXPR@38..67
|
||||
PATH_EXPR@38..65
|
||||
PATH@38..65
|
||||
PATH@38..56
|
||||
PATH_SEGMENT@38..56
|
||||
L_ANGLE@38..39 "<"
|
||||
PATH_TYPE@39..44
|
||||
PATH@39..44
|
||||
PATH_SEGMENT@39..44
|
||||
NAME_REF@39..44
|
||||
IDENT@39..44 "usize"
|
||||
WHITESPACE@44..45 " "
|
||||
AS_KW@45..47 "as"
|
||||
WHITESPACE@47..48 " "
|
||||
PATH_TYPE@48..55
|
||||
PATH@48..55
|
||||
PATH_SEGMENT@48..55
|
||||
NAME_REF@48..55
|
||||
IDENT@48..55 "Default"
|
||||
R_ANGLE@55..56 ">"
|
||||
COLON2@56..58 "::"
|
||||
PATH_SEGMENT@58..65
|
||||
NAME_REF@58..65
|
||||
IDENT@58..65 "default"
|
||||
ARG_LIST@65..67
|
||||
L_PAREN@65..66 "("
|
||||
R_PAREN@66..67 ")"
|
||||
SEMICOLON@67..68 ";"
|
||||
WHITESPACE@68..69 " "
|
||||
R_CURLY@69..70 "}"
|
||||
STMT_LIST@36..70
|
||||
L_CURLY@36..37 "{"
|
||||
WHITESPACE@37..38 " "
|
||||
EXPR_STMT@38..68
|
||||
CALL_EXPR@38..67
|
||||
PATH_EXPR@38..65
|
||||
PATH@38..65
|
||||
PATH@38..56
|
||||
PATH_SEGMENT@38..56
|
||||
L_ANGLE@38..39 "<"
|
||||
PATH_TYPE@39..44
|
||||
PATH@39..44
|
||||
PATH_SEGMENT@39..44
|
||||
NAME_REF@39..44
|
||||
IDENT@39..44 "usize"
|
||||
WHITESPACE@44..45 " "
|
||||
AS_KW@45..47 "as"
|
||||
WHITESPACE@47..48 " "
|
||||
PATH_TYPE@48..55
|
||||
PATH@48..55
|
||||
PATH_SEGMENT@48..55
|
||||
NAME_REF@48..55
|
||||
IDENT@48..55 "Default"
|
||||
R_ANGLE@55..56 ">"
|
||||
COLON2@56..58 "::"
|
||||
PATH_SEGMENT@58..65
|
||||
NAME_REF@58..65
|
||||
IDENT@58..65 "default"
|
||||
ARG_LIST@65..67
|
||||
L_PAREN@65..66 "("
|
||||
R_PAREN@66..67 ")"
|
||||
SEMICOLON@67..68 ";"
|
||||
WHITESPACE@68..69 " "
|
||||
R_CURLY@69..70 "}"
|
||||
WHITESPACE@70..71 "\n"
|
||||
|
@ -9,20 +9,21 @@ SOURCE_FILE@0..21
|
||||
R_PAREN@7..8 ")"
|
||||
WHITESPACE@8..9 " "
|
||||
BLOCK_EXPR@9..20
|
||||
L_CURLY@9..10 "{"
|
||||
WHITESPACE@10..11 " "
|
||||
EXPR_STMT@11..18
|
||||
INDEX_EXPR@11..17
|
||||
PATH_EXPR@11..13
|
||||
PATH@11..13
|
||||
PATH_SEGMENT@11..13
|
||||
NAME_REF@11..13
|
||||
IDENT@11..13 "xs"
|
||||
L_BRACK@13..14 "["
|
||||
RANGE_EXPR@14..16
|
||||
DOT2@14..16 ".."
|
||||
R_BRACK@16..17 "]"
|
||||
SEMICOLON@17..18 ";"
|
||||
WHITESPACE@18..19 " "
|
||||
R_CURLY@19..20 "}"
|
||||
STMT_LIST@9..20
|
||||
L_CURLY@9..10 "{"
|
||||
WHITESPACE@10..11 " "
|
||||
EXPR_STMT@11..18
|
||||
INDEX_EXPR@11..17
|
||||
PATH_EXPR@11..13
|
||||
PATH@11..13
|
||||
PATH_SEGMENT@11..13
|
||||
NAME_REF@11..13
|
||||
IDENT@11..13 "xs"
|
||||
L_BRACK@13..14 "["
|
||||
RANGE_EXPR@14..16
|
||||
DOT2@14..16 ".."
|
||||
R_BRACK@16..17 "]"
|
||||
SEMICOLON@17..18 ";"
|
||||
WHITESPACE@18..19 " "
|
||||
R_CURLY@19..20 "}"
|
||||
WHITESPACE@20..21 "\n"
|
||||
|
@ -12,9 +12,10 @@ SOURCE_FILE@0..71
|
||||
R_PAREN@14..15 ")"
|
||||
WHITESPACE@15..16 " "
|
||||
BLOCK_EXPR@16..19
|
||||
L_CURLY@16..17 "{"
|
||||
WHITESPACE@17..18 " "
|
||||
R_CURLY@18..19 "}"
|
||||
STMT_LIST@16..19
|
||||
L_CURLY@16..17 "{"
|
||||
WHITESPACE@17..18 " "
|
||||
R_CURLY@18..19 "}"
|
||||
WHITESPACE@19..20 "\n"
|
||||
STRUCT@20..49
|
||||
STRUCT_KW@20..26 "struct"
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user