git.delta.rocks / jrsonnet / refs/commits / 26a3b24cc9cf

difftreelog

refactor(rowan-parser) remove intrinsic syntax

Yaroslav Bolyukin2022-12-14parent: #a6892a9.patch.diff
in: master

13 files changed

modifiedcmds/jrsonnet-fmt/src/children.rsdiffbeforeafterboth
--- a/cmds/jrsonnet-fmt/src/children.rs
+++ b/cmds/jrsonnet-fmt/src/children.rs
@@ -3,13 +3,11 @@
 use std::{fmt::Debug, mem};
 
 use jrsonnet_rowan_parser::{
-	nodes::{Trivia, TriviaKind},
-	AstNode, AstToken, SyntaxElement,
-	SyntaxKind::*,
-	SyntaxNode, TS,
+	nodes::{CustomError, Trivia, TriviaKind},
+	AstNode, AstToken, SyntaxElement, SyntaxNode, TS,
 };
 
-pub type ChildTrivia = Vec<Trivia>;
+pub type ChildTrivia = Vec<Result<Trivia, String>>;
 
 /// Node should have no non-trivia tokens before element
 pub fn trivia_before(node: SyntaxNode, end: Option<&SyntaxElement>) -> ChildTrivia {
@@ -20,12 +18,14 @@
 		}
 
 		if let Some(trivia) = item.as_token().cloned().and_then(Trivia::cast) {
-			out.push(trivia);
+			out.push(Ok(trivia));
+		} else if CustomError::can_cast(item.kind()) {
+			out.push(Err(item.to_string()));
 		} else if end.is_none() {
 			break;
 		} else {
 			assert!(
-				TS![, ;].contains(item.kind()) || item.kind() == ERROR,
+				TS![, ;].contains(item.kind()),
 				"silently eaten token: {:?}",
 				item.kind()
 			)
@@ -46,10 +46,12 @@
 	let mut out = Vec::new();
 	for item in iter {
 		if let Some(trivia) = item.as_token().cloned().and_then(Trivia::cast) {
-			out.push(trivia);
+			out.push(Ok(trivia));
+		} else if CustomError::can_cast(item.kind()) {
+			out.push(Err(item.to_string()))
 		} else {
 			assert!(
-				TS![, ;].contains(item.kind()) || item.kind() == ERROR,
+				TS![, ;].contains(item.kind()),
 				"silently eaten token: {:?}",
 				item.kind()
 			)
@@ -74,12 +76,14 @@
 	let mut out = Vec::new();
 	for item in iter.take_while(|i| Some(i) != end) {
 		if let Some(trivia) = item.as_token().cloned().and_then(Trivia::cast) {
-			out.push(trivia);
+			out.push(Ok(trivia));
+		} else if CustomError::can_cast(item.kind()) {
+			out.push(Err(item.to_string()))
 		} else if loose {
 			break;
 		} else {
 			assert!(
-				TS![, ;].contains(item.kind()) || item.kind() == ERROR,
+				TS![, ;].contains(item.kind()),
 				"silently eaten token: {:?}",
 				item.kind()
 			)
@@ -120,11 +124,16 @@
 fn count_newlines_before(tt: &ChildTrivia) -> usize {
 	let mut nl_count = 0;
 	for t in tt {
-		match t.kind() {
-			TriviaKind::Whitespace => {
-				nl_count += t.text().bytes().filter(|b| *b == b'\n').count();
+		match t {
+			Ok(t) => match t.kind() {
+				TriviaKind::Whitespace => {
+					nl_count += t.text().bytes().filter(|b| *b == b'\n').count();
+				}
+				_ => break,
+			},
+			Err(_) => {
+				nl_count += 1;
 			}
-			_ => break,
 		}
 	}
 	nl_count
@@ -132,19 +141,22 @@
 fn count_newlines_after(tt: &ChildTrivia) -> usize {
 	let mut nl_count = 0;
 	for t in tt.iter().rev() {
-		match t.kind() {
-			TriviaKind::Whitespace => {
-				nl_count += t.text().bytes().filter(|b| *b == b'\n').count();
-			}
-			TriviaKind::SingleLineHashComment => {
-				nl_count += 1;
-				break;
-			}
-			TriviaKind::SingleLineSlashComment => {
-				nl_count += 1;
-				break;
-			}
-			_ => {}
+		match t {
+			Ok(t) => match t.kind() {
+				TriviaKind::Whitespace => {
+					nl_count += t.text().bytes().filter(|b| *b == b'\n').count();
+				}
+				TriviaKind::SingleLineHashComment => {
+					nl_count += 1;
+					break;
+				}
+				TriviaKind::SingleLineSlashComment => {
+					nl_count += 1;
+					break;
+				}
+				_ => {}
+			},
+			Err(_) => nl_count += 1,
 		}
 	}
 	nl_count
@@ -187,16 +199,18 @@
 				|| current_child.is_none()
 				|| trivia.text().contains('\n') && !is_single_line_comment
 			{
-				next.push(trivia.clone());
+				next.push(Ok(trivia.clone()));
 				started_next = true;
 			} else {
 				let cur = current_child.as_mut().expect("checked not none");
-				cur.inline_trivia.push(trivia);
+				cur.inline_trivia.push(Ok(trivia));
 				if is_single_line_comment {
 					started_next = true;
 				}
 			}
 			had_some = true;
+		} else if CustomError::can_cast(item.kind()) {
+			next.push(Err(item.to_string()))
 		} else if loose {
 			if had_some {
 				break;
@@ -204,7 +218,7 @@
 			started_next = true;
 		} else {
 			assert!(
-				TS![, ;].contains(item.kind()) || item.kind() == ERROR,
+				TS![, ;].contains(item.kind()),
 				"silently eaten token: {:?}",
 				item.kind()
 			)
modifiedcmds/jrsonnet-fmt/src/comments.rsdiffbeforeafterboth
--- a/cmds/jrsonnet-fmt/src/comments.rs
+++ b/cmds/jrsonnet-fmt/src/comments.rs
@@ -17,6 +17,24 @@
 	let mut pi = p!(new:);
 
 	for c in comments {
+		let Ok(c) = c else {
+			let mut text = c.as_ref().unwrap_err() as &str;
+			while !text.is_empty() {
+				let pos = text.find(|c| c == '\n' || c == '\t').unwrap_or(text.len());
+				let sliced = &text[..pos];
+				p!(pi: string(sliced.to_string()));
+				text = &text[pos..];
+				if! text.is_empty(){
+					match text.as_bytes()[0] {
+						b'\n' => p!(pi: nl),
+						b'\t' => p!(pi: tab),
+						_ => unreachable!()
+					}
+					text = &text[1..];
+				}
+			}
+			continue;
+		};
 		match c.kind() {
 			TriviaKind::Whitespace => {}
 			TriviaKind::MultiLineComment => {
@@ -37,7 +55,7 @@
 				let mut immediate_start = true;
 				let mut lines = text
 					.split('\n')
-					.map(|l| l.trim_end())
+					.map(|l| l.trim_end().to_string())
 					.skip_while(|l| {
 						if l.is_empty() {
 							immediate_start = false;
@@ -51,7 +69,7 @@
 					lines.pop();
 				}
 				if lines.len() == 1 && !doc {
-					p!(pi: str("/* ") str(lines[0].trim()) str(" */") nl)
+					p!(pi: str("/* ") string(lines[0].trim().to_string()) str(" */") nl)
 				} else if !lines.is_empty() {
 					fn common_ws_prefix<'a>(a: &'a str, b: &str) -> &'a str {
 						let offset = a
@@ -62,17 +80,18 @@
 						&a[..offset]
 					}
 					// First line is not empty, extract ws prefix of it
-					let mut common_ws_padding = if immediate_start && lines.len() > 1 {
-						common_ws_prefix(lines[1], lines[1])
+					let mut common_ws_padding = (if immediate_start && lines.len() > 1 {
+						common_ws_prefix(&lines[1], &lines[1])
 					} else {
-						common_ws_prefix(lines[0], lines[0])
-					};
+						common_ws_prefix(&lines[0], &lines[0])
+					})
+					.to_string();
 					for line in lines
 						.iter()
 						.skip(if immediate_start { 2 } else { 1 })
 						.filter(|l| !l.is_empty())
 					{
-						common_ws_padding = common_ws_prefix(common_ws_padding, line);
+						common_ws_padding = common_ws_prefix(&common_ws_padding, line).to_string();
 					}
 					for line in lines
 						.iter_mut()
@@ -80,8 +99,9 @@
 						.filter(|l| !l.is_empty())
 					{
 						*line = line
-							.strip_prefix(common_ws_padding)
-							.expect("all non-empty lines start with this padding");
+							.strip_prefix(&common_ws_padding)
+							.expect("all non-empty lines start with this padding")
+							.to_string();
 					}
 
 					p!(pi: str("/*"));
@@ -105,9 +125,9 @@
 								} else {
 									p!(pi: tab);
 								}
-								line = new_line;
+								line = new_line.to_string();
 							}
-							p!(pi: str(line) nl)
+							p!(pi: string(line.to_string()) nl)
 						}
 					}
 					if doc {
@@ -136,7 +156,7 @@
 				if matches!(loc, CommentLocation::ItemInline) {
 					p!(pi: str(" "))
 				}
-				p!(pi: str("# ") str(c.text().strip_prefix('#').expect("hash comment starts with #").trim()));
+				p!(pi: str("# ") string(c.text().strip_prefix('#').expect("hash comment starts with #").trim().to_string()));
 				if !matches!(loc, CommentLocation::ItemInline) {
 					p!(pi: nl)
 				}
@@ -145,14 +165,14 @@
 				if matches!(loc, CommentLocation::ItemInline) {
 					p!(pi: str(" "))
 				}
-				p!(pi: str("// ") str(c.text().strip_prefix("//").expect("comment starts with //").trim()));
+				p!(pi: str("// ") string(c.text().strip_prefix("//").expect("comment starts with //").trim().to_string()));
 				if !matches!(loc, CommentLocation::ItemInline) {
 					p!(pi: nl)
 				}
 			}
 			// Garbage in - garbage out
 			TriviaKind::ErrorCommentTooShort => p!(pi: str("/*/")),
-			TriviaKind::ErrorCommentUnterminated => p!(pi: str(c.text())),
+			TriviaKind::ErrorCommentUnterminated => p!(pi: string(c.text().to_string())),
 		}
 	}
 
modifiedcmds/jrsonnet-fmt/src/main.rsdiffbeforeafterboth
--- a/cmds/jrsonnet-fmt/src/main.rs
+++ b/cmds/jrsonnet-fmt/src/main.rs
@@ -5,10 +5,11 @@
 use jrsonnet_rowan_parser::{
 	nodes::{
 		ArgsDesc, Assertion, BinaryOperator, Bind, CompSpec, Destruct, DestructArrayPart,
-		DestructRest, Expr, Field, FieldName, ForSpec, IfSpec, ImportKind, LhsExpr, Literal,
-		Member, Name, Number, ObjBody, ObjLocal, ParamsDesc, SliceDesc, SourceFile, Text,
-		UnaryOperator,
+		DestructRest, Expr, FieldName, ForSpec, IfSpec, ImportKind, LhsExpr, Literal, Member, Name,
+		Number, ObjBody, ObjLocal, ParamsDesc, SliceDesc, SourceFile, Text, UnaryOperator,
+		Visibility, VisibilityKind,
 	},
+	rowan::NodeOrToken,
 	AstNode, AstToken, SyntaxToken,
 };
 
@@ -37,6 +38,10 @@
 		$o.push_str($e);
 		pi!(@s; $o: $($t)*);
 	}};
+	(@s; $o:ident: string($e:expr $(,)?) $($t:tt)*) => {{
+		$o.push_string($e);
+		pi!(@s; $o: $($t)*);
+	}};
 	(@s; $o:ident: nl $($t:tt)*) => {{
 		$o.push_signal(dprint_core::formatting::Signal::NewLine);
 		pi!(@s; $o: $($t)*);
@@ -96,8 +101,8 @@
 		if let Some(v) = self {
 			v.print()
 		} else {
-			p!(new: str(
-				&format!(
+			p!(new: string(
+				format!(
 					"/*missing {}*/",
 					type_name::<P>().replace("jrsonnet_rowan_parser::generated::nodes::", "")
 				),
@@ -108,18 +113,18 @@
 
 impl Printable for SyntaxToken {
 	fn print(&self) -> PrintItems {
-		p!(new: str(&self.to_string()))
+		p!(new: string(self.to_string()))
 	}
 }
 
 impl Printable for Text {
 	fn print(&self) -> PrintItems {
-		p!(new: str(&format!("{}", self)))
+		p!(new: string(format!("{}", self)))
 	}
 }
 impl Printable for Number {
 	fn print(&self) -> PrintItems {
-		p!(new: str(&format!("{}", self)))
+		p!(new: string(format!("{}", self)))
 	}
 }
 
@@ -201,22 +206,10 @@
 		}
 	}
 }
-impl Printable for Field {
+
+impl Printable for Visibility {
 	fn print(&self) -> PrintItems {
-		let mut pi = p!(new:);
-		match self {
-			Field::FieldNormal(n) => {
-				p!(pi: {n.field_name()});
-				if n.plus_token().is_some() {
-					p!(pi: str("+"));
-				}
-				p!(pi: str(": ") {n.expr()});
-			}
-			Field::FieldMethod(m) => {
-				p!(pi: {m.field_name()} {m.params_desc()} str(": ") {m.expr()});
-			}
-		}
-		pi
+		p!(new: string(self.to_string()))
 	}
 }
 
@@ -282,10 +275,82 @@
 	}
 }
 
+impl Printable for Member {
+	fn print(&self) -> PrintItems {
+		match self {
+			Member::MemberBindStmt(b) => {
+				p!(new: {b.obj_local()})
+			}
+			Member::MemberAssertStmt(ass) => {
+				p!(new: {ass.assertion()})
+			}
+			Member::MemberFieldNormal(n) => {
+				p!(new: {n.field_name()} if(n.plus_token().is_some())({n.plus_token()}) {n.visibility()} str(" ") {n.expr()})
+			}
+			Member::MemberFieldMethod(_) => todo!(),
+		}
+	}
+}
+
 impl Printable for ObjBody {
 	fn print(&self) -> PrintItems {
 		match self {
-			ObjBody::ObjBodyComp(_) => todo!(),
+			ObjBody::ObjBodyComp(l) => {
+				let mut pi = p!(new: str("{") >i nl);
+				let (children, end_comments) = children_between::<Member>(
+					l.syntax().clone(),
+					l.l_brace_token().map(Into::into).as_ref(),
+					Some(
+						&(l.comp_specs()
+							.next()
+							.expect("at least one spec is defined")
+							.syntax()
+							.clone())
+						.into(),
+					),
+				);
+				for mem in children.into_iter() {
+					if mem.should_start_with_newline {
+						p!(pi: nl);
+					}
+					p!(pi: items(format_comments(&mem.before_trivia, CommentLocation::AboveItem)));
+					p!(pi: {mem.value} str(","));
+					p!(pi: items(format_comments(&mem.inline_trivia, CommentLocation::ItemInline)));
+					p!(pi: nl)
+				}
+
+				if end_comments.should_start_with_newline {
+					p!(pi: nl);
+				}
+				p!(pi: items(format_comments(&end_comments.trivia, CommentLocation::EndOfItems)));
+
+				let (compspecs, end_comments) = children_between::<CompSpec>(
+					l.syntax().clone(),
+					l.member_comps()
+						.last()
+						.map(|m| m.syntax().clone())
+						.map(Into::into)
+						.or_else(|| l.l_brace_token().map(Into::into))
+						.as_ref(),
+					l.r_brace_token().map(Into::into).as_ref(),
+				);
+				for mem in compspecs.into_iter() {
+					if mem.should_start_with_newline {
+						p!(pi: nl);
+					}
+					p!(pi: items(format_comments(&mem.before_trivia, CommentLocation::AboveItem)));
+					p!(pi: {mem.value});
+					p!(pi: items(format_comments(&mem.inline_trivia, CommentLocation::ItemInline)));
+					p!(pi: nl)
+				}
+				if end_comments.should_start_with_newline {
+					p!(pi: nl);
+				}
+				p!(pi: items(format_comments(&end_comments.trivia, CommentLocation::EndOfItems)));
+
+				p!(pi: <i str("}"));
+				pi
+			}
 			ObjBody::ObjBodyMemberList(l) => {
 				let mut pi = p!(new: str("{") >i nl);
 				let (children, end_comments) = children_between::<Member>(
@@ -298,18 +363,7 @@
 						p!(pi: nl);
 					}
 					p!(pi: items(format_comments(&mem.before_trivia, CommentLocation::AboveItem)));
-					match mem.value {
-						Member::MemberBindStmt(b) => {
-							p!(pi: {b.obj_local()})
-						}
-						Member::MemberAssertStmt(ass) => {
-							p!(pi: {ass.assertion()})
-						}
-						Member::MemberField(f) => {
-							p!(pi: {f.field()})
-						}
-					}
-					p!(pi: str(","));
+					p!(pi: {mem.value} str(","));
 					p!(pi: items(format_comments(&mem.inline_trivia, CommentLocation::ItemInline)));
 					p!(pi: nl)
 				}
@@ -326,12 +380,12 @@
 }
 impl Printable for UnaryOperator {
 	fn print(&self) -> PrintItems {
-		p!(new: str(self.text()))
+		p!(new: string(self.text().to_string()))
 	}
 }
 impl Printable for BinaryOperator {
 	fn print(&self) -> PrintItems {
-		p!(new: str(self.text()))
+		p!(new: string(self.text().to_string()))
 	}
 }
 impl Printable for Bind {
@@ -348,12 +402,12 @@
 }
 impl Printable for Literal {
 	fn print(&self) -> PrintItems {
-		p!(new: str(&self.syntax().to_string()))
+		p!(new: string(self.syntax().to_string()))
 	}
 }
 impl Printable for ImportKind {
 	fn print(&self) -> PrintItems {
-		p!(new: str(&self.syntax().to_string()))
+		p!(new: string(self.syntax().to_string()))
 	}
 }
 impl Printable for LhsExpr {
@@ -406,9 +460,6 @@
 			Expr::ExprParened(p) => {
 				p!(new: str("(") {p.expr()} str(")"))
 			}
-			Expr::ExprIntrinsicThisFile(_) => p!(new: str("$intrinsicThisFile")),
-			Expr::ExprIntrinsicId(_) => p!(new: str("$intrinsicId")),
-			Expr::ExprIntrinsic(i) => p!(new: str("$intrinsic(") {i.name()} str(")")),
 			Expr::ExprString(s) => p!(new: {s.text()}),
 			Expr::ExprNumber(n) => p!(new: {n.number()}),
 			Expr::ExprArray(a) => {
@@ -543,10 +594,6 @@
 		local ocomp = {[k]: 1 for k in v};
 
 		local ? = skip;
-
-		local intr = $intrinsic(test);
-		local intrId = $intrinsicId;
-		local intrThisFile = $intrinsicThisFile;
 
 		local ie = a[expr];
 
@@ -643,7 +690,13 @@
 
 		  2
 
-		  else Template {}
+		  else Template {},
+
+		  compspecs: {
+			obj_with_no_item: {for i in [1, 2, 3]},
+			obj_with_2_items: {a:1, b:2, for i in [1,2,3]},
+		  }
+
 		} + Template
 
 
modifiedcrates/jrsonnet-rowan-parser/jsonnet.ungramdiffbeforeafterboth
--- a/crates/jrsonnet-rowan-parser/jsonnet.ungram
+++ b/crates/jrsonnet-rowan-parser/jsonnet.ungram
@@ -38,15 +38,6 @@
 
 ExprLiteral =
     Literal
-ExprIntrinsicThisFile =
-    '$intrinsicThisFile'
-ExprIntrinsicId =
-    '$intrinsicId'
-ExprIntrinsic =
-    '$intrinsic'
-    '('
-    name:Name
-    ')'
 ExprString =
     Text
 ExprNumber =
@@ -110,9 +101,6 @@
 |   ExprApply
 |   ExprObjExtend
 |   ExprParened
-|   ExprIntrinsicThisFile
-|   ExprIntrinsicId
-|   ExprIntrinsic
 |   ExprString
 |   ExprNumber
 |   ExprLiteral
@@ -167,14 +155,7 @@
 
 ObjBodyComp =
     '{'
-    pre:ObjLocalPostComma*
-    '['
-    key:LhsExpr
-    ']'
-    '+'?
-    ':'
-    value:Expr
-    post:ObjLocalPreComma*
+    (MemberComp (',' MemberComp)* ','?)?
     CompSpec*
     '}'
 ObjBodyMemberList =
@@ -185,13 +166,6 @@
     ObjBodyComp
 |   ObjBodyMemberList
 
-ObjLocalPostComma =
-    ObjLocal
-    ','
-ObjLocalPreComma =
-    ','
-    ObjLocal
-
 MemberBindStmt = ObjLocal
 MemberAssertStmt = Assertion
 MemberFieldNormal =
@@ -204,6 +178,10 @@
     ParamsDesc
     Visibility
     Expr
+MemberComp =
+    MemberBindStmt
+|    MemberFieldNormal
+|   MemberFieldMethod
 Member =
     MemberBindStmt
 |   MemberAssertStmt
@@ -367,7 +345,7 @@
 |   'LIT_SINGLE_LINE_HASH_COMMENT!'
 |   'LIT_SINGLE_LINE_SLASH_COMMENT!'
 
-ParsingError =
+CustomError =
     'ERROR_MISSING_TOKEN!'
 |   'ERROR_UNEXPECTED_TOKEN!'
 |   'ERROR_CUSTOM!'
modifiedcrates/jrsonnet-rowan-parser/src/generated/nodes.rsdiffbeforeafterboth
before · crates/jrsonnet-rowan-parser/src/generated/nodes.rs
1//! This is a generated file, please do not edit manually. Changes can be2//! made in codegeneration that lives in `xtask` top-level dir.34#![allow(non_snake_case, clippy::match_like_matches_macro)]5use crate::{6	ast::{support, AstChildren, AstNode, AstToken},7	SyntaxKind::{self, *},8	SyntaxNode, SyntaxToken, T,9};1011#[derive(Debug, Clone, PartialEq, Eq, Hash)]12pub struct SourceFile {13	pub(crate) syntax: SyntaxNode,14}15impl SourceFile {16	pub fn expr(&self) -> Option<Expr> {17		support::child(&self.syntax)18	}19}2021#[derive(Debug, Clone, PartialEq, Eq, Hash)]22pub struct ExprBinary {23	pub(crate) syntax: SyntaxNode,24}25impl ExprBinary {26	pub fn lhs(&self) -> Option<LhsExpr> {27		support::child(&self.syntax)28	}29	pub fn binary_operator(&self) -> Option<BinaryOperator> {30		support::token_child(&self.syntax)31	}32	pub fn rhs(&self) -> Option<Expr> {33		support::child(&self.syntax)34	}35}3637#[derive(Debug, Clone, PartialEq, Eq, Hash)]38pub struct LhsExpr {39	pub(crate) syntax: SyntaxNode,40}41impl LhsExpr {42	pub fn expr(&self) -> Option<Expr> {43		support::child(&self.syntax)44	}45}4647#[derive(Debug, Clone, PartialEq, Eq, Hash)]48pub struct ExprUnary {49	pub(crate) syntax: SyntaxNode,50}51impl ExprUnary {52	pub fn unary_operator(&self) -> Option<UnaryOperator> {53		support::token_child(&self.syntax)54	}55	pub fn rhs(&self) -> Option<Expr> {56		support::child(&self.syntax)57	}58}5960#[derive(Debug, Clone, PartialEq, Eq, Hash)]61pub struct ExprSlice {62	pub(crate) syntax: SyntaxNode,63}64impl ExprSlice {65	pub fn expr(&self) -> Option<Expr> {66		support::child(&self.syntax)67	}68	pub fn slice_desc(&self) -> Option<SliceDesc> {69		support::child(&self.syntax)70	}71}7273#[derive(Debug, Clone, PartialEq, Eq, Hash)]74pub struct SliceDesc {75	pub(crate) syntax: SyntaxNode,76}77impl SliceDesc {78	pub fn l_brack_token(&self) -> Option<SyntaxToken> {79		support::token(&self.syntax, T!['['])80	}81	pub fn from(&self) -> Option<Expr> {82		support::child(&self.syntax)83	}84	pub fn colon_token(&self) -> Option<SyntaxToken> {85		support::token(&self.syntax, T![:])86	}87	pub fn end(&self) -> Option<SliceDescEnd> {88		support::child(&self.syntax)89	}90	pub fn step(&self) -> Option<SliceDescStep> {91		support::child(&self.syntax)92	}93	pub fn r_brack_token(&self) -> Option<SyntaxToken> {94		support::token(&self.syntax, T![']'])95	}96}9798#[derive(Debug, Clone, PartialEq, Eq, Hash)]99pub struct ExprIndex {100	pub(crate) syntax: SyntaxNode,101}102impl ExprIndex {103	pub fn expr(&self) -> Option<Expr> {104		support::child(&self.syntax)105	}106	pub fn dot_token(&self) -> Option<SyntaxToken> {107		support::token(&self.syntax, T![.])108	}109	pub fn index(&self) -> Option<Name> {110		support::child(&self.syntax)111	}112}113114#[derive(Debug, Clone, PartialEq, Eq, Hash)]115pub struct Name {116	pub(crate) syntax: SyntaxNode,117}118impl Name {119	pub fn ident_lit(&self) -> Option<SyntaxToken> {120		support::token(&self.syntax, IDENT)121	}122}123124#[derive(Debug, Clone, PartialEq, Eq, Hash)]125pub struct ExprIndexExpr {126	pub(crate) syntax: SyntaxNode,127}128impl ExprIndexExpr {129	pub fn base(&self) -> Option<LhsExpr> {130		support::child(&self.syntax)131	}132	pub fn l_brack_token(&self) -> Option<SyntaxToken> {133		support::token(&self.syntax, T!['['])134	}135	pub fn index(&self) -> Option<Expr> {136		support::child(&self.syntax)137	}138	pub fn r_brack_token(&self) -> Option<SyntaxToken> {139		support::token(&self.syntax, T![']'])140	}141}142143#[derive(Debug, Clone, PartialEq, Eq, Hash)]144pub struct ExprApply {145	pub(crate) syntax: SyntaxNode,146}147impl ExprApply {148	pub fn expr(&self) -> Option<Expr> {149		support::child(&self.syntax)150	}151	pub fn args_desc(&self) -> Option<ArgsDesc> {152		support::child(&self.syntax)153	}154	pub fn tailstrict_kw_token(&self) -> Option<SyntaxToken> {155		support::token(&self.syntax, T![tailstrict])156	}157}158159#[derive(Debug, Clone, PartialEq, Eq, Hash)]160pub struct ArgsDesc {161	pub(crate) syntax: SyntaxNode,162}163impl ArgsDesc {164	pub fn l_paren_token(&self) -> Option<SyntaxToken> {165		support::token(&self.syntax, T!['('])166	}167	pub fn args(&self) -> AstChildren<Arg> {168		support::children(&self.syntax)169	}170	pub fn r_paren_token(&self) -> Option<SyntaxToken> {171		support::token(&self.syntax, T![')'])172	}173}174175#[derive(Debug, Clone, PartialEq, Eq, Hash)]176pub struct ExprObjExtend {177	pub(crate) syntax: SyntaxNode,178}179impl ExprObjExtend {180	pub fn lhs_expr(&self) -> Option<LhsExpr> {181		support::child(&self.syntax)182	}183	pub fn expr(&self) -> Option<Expr> {184		support::child(&self.syntax)185	}186}187188#[derive(Debug, Clone, PartialEq, Eq, Hash)]189pub struct ExprParened {190	pub(crate) syntax: SyntaxNode,191}192impl ExprParened {193	pub fn l_paren_token(&self) -> Option<SyntaxToken> {194		support::token(&self.syntax, T!['('])195	}196	pub fn expr(&self) -> Option<Expr> {197		support::child(&self.syntax)198	}199	pub fn r_paren_token(&self) -> Option<SyntaxToken> {200		support::token(&self.syntax, T![')'])201	}202}203204#[derive(Debug, Clone, PartialEq, Eq, Hash)]205pub struct ExprLiteral {206	pub(crate) syntax: SyntaxNode,207}208impl ExprLiteral {209	pub fn literal(&self) -> Option<Literal> {210		support::token_child(&self.syntax)211	}212}213214#[derive(Debug, Clone, PartialEq, Eq, Hash)]215pub struct ExprIntrinsicThisFile {216	pub(crate) syntax: SyntaxNode,217}218impl ExprIntrinsicThisFile {219	pub fn intrinsic_this_file_token(&self) -> Option<SyntaxToken> {220		support::token(&self.syntax, T!["$intrinsicThisFile"])221	}222}223224#[derive(Debug, Clone, PartialEq, Eq, Hash)]225pub struct ExprIntrinsicId {226	pub(crate) syntax: SyntaxNode,227}228impl ExprIntrinsicId {229	pub fn intrinsic_id_token(&self) -> Option<SyntaxToken> {230		support::token(&self.syntax, T!["$intrinsicId"])231	}232}233234#[derive(Debug, Clone, PartialEq, Eq, Hash)]235pub struct ExprIntrinsic {236	pub(crate) syntax: SyntaxNode,237}238impl ExprIntrinsic {239	pub fn intrinsic_token(&self) -> Option<SyntaxToken> {240		support::token(&self.syntax, T!["$intrinsic"])241	}242	pub fn l_paren_token(&self) -> Option<SyntaxToken> {243		support::token(&self.syntax, T!['('])244	}245	pub fn name(&self) -> Option<Name> {246		support::child(&self.syntax)247	}248	pub fn r_paren_token(&self) -> Option<SyntaxToken> {249		support::token(&self.syntax, T![')'])250	}251}252253#[derive(Debug, Clone, PartialEq, Eq, Hash)]254pub struct ExprString {255	pub(crate) syntax: SyntaxNode,256}257impl ExprString {258	pub fn text(&self) -> Option<Text> {259		support::token_child(&self.syntax)260	}261}262263#[derive(Debug, Clone, PartialEq, Eq, Hash)]264pub struct ExprNumber {265	pub(crate) syntax: SyntaxNode,266}267impl ExprNumber {268	pub fn number(&self) -> Option<Number> {269		support::token_child(&self.syntax)270	}271}272273#[derive(Debug, Clone, PartialEq, Eq, Hash)]274pub struct ExprArray {275	pub(crate) syntax: SyntaxNode,276}277impl ExprArray {278	pub fn l_brack_token(&self) -> Option<SyntaxToken> {279		support::token(&self.syntax, T!['['])280	}281	pub fn exprs(&self) -> AstChildren<Expr> {282		support::children(&self.syntax)283	}284	pub fn r_brack_token(&self) -> Option<SyntaxToken> {285		support::token(&self.syntax, T![']'])286	}287}288289#[derive(Debug, Clone, PartialEq, Eq, Hash)]290pub struct ExprObject {291	pub(crate) syntax: SyntaxNode,292}293impl ExprObject {294	pub fn obj_body(&self) -> Option<ObjBody> {295		support::child(&self.syntax)296	}297}298299#[derive(Debug, Clone, PartialEq, Eq, Hash)]300pub struct ExprArrayComp {301	pub(crate) syntax: SyntaxNode,302}303impl ExprArrayComp {304	pub fn l_brack_token(&self) -> Option<SyntaxToken> {305		support::token(&self.syntax, T!['['])306	}307	pub fn expr(&self) -> Option<Expr> {308		support::child(&self.syntax)309	}310	pub fn comma_token(&self) -> Option<SyntaxToken> {311		support::token(&self.syntax, T![,])312	}313	pub fn comp_specs(&self) -> AstChildren<CompSpec> {314		support::children(&self.syntax)315	}316	pub fn r_brack_token(&self) -> Option<SyntaxToken> {317		support::token(&self.syntax, T![']'])318	}319}320321#[derive(Debug, Clone, PartialEq, Eq, Hash)]322pub struct ExprImport {323	pub(crate) syntax: SyntaxNode,324}325impl ExprImport {326	pub fn import_kind(&self) -> Option<ImportKind> {327		support::token_child(&self.syntax)328	}329	pub fn text(&self) -> Option<Text> {330		support::token_child(&self.syntax)331	}332}333334#[derive(Debug, Clone, PartialEq, Eq, Hash)]335pub struct ExprVar {336	pub(crate) syntax: SyntaxNode,337}338impl ExprVar {339	pub fn name(&self) -> Option<Name> {340		support::child(&self.syntax)341	}342}343344#[derive(Debug, Clone, PartialEq, Eq, Hash)]345pub struct ExprLocal {346	pub(crate) syntax: SyntaxNode,347}348impl ExprLocal {349	pub fn local_kw_token(&self) -> Option<SyntaxToken> {350		support::token(&self.syntax, T![local])351	}352	pub fn binds(&self) -> AstChildren<Bind> {353		support::children(&self.syntax)354	}355	pub fn semi_token(&self) -> Option<SyntaxToken> {356		support::token(&self.syntax, T![;])357	}358	pub fn expr(&self) -> Option<Expr> {359		support::child(&self.syntax)360	}361}362363#[derive(Debug, Clone, PartialEq, Eq, Hash)]364pub struct ExprIfThenElse {365	pub(crate) syntax: SyntaxNode,366}367impl ExprIfThenElse {368	pub fn if_kw_token(&self) -> Option<SyntaxToken> {369		support::token(&self.syntax, T![if])370	}371	pub fn cond(&self) -> Option<Expr> {372		support::child(&self.syntax)373	}374	pub fn then_kw_token(&self) -> Option<SyntaxToken> {375		support::token(&self.syntax, T![then])376	}377	pub fn then(&self) -> Option<TrueExpr> {378		support::child(&self.syntax)379	}380	pub fn else_kw_token(&self) -> Option<SyntaxToken> {381		support::token(&self.syntax, T![else])382	}383	pub fn else_(&self) -> Option<FalseExpr> {384		support::child(&self.syntax)385	}386}387388#[derive(Debug, Clone, PartialEq, Eq, Hash)]389pub struct TrueExpr {390	pub(crate) syntax: SyntaxNode,391}392impl TrueExpr {393	pub fn expr(&self) -> Option<Expr> {394		support::child(&self.syntax)395	}396}397398#[derive(Debug, Clone, PartialEq, Eq, Hash)]399pub struct FalseExpr {400	pub(crate) syntax: SyntaxNode,401}402impl FalseExpr {403	pub fn expr(&self) -> Option<Expr> {404		support::child(&self.syntax)405	}406}407408#[derive(Debug, Clone, PartialEq, Eq, Hash)]409pub struct ExprFunction {410	pub(crate) syntax: SyntaxNode,411}412impl ExprFunction {413	pub fn function_kw_token(&self) -> Option<SyntaxToken> {414		support::token(&self.syntax, T![function])415	}416	pub fn l_paren_token(&self) -> Option<SyntaxToken> {417		support::token(&self.syntax, T!['('])418	}419	pub fn params_desc(&self) -> Option<ParamsDesc> {420		support::child(&self.syntax)421	}422	pub fn r_paren_token(&self) -> Option<SyntaxToken> {423		support::token(&self.syntax, T![')'])424	}425	pub fn expr(&self) -> Option<Expr> {426		support::child(&self.syntax)427	}428}429430#[derive(Debug, Clone, PartialEq, Eq, Hash)]431pub struct ParamsDesc {432	pub(crate) syntax: SyntaxNode,433}434impl ParamsDesc {435	pub fn l_paren_token(&self) -> Option<SyntaxToken> {436		support::token(&self.syntax, T!['('])437	}438	pub fn params(&self) -> AstChildren<Param> {439		support::children(&self.syntax)440	}441	pub fn r_paren_token(&self) -> Option<SyntaxToken> {442		support::token(&self.syntax, T![')'])443	}444}445446#[derive(Debug, Clone, PartialEq, Eq, Hash)]447pub struct ExprAssert {448	pub(crate) syntax: SyntaxNode,449}450impl ExprAssert {451	pub fn assertion(&self) -> Option<Assertion> {452		support::child(&self.syntax)453	}454	pub fn semi_token(&self) -> Option<SyntaxToken> {455		support::token(&self.syntax, T![;])456	}457	pub fn expr(&self) -> Option<Expr> {458		support::child(&self.syntax)459	}460}461462#[derive(Debug, Clone, PartialEq, Eq, Hash)]463pub struct Assertion {464	pub(crate) syntax: SyntaxNode,465}466impl Assertion {467	pub fn assert_kw_token(&self) -> Option<SyntaxToken> {468		support::token(&self.syntax, T![assert])469	}470	pub fn condition(&self) -> Option<LhsExpr> {471		support::child(&self.syntax)472	}473	pub fn colon_token(&self) -> Option<SyntaxToken> {474		support::token(&self.syntax, T![:])475	}476	pub fn message(&self) -> Option<Expr> {477		support::child(&self.syntax)478	}479}480481#[derive(Debug, Clone, PartialEq, Eq, Hash)]482pub struct ExprError {483	pub(crate) syntax: SyntaxNode,484}485impl ExprError {486	pub fn error_kw_token(&self) -> Option<SyntaxToken> {487		support::token(&self.syntax, T![error])488	}489	pub fn expr(&self) -> Option<Expr> {490		support::child(&self.syntax)491	}492}493494#[derive(Debug, Clone, PartialEq, Eq, Hash)]495pub struct SliceDescEnd {496	pub(crate) syntax: SyntaxNode,497}498impl SliceDescEnd {499	pub fn expr(&self) -> Option<Expr> {500		support::child(&self.syntax)501	}502}503504#[derive(Debug, Clone, PartialEq, Eq, Hash)]505pub struct SliceDescStep {506	pub(crate) syntax: SyntaxNode,507}508impl SliceDescStep {509	pub fn expr(&self) -> Option<Expr> {510		support::child(&self.syntax)511	}512}513514#[derive(Debug, Clone, PartialEq, Eq, Hash)]515pub struct Arg {516	pub(crate) syntax: SyntaxNode,517}518impl Arg {519	pub fn name(&self) -> Option<Name> {520		support::child(&self.syntax)521	}522	pub fn assign_token(&self) -> Option<SyntaxToken> {523		support::token(&self.syntax, T![=])524	}525	pub fn expr(&self) -> Option<Expr> {526		support::child(&self.syntax)527	}528}529530#[derive(Debug, Clone, PartialEq, Eq, Hash)]531pub struct ObjBodyComp {532	pub(crate) syntax: SyntaxNode,533}534impl ObjBodyComp {535	pub fn l_brace_token(&self) -> Option<SyntaxToken> {536		support::token(&self.syntax, T!['{'])537	}538	pub fn pre(&self) -> AstChildren<ObjLocalPostComma> {539		support::children(&self.syntax)540	}541	pub fn l_brack_token(&self) -> Option<SyntaxToken> {542		support::token(&self.syntax, T!['['])543	}544	pub fn key(&self) -> Option<LhsExpr> {545		support::child(&self.syntax)546	}547	pub fn r_brack_token(&self) -> Option<SyntaxToken> {548		support::token(&self.syntax, T![']'])549	}550	pub fn plus_token(&self) -> Option<SyntaxToken> {551		support::token(&self.syntax, T![+])552	}553	pub fn colon_token(&self) -> Option<SyntaxToken> {554		support::token(&self.syntax, T![:])555	}556	pub fn value(&self) -> Option<Expr> {557		support::child(&self.syntax)558	}559	pub fn post(&self) -> AstChildren<ObjLocalPreComma> {560		support::children(&self.syntax)561	}562	pub fn comp_specs(&self) -> AstChildren<CompSpec> {563		support::children(&self.syntax)564	}565	pub fn r_brace_token(&self) -> Option<SyntaxToken> {566		support::token(&self.syntax, T!['}'])567	}568}569570#[derive(Debug, Clone, PartialEq, Eq, Hash)]571pub struct ObjLocalPostComma {572	pub(crate) syntax: SyntaxNode,573}574impl ObjLocalPostComma {575	pub fn obj_local(&self) -> Option<ObjLocal> {576		support::child(&self.syntax)577	}578	pub fn comma_token(&self) -> Option<SyntaxToken> {579		support::token(&self.syntax, T![,])580	}581}582583#[derive(Debug, Clone, PartialEq, Eq, Hash)]584pub struct ObjLocalPreComma {585	pub(crate) syntax: SyntaxNode,586}587impl ObjLocalPreComma {588	pub fn comma_token(&self) -> Option<SyntaxToken> {589		support::token(&self.syntax, T![,])590	}591	pub fn obj_local(&self) -> Option<ObjLocal> {592		support::child(&self.syntax)593	}594}595596#[derive(Debug, Clone, PartialEq, Eq, Hash)]597pub struct ObjBodyMemberList {598	pub(crate) syntax: SyntaxNode,599}600impl ObjBodyMemberList {601	pub fn l_brace_token(&self) -> Option<SyntaxToken> {602		support::token(&self.syntax, T!['{'])603	}604	pub fn members(&self) -> AstChildren<Member> {605		support::children(&self.syntax)606	}607	pub fn r_brace_token(&self) -> Option<SyntaxToken> {608		support::token(&self.syntax, T!['}'])609	}610}611612#[derive(Debug, Clone, PartialEq, Eq, Hash)]613pub struct ObjLocal {614	pub(crate) syntax: SyntaxNode,615}616impl ObjLocal {617	pub fn local_kw_token(&self) -> Option<SyntaxToken> {618		support::token(&self.syntax, T![local])619	}620	pub fn bind(&self) -> Option<Bind> {621		support::child(&self.syntax)622	}623}624625#[derive(Debug, Clone, PartialEq, Eq, Hash)]626pub struct MemberBindStmt {627	pub(crate) syntax: SyntaxNode,628}629impl MemberBindStmt {630	pub fn obj_local(&self) -> Option<ObjLocal> {631		support::child(&self.syntax)632	}633}634635#[derive(Debug, Clone, PartialEq, Eq, Hash)]636pub struct MemberAssertStmt {637	pub(crate) syntax: SyntaxNode,638}639impl MemberAssertStmt {640	pub fn assertion(&self) -> Option<Assertion> {641		support::child(&self.syntax)642	}643}644645#[derive(Debug, Clone, PartialEq, Eq, Hash)]646pub struct MemberFieldNormal {647	pub(crate) syntax: SyntaxNode,648}649impl MemberFieldNormal {650	pub fn field_name(&self) -> Option<FieldName> {651		support::child(&self.syntax)652	}653	pub fn plus_token(&self) -> Option<SyntaxToken> {654		support::token(&self.syntax, T![+])655	}656	pub fn visibility(&self) -> Option<Visibility> {657		support::token_child(&self.syntax)658	}659	pub fn expr(&self) -> Option<Expr> {660		support::child(&self.syntax)661	}662}663664#[derive(Debug, Clone, PartialEq, Eq, Hash)]665pub struct MemberFieldMethod {666	pub(crate) syntax: SyntaxNode,667}668impl MemberFieldMethod {669	pub fn field_name(&self) -> Option<FieldName> {670		support::child(&self.syntax)671	}672	pub fn params_desc(&self) -> Option<ParamsDesc> {673		support::child(&self.syntax)674	}675	pub fn visibility(&self) -> Option<Visibility> {676		support::token_child(&self.syntax)677	}678	pub fn expr(&self) -> Option<Expr> {679		support::child(&self.syntax)680	}681}682683#[derive(Debug, Clone, PartialEq, Eq, Hash)]684pub struct FieldNameFixed {685	pub(crate) syntax: SyntaxNode,686}687impl FieldNameFixed {688	pub fn id(&self) -> Option<Name> {689		support::child(&self.syntax)690	}691	pub fn text(&self) -> Option<Text> {692		support::token_child(&self.syntax)693	}694}695696#[derive(Debug, Clone, PartialEq, Eq, Hash)]697pub struct FieldNameDynamic {698	pub(crate) syntax: SyntaxNode,699}700impl FieldNameDynamic {701	pub fn l_brack_token(&self) -> Option<SyntaxToken> {702		support::token(&self.syntax, T!['['])703	}704	pub fn expr(&self) -> Option<Expr> {705		support::child(&self.syntax)706	}707	pub fn r_brack_token(&self) -> Option<SyntaxToken> {708		support::token(&self.syntax, T![']'])709	}710}711712#[derive(Debug, Clone, PartialEq, Eq, Hash)]713pub struct ForSpec {714	pub(crate) syntax: SyntaxNode,715}716impl ForSpec {717	pub fn for_kw_token(&self) -> Option<SyntaxToken> {718		support::token(&self.syntax, T![for])719	}720	pub fn bind(&self) -> Option<Name> {721		support::child(&self.syntax)722	}723	pub fn in_kw_token(&self) -> Option<SyntaxToken> {724		support::token(&self.syntax, T![in])725	}726	pub fn expr(&self) -> Option<Expr> {727		support::child(&self.syntax)728	}729}730731#[derive(Debug, Clone, PartialEq, Eq, Hash)]732pub struct IfSpec {733	pub(crate) syntax: SyntaxNode,734}735impl IfSpec {736	pub fn if_kw_token(&self) -> Option<SyntaxToken> {737		support::token(&self.syntax, T![if])738	}739	pub fn expr(&self) -> Option<Expr> {740		support::child(&self.syntax)741	}742}743744#[derive(Debug, Clone, PartialEq, Eq, Hash)]745pub struct BindDestruct {746	pub(crate) syntax: SyntaxNode,747}748impl BindDestruct {749	pub fn into(&self) -> Option<Destruct> {750		support::child(&self.syntax)751	}752	pub fn assign_token(&self) -> Option<SyntaxToken> {753		support::token(&self.syntax, T![=])754	}755	pub fn value(&self) -> Option<Expr> {756		support::child(&self.syntax)757	}758}759760#[derive(Debug, Clone, PartialEq, Eq, Hash)]761pub struct BindFunction {762	pub(crate) syntax: SyntaxNode,763}764impl BindFunction {765	pub fn name(&self) -> Option<Name> {766		support::child(&self.syntax)767	}768	pub fn params(&self) -> Option<ParamsDesc> {769		support::child(&self.syntax)770	}771	pub fn assign_token(&self) -> Option<SyntaxToken> {772		support::token(&self.syntax, T![=])773	}774	pub fn value(&self) -> Option<Expr> {775		support::child(&self.syntax)776	}777}778779#[derive(Debug, Clone, PartialEq, Eq, Hash)]780pub struct Param {781	pub(crate) syntax: SyntaxNode,782}783impl Param {784	pub fn destruct(&self) -> Option<Destruct> {785		support::child(&self.syntax)786	}787	pub fn assign_token(&self) -> Option<SyntaxToken> {788		support::token(&self.syntax, T![=])789	}790	pub fn expr(&self) -> Option<Expr> {791		support::child(&self.syntax)792	}793}794795#[derive(Debug, Clone, PartialEq, Eq, Hash)]796pub struct DestructFull {797	pub(crate) syntax: SyntaxNode,798}799impl DestructFull {800	pub fn name(&self) -> Option<Name> {801		support::child(&self.syntax)802	}803}804805#[derive(Debug, Clone, PartialEq, Eq, Hash)]806pub struct DestructSkip {807	pub(crate) syntax: SyntaxNode,808}809impl DestructSkip {810	pub fn question_mark_token(&self) -> Option<SyntaxToken> {811		support::token(&self.syntax, T![?])812	}813}814815#[derive(Debug, Clone, PartialEq, Eq, Hash)]816pub struct DestructArray {817	pub(crate) syntax: SyntaxNode,818}819impl DestructArray {820	pub fn l_brack_token(&self) -> Option<SyntaxToken> {821		support::token(&self.syntax, T!['['])822	}823	pub fn destruct_array_parts(&self) -> AstChildren<DestructArrayPart> {824		support::children(&self.syntax)825	}826	pub fn r_brack_token(&self) -> Option<SyntaxToken> {827		support::token(&self.syntax, T![']'])828	}829}830831#[derive(Debug, Clone, PartialEq, Eq, Hash)]832pub struct DestructObject {833	pub(crate) syntax: SyntaxNode,834}835impl DestructObject {836	pub fn l_brace_token(&self) -> Option<SyntaxToken> {837		support::token(&self.syntax, T!['{'])838	}839	pub fn destruct_object_fields(&self) -> AstChildren<DestructObjectField> {840		support::children(&self.syntax)841	}842	pub fn destruct_rest(&self) -> Option<DestructRest> {843		support::child(&self.syntax)844	}845	pub fn comma_token(&self) -> Option<SyntaxToken> {846		support::token(&self.syntax, T![,])847	}848	pub fn r_brace_token(&self) -> Option<SyntaxToken> {849		support::token(&self.syntax, T!['}'])850	}851}852853#[derive(Debug, Clone, PartialEq, Eq, Hash)]854pub struct DestructObjectField {855	pub(crate) syntax: SyntaxNode,856}857impl DestructObjectField {858	pub fn field(&self) -> Option<Name> {859		support::child(&self.syntax)860	}861	pub fn colon_token(&self) -> Option<SyntaxToken> {862		support::token(&self.syntax, T![:])863	}864	pub fn destruct(&self) -> Option<Destruct> {865		support::child(&self.syntax)866	}867	pub fn assign_token(&self) -> Option<SyntaxToken> {868		support::token(&self.syntax, T![=])869	}870	pub fn expr(&self) -> Option<Expr> {871		support::child(&self.syntax)872	}873}874875#[derive(Debug, Clone, PartialEq, Eq, Hash)]876pub struct DestructRest {877	pub(crate) syntax: SyntaxNode,878}879impl DestructRest {880	pub fn dotdotdot_token(&self) -> Option<SyntaxToken> {881		support::token(&self.syntax, T![...])882	}883	pub fn into(&self) -> Option<Name> {884		support::child(&self.syntax)885	}886}887888#[derive(Debug, Clone, PartialEq, Eq, Hash)]889pub struct DestructArrayElement {890	pub(crate) syntax: SyntaxNode,891}892impl DestructArrayElement {893	pub fn destruct(&self) -> Option<Destruct> {894		support::child(&self.syntax)895	}896}897898#[derive(Debug, Clone, PartialEq, Eq, Hash)]899pub enum Expr {900	ExprBinary(ExprBinary),901	ExprUnary(ExprUnary),902	ExprSlice(ExprSlice),903	ExprIndex(ExprIndex),904	ExprIndexExpr(ExprIndexExpr),905	ExprApply(ExprApply),906	ExprObjExtend(ExprObjExtend),907	ExprParened(ExprParened),908	ExprIntrinsicThisFile(ExprIntrinsicThisFile),909	ExprIntrinsicId(ExprIntrinsicId),910	ExprIntrinsic(ExprIntrinsic),911	ExprString(ExprString),912	ExprNumber(ExprNumber),913	ExprLiteral(ExprLiteral),914	ExprArray(ExprArray),915	ExprObject(ExprObject),916	ExprArrayComp(ExprArrayComp),917	ExprImport(ExprImport),918	ExprVar(ExprVar),919	ExprLocal(ExprLocal),920	ExprIfThenElse(ExprIfThenElse),921	ExprFunction(ExprFunction),922	ExprAssert(ExprAssert),923	ExprError(ExprError),924}925926#[derive(Debug, Clone, PartialEq, Eq, Hash)]927pub enum ObjBody {928	ObjBodyComp(ObjBodyComp),929	ObjBodyMemberList(ObjBodyMemberList),930}931932#[derive(Debug, Clone, PartialEq, Eq, Hash)]933pub enum CompSpec {934	ForSpec(ForSpec),935	IfSpec(IfSpec),936}937938#[derive(Debug, Clone, PartialEq, Eq, Hash)]939pub enum Bind {940	BindDestruct(BindDestruct),941	BindFunction(BindFunction),942}943944#[derive(Debug, Clone, PartialEq, Eq, Hash)]945pub enum Member {946	MemberBindStmt(MemberBindStmt),947	MemberAssertStmt(MemberAssertStmt),948	MemberFieldNormal(MemberFieldNormal),949	MemberFieldMethod(MemberFieldMethod),950}951952#[derive(Debug, Clone, PartialEq, Eq, Hash)]953pub enum FieldName {954	FieldNameFixed(FieldNameFixed),955	FieldNameDynamic(FieldNameDynamic),956}957958#[derive(Debug, Clone, PartialEq, Eq, Hash)]959pub enum Destruct {960	DestructFull(DestructFull),961	DestructSkip(DestructSkip),962	DestructArray(DestructArray),963	DestructObject(DestructObject),964}965966#[derive(Debug, Clone, PartialEq, Eq, Hash)]967pub enum DestructArrayPart {968	DestructArrayElement(DestructArrayElement),969	DestructRest(DestructRest),970}971972#[derive(Debug, Clone, PartialEq, Eq, Hash)]973pub struct BinaryOperator {974	syntax: SyntaxToken,975	kind: BinaryOperatorKind,976}977978#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]979pub enum BinaryOperatorKind {980	Or,981	And,982	BitOr,983	BitXor,984	BitAnd,985	Eq,986	Ne,987	Lt,988	Gt,989	Le,990	Ge,991	InKw,992	Lhs,993	Rhs,994	Plus,995	Minus,996	Mul,997	Div,998	Modulo,999	MetaObjectApply,1000	ErrorNoOperator,1001}10021003#[derive(Debug, Clone, PartialEq, Eq, Hash)]1004pub struct UnaryOperator {1005	syntax: SyntaxToken,1006	kind: UnaryOperatorKind,1007}10081009#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]1010pub enum UnaryOperatorKind {1011	Minus,1012	Not,1013	BitNot,1014}10151016#[derive(Debug, Clone, PartialEq, Eq, Hash)]1017pub struct Literal {1018	syntax: SyntaxToken,1019	kind: LiteralKind,1020}10211022#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]1023pub enum LiteralKind {1024	NullKw,1025	TrueKw,1026	FalseKw,1027	SelfKw,1028	Dollar,1029	SuperKw,1030}10311032#[derive(Debug, Clone, PartialEq, Eq, Hash)]1033pub struct Text {1034	syntax: SyntaxToken,1035	kind: TextKind,1036}10371038#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]1039pub enum TextKind {1040	StringDouble,1041	ErrorStringDoubleUnterminated,1042	StringSingle,1043	ErrorStringSingleUnterminated,1044	StringDoubleVerbatim,1045	ErrorStringDoubleVerbatimUnterminated,1046	StringSingleVerbatim,1047	ErrorStringSingleVerbatimUnterminated,1048	ErrorStringVerbatimMissingQuotes,1049	StringBlock,1050	ErrorStringBlockUnexpectedEnd,1051	ErrorStringBlockMissingNewLine,1052	ErrorStringBlockMissingTermination,1053	ErrorStringBlockMissingIndent,1054}10551056#[derive(Debug, Clone, PartialEq, Eq, Hash)]1057pub struct Number {1058	syntax: SyntaxToken,1059	kind: NumberKind,1060}10611062#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]1063pub enum NumberKind {1064	Float,1065	ErrorFloatJunkAfterPoint,1066	ErrorFloatJunkAfterExponent,1067	ErrorFloatJunkAfterExponentSign,1068}10691070#[derive(Debug, Clone, PartialEq, Eq, Hash)]1071pub struct ImportKind {1072	syntax: SyntaxToken,1073	kind: ImportKindKind,1074}10751076#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]1077pub enum ImportKindKind {1078	ImportstrKw,1079	ImportbinKw,1080	ImportKw,1081}10821083#[derive(Debug, Clone, PartialEq, Eq, Hash)]1084pub struct Visibility {1085	syntax: SyntaxToken,1086	kind: VisibilityKind,1087}10881089#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]1090pub enum VisibilityKind {1091	Coloncoloncolon,1092	Coloncolon,1093	Colon,1094}10951096#[derive(Debug, Clone, PartialEq, Eq, Hash)]1097pub struct Trivia {1098	syntax: SyntaxToken,1099	kind: TriviaKind,1100}11011102#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]1103pub enum TriviaKind {1104	Whitespace,1105	MultiLineComment,1106	ErrorCommentTooShort,1107	ErrorCommentUnterminated,1108	SingleLineHashComment,1109	SingleLineSlashComment,1110}11111112#[derive(Debug, Clone, PartialEq, Eq, Hash)]1113pub struct ParsingError {1114	syntax: SyntaxToken,1115	kind: ParsingErrorKind,1116}11171118#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]1119pub enum ParsingErrorKind {1120	ErrorMissingToken,1121	ErrorUnexpectedToken,1122	ErrorCustom,1123}1124impl AstNode for SourceFile {1125	fn can_cast(kind: SyntaxKind) -> bool {1126		kind == SOURCE_FILE1127	}1128	fn cast(syntax: SyntaxNode) -> Option<Self> {1129		if Self::can_cast(syntax.kind()) {1130			Some(Self { syntax })1131		} else {1132			None1133		}1134	}1135	fn syntax(&self) -> &SyntaxNode {1136		&self.syntax1137	}1138}1139impl AstNode for ExprBinary {1140	fn can_cast(kind: SyntaxKind) -> bool {1141		kind == EXPR_BINARY1142	}1143	fn cast(syntax: SyntaxNode) -> Option<Self> {1144		if Self::can_cast(syntax.kind()) {1145			Some(Self { syntax })1146		} else {1147			None1148		}1149	}1150	fn syntax(&self) -> &SyntaxNode {1151		&self.syntax1152	}1153}1154impl AstNode for LhsExpr {1155	fn can_cast(kind: SyntaxKind) -> bool {1156		kind == LHS_EXPR1157	}1158	fn cast(syntax: SyntaxNode) -> Option<Self> {1159		if Self::can_cast(syntax.kind()) {1160			Some(Self { syntax })1161		} else {1162			None1163		}1164	}1165	fn syntax(&self) -> &SyntaxNode {1166		&self.syntax1167	}1168}1169impl AstNode for ExprUnary {1170	fn can_cast(kind: SyntaxKind) -> bool {1171		kind == EXPR_UNARY1172	}1173	fn cast(syntax: SyntaxNode) -> Option<Self> {1174		if Self::can_cast(syntax.kind()) {1175			Some(Self { syntax })1176		} else {1177			None1178		}1179	}1180	fn syntax(&self) -> &SyntaxNode {1181		&self.syntax1182	}1183}1184impl AstNode for ExprSlice {1185	fn can_cast(kind: SyntaxKind) -> bool {1186		kind == EXPR_SLICE1187	}1188	fn cast(syntax: SyntaxNode) -> Option<Self> {1189		if Self::can_cast(syntax.kind()) {1190			Some(Self { syntax })1191		} else {1192			None1193		}1194	}1195	fn syntax(&self) -> &SyntaxNode {1196		&self.syntax1197	}1198}1199impl AstNode for SliceDesc {1200	fn can_cast(kind: SyntaxKind) -> bool {1201		kind == SLICE_DESC1202	}1203	fn cast(syntax: SyntaxNode) -> Option<Self> {1204		if Self::can_cast(syntax.kind()) {1205			Some(Self { syntax })1206		} else {1207			None1208		}1209	}1210	fn syntax(&self) -> &SyntaxNode {1211		&self.syntax1212	}1213}1214impl AstNode for ExprIndex {1215	fn can_cast(kind: SyntaxKind) -> bool {1216		kind == EXPR_INDEX1217	}1218	fn cast(syntax: SyntaxNode) -> Option<Self> {1219		if Self::can_cast(syntax.kind()) {1220			Some(Self { syntax })1221		} else {1222			None1223		}1224	}1225	fn syntax(&self) -> &SyntaxNode {1226		&self.syntax1227	}1228}1229impl AstNode for Name {1230	fn can_cast(kind: SyntaxKind) -> bool {1231		kind == NAME1232	}1233	fn cast(syntax: SyntaxNode) -> Option<Self> {1234		if Self::can_cast(syntax.kind()) {1235			Some(Self { syntax })1236		} else {1237			None1238		}1239	}1240	fn syntax(&self) -> &SyntaxNode {1241		&self.syntax1242	}1243}1244impl AstNode for ExprIndexExpr {1245	fn can_cast(kind: SyntaxKind) -> bool {1246		kind == EXPR_INDEX_EXPR1247	}1248	fn cast(syntax: SyntaxNode) -> Option<Self> {1249		if Self::can_cast(syntax.kind()) {1250			Some(Self { syntax })1251		} else {1252			None1253		}1254	}1255	fn syntax(&self) -> &SyntaxNode {1256		&self.syntax1257	}1258}1259impl AstNode for ExprApply {1260	fn can_cast(kind: SyntaxKind) -> bool {1261		kind == EXPR_APPLY1262	}1263	fn cast(syntax: SyntaxNode) -> Option<Self> {1264		if Self::can_cast(syntax.kind()) {1265			Some(Self { syntax })1266		} else {1267			None1268		}1269	}1270	fn syntax(&self) -> &SyntaxNode {1271		&self.syntax1272	}1273}1274impl AstNode for ArgsDesc {1275	fn can_cast(kind: SyntaxKind) -> bool {1276		kind == ARGS_DESC1277	}1278	fn cast(syntax: SyntaxNode) -> Option<Self> {1279		if Self::can_cast(syntax.kind()) {1280			Some(Self { syntax })1281		} else {1282			None1283		}1284	}1285	fn syntax(&self) -> &SyntaxNode {1286		&self.syntax1287	}1288}1289impl AstNode for ExprObjExtend {1290	fn can_cast(kind: SyntaxKind) -> bool {1291		kind == EXPR_OBJ_EXTEND1292	}1293	fn cast(syntax: SyntaxNode) -> Option<Self> {1294		if Self::can_cast(syntax.kind()) {1295			Some(Self { syntax })1296		} else {1297			None1298		}1299	}1300	fn syntax(&self) -> &SyntaxNode {1301		&self.syntax1302	}1303}1304impl AstNode for ExprParened {1305	fn can_cast(kind: SyntaxKind) -> bool {1306		kind == EXPR_PARENED1307	}1308	fn cast(syntax: SyntaxNode) -> Option<Self> {1309		if Self::can_cast(syntax.kind()) {1310			Some(Self { syntax })1311		} else {1312			None1313		}1314	}1315	fn syntax(&self) -> &SyntaxNode {1316		&self.syntax1317	}1318}1319impl AstNode for ExprLiteral {1320	fn can_cast(kind: SyntaxKind) -> bool {1321		kind == EXPR_LITERAL1322	}1323	fn cast(syntax: SyntaxNode) -> Option<Self> {1324		if Self::can_cast(syntax.kind()) {1325			Some(Self { syntax })1326		} else {1327			None1328		}1329	}1330	fn syntax(&self) -> &SyntaxNode {1331		&self.syntax1332	}1333}1334impl AstNode for ExprIntrinsicThisFile {1335	fn can_cast(kind: SyntaxKind) -> bool {1336		kind == EXPR_INTRINSIC_THIS_FILE1337	}1338	fn cast(syntax: SyntaxNode) -> Option<Self> {1339		if Self::can_cast(syntax.kind()) {1340			Some(Self { syntax })1341		} else {1342			None1343		}1344	}1345	fn syntax(&self) -> &SyntaxNode {1346		&self.syntax1347	}1348}1349impl AstNode for ExprIntrinsicId {1350	fn can_cast(kind: SyntaxKind) -> bool {1351		kind == EXPR_INTRINSIC_ID1352	}1353	fn cast(syntax: SyntaxNode) -> Option<Self> {1354		if Self::can_cast(syntax.kind()) {1355			Some(Self { syntax })1356		} else {1357			None1358		}1359	}1360	fn syntax(&self) -> &SyntaxNode {1361		&self.syntax1362	}1363}1364impl AstNode for ExprIntrinsic {1365	fn can_cast(kind: SyntaxKind) -> bool {1366		kind == EXPR_INTRINSIC1367	}1368	fn cast(syntax: SyntaxNode) -> Option<Self> {1369		if Self::can_cast(syntax.kind()) {1370			Some(Self { syntax })1371		} else {1372			None1373		}1374	}1375	fn syntax(&self) -> &SyntaxNode {1376		&self.syntax1377	}1378}1379impl AstNode for ExprString {1380	fn can_cast(kind: SyntaxKind) -> bool {1381		kind == EXPR_STRING1382	}1383	fn cast(syntax: SyntaxNode) -> Option<Self> {1384		if Self::can_cast(syntax.kind()) {1385			Some(Self { syntax })1386		} else {1387			None1388		}1389	}1390	fn syntax(&self) -> &SyntaxNode {1391		&self.syntax1392	}1393}1394impl AstNode for ExprNumber {1395	fn can_cast(kind: SyntaxKind) -> bool {1396		kind == EXPR_NUMBER1397	}1398	fn cast(syntax: SyntaxNode) -> Option<Self> {1399		if Self::can_cast(syntax.kind()) {1400			Some(Self { syntax })1401		} else {1402			None1403		}1404	}1405	fn syntax(&self) -> &SyntaxNode {1406		&self.syntax1407	}1408}1409impl AstNode for ExprArray {1410	fn can_cast(kind: SyntaxKind) -> bool {1411		kind == EXPR_ARRAY1412	}1413	fn cast(syntax: SyntaxNode) -> Option<Self> {1414		if Self::can_cast(syntax.kind()) {1415			Some(Self { syntax })1416		} else {1417			None1418		}1419	}1420	fn syntax(&self) -> &SyntaxNode {1421		&self.syntax1422	}1423}1424impl AstNode for ExprObject {1425	fn can_cast(kind: SyntaxKind) -> bool {1426		kind == EXPR_OBJECT1427	}1428	fn cast(syntax: SyntaxNode) -> Option<Self> {1429		if Self::can_cast(syntax.kind()) {1430			Some(Self { syntax })1431		} else {1432			None1433		}1434	}1435	fn syntax(&self) -> &SyntaxNode {1436		&self.syntax1437	}1438}1439impl AstNode for ExprArrayComp {1440	fn can_cast(kind: SyntaxKind) -> bool {1441		kind == EXPR_ARRAY_COMP1442	}1443	fn cast(syntax: SyntaxNode) -> Option<Self> {1444		if Self::can_cast(syntax.kind()) {1445			Some(Self { syntax })1446		} else {1447			None1448		}1449	}1450	fn syntax(&self) -> &SyntaxNode {1451		&self.syntax1452	}1453}1454impl AstNode for ExprImport {1455	fn can_cast(kind: SyntaxKind) -> bool {1456		kind == EXPR_IMPORT1457	}1458	fn cast(syntax: SyntaxNode) -> Option<Self> {1459		if Self::can_cast(syntax.kind()) {1460			Some(Self { syntax })1461		} else {1462			None1463		}1464	}1465	fn syntax(&self) -> &SyntaxNode {1466		&self.syntax1467	}1468}1469impl AstNode for ExprVar {1470	fn can_cast(kind: SyntaxKind) -> bool {1471		kind == EXPR_VAR1472	}1473	fn cast(syntax: SyntaxNode) -> Option<Self> {1474		if Self::can_cast(syntax.kind()) {1475			Some(Self { syntax })1476		} else {1477			None1478		}1479	}1480	fn syntax(&self) -> &SyntaxNode {1481		&self.syntax1482	}1483}1484impl AstNode for ExprLocal {1485	fn can_cast(kind: SyntaxKind) -> bool {1486		kind == EXPR_LOCAL1487	}1488	fn cast(syntax: SyntaxNode) -> Option<Self> {1489		if Self::can_cast(syntax.kind()) {1490			Some(Self { syntax })1491		} else {1492			None1493		}1494	}1495	fn syntax(&self) -> &SyntaxNode {1496		&self.syntax1497	}1498}1499impl AstNode for ExprIfThenElse {1500	fn can_cast(kind: SyntaxKind) -> bool {1501		kind == EXPR_IF_THEN_ELSE1502	}1503	fn cast(syntax: SyntaxNode) -> Option<Self> {1504		if Self::can_cast(syntax.kind()) {1505			Some(Self { syntax })1506		} else {1507			None1508		}1509	}1510	fn syntax(&self) -> &SyntaxNode {1511		&self.syntax1512	}1513}1514impl AstNode for TrueExpr {1515	fn can_cast(kind: SyntaxKind) -> bool {1516		kind == TRUE_EXPR1517	}1518	fn cast(syntax: SyntaxNode) -> Option<Self> {1519		if Self::can_cast(syntax.kind()) {1520			Some(Self { syntax })1521		} else {1522			None1523		}1524	}1525	fn syntax(&self) -> &SyntaxNode {1526		&self.syntax1527	}1528}1529impl AstNode for FalseExpr {1530	fn can_cast(kind: SyntaxKind) -> bool {1531		kind == FALSE_EXPR1532	}1533	fn cast(syntax: SyntaxNode) -> Option<Self> {1534		if Self::can_cast(syntax.kind()) {1535			Some(Self { syntax })1536		} else {1537			None1538		}1539	}1540	fn syntax(&self) -> &SyntaxNode {1541		&self.syntax1542	}1543}1544impl AstNode for ExprFunction {1545	fn can_cast(kind: SyntaxKind) -> bool {1546		kind == EXPR_FUNCTION1547	}1548	fn cast(syntax: SyntaxNode) -> Option<Self> {1549		if Self::can_cast(syntax.kind()) {1550			Some(Self { syntax })1551		} else {1552			None1553		}1554	}1555	fn syntax(&self) -> &SyntaxNode {1556		&self.syntax1557	}1558}1559impl AstNode for ParamsDesc {1560	fn can_cast(kind: SyntaxKind) -> bool {1561		kind == PARAMS_DESC1562	}1563	fn cast(syntax: SyntaxNode) -> Option<Self> {1564		if Self::can_cast(syntax.kind()) {1565			Some(Self { syntax })1566		} else {1567			None1568		}1569	}1570	fn syntax(&self) -> &SyntaxNode {1571		&self.syntax1572	}1573}1574impl AstNode for ExprAssert {1575	fn can_cast(kind: SyntaxKind) -> bool {1576		kind == EXPR_ASSERT1577	}1578	fn cast(syntax: SyntaxNode) -> Option<Self> {1579		if Self::can_cast(syntax.kind()) {1580			Some(Self { syntax })1581		} else {1582			None1583		}1584	}1585	fn syntax(&self) -> &SyntaxNode {1586		&self.syntax1587	}1588}1589impl AstNode for Assertion {1590	fn can_cast(kind: SyntaxKind) -> bool {1591		kind == ASSERTION1592	}1593	fn cast(syntax: SyntaxNode) -> Option<Self> {1594		if Self::can_cast(syntax.kind()) {1595			Some(Self { syntax })1596		} else {1597			None1598		}1599	}1600	fn syntax(&self) -> &SyntaxNode {1601		&self.syntax1602	}1603}1604impl AstNode for ExprError {1605	fn can_cast(kind: SyntaxKind) -> bool {1606		kind == EXPR_ERROR1607	}1608	fn cast(syntax: SyntaxNode) -> Option<Self> {1609		if Self::can_cast(syntax.kind()) {1610			Some(Self { syntax })1611		} else {1612			None1613		}1614	}1615	fn syntax(&self) -> &SyntaxNode {1616		&self.syntax1617	}1618}1619impl AstNode for SliceDescEnd {1620	fn can_cast(kind: SyntaxKind) -> bool {1621		kind == SLICE_DESC_END1622	}1623	fn cast(syntax: SyntaxNode) -> Option<Self> {1624		if Self::can_cast(syntax.kind()) {1625			Some(Self { syntax })1626		} else {1627			None1628		}1629	}1630	fn syntax(&self) -> &SyntaxNode {1631		&self.syntax1632	}1633}1634impl AstNode for SliceDescStep {1635	fn can_cast(kind: SyntaxKind) -> bool {1636		kind == SLICE_DESC_STEP1637	}1638	fn cast(syntax: SyntaxNode) -> Option<Self> {1639		if Self::can_cast(syntax.kind()) {1640			Some(Self { syntax })1641		} else {1642			None1643		}1644	}1645	fn syntax(&self) -> &SyntaxNode {1646		&self.syntax1647	}1648}1649impl AstNode for Arg {1650	fn can_cast(kind: SyntaxKind) -> bool {1651		kind == ARG1652	}1653	fn cast(syntax: SyntaxNode) -> Option<Self> {1654		if Self::can_cast(syntax.kind()) {1655			Some(Self { syntax })1656		} else {1657			None1658		}1659	}1660	fn syntax(&self) -> &SyntaxNode {1661		&self.syntax1662	}1663}1664impl AstNode for ObjBodyComp {1665	fn can_cast(kind: SyntaxKind) -> bool {1666		kind == OBJ_BODY_COMP1667	}1668	fn cast(syntax: SyntaxNode) -> Option<Self> {1669		if Self::can_cast(syntax.kind()) {1670			Some(Self { syntax })1671		} else {1672			None1673		}1674	}1675	fn syntax(&self) -> &SyntaxNode {1676		&self.syntax1677	}1678}1679impl AstNode for ObjLocalPostComma {1680	fn can_cast(kind: SyntaxKind) -> bool {1681		kind == OBJ_LOCAL_POST_COMMA1682	}1683	fn cast(syntax: SyntaxNode) -> Option<Self> {1684		if Self::can_cast(syntax.kind()) {1685			Some(Self { syntax })1686		} else {1687			None1688		}1689	}1690	fn syntax(&self) -> &SyntaxNode {1691		&self.syntax1692	}1693}1694impl AstNode for ObjLocalPreComma {1695	fn can_cast(kind: SyntaxKind) -> bool {1696		kind == OBJ_LOCAL_PRE_COMMA1697	}1698	fn cast(syntax: SyntaxNode) -> Option<Self> {1699		if Self::can_cast(syntax.kind()) {1700			Some(Self { syntax })1701		} else {1702			None1703		}1704	}1705	fn syntax(&self) -> &SyntaxNode {1706		&self.syntax1707	}1708}1709impl AstNode for ObjBodyMemberList {1710	fn can_cast(kind: SyntaxKind) -> bool {1711		kind == OBJ_BODY_MEMBER_LIST1712	}1713	fn cast(syntax: SyntaxNode) -> Option<Self> {1714		if Self::can_cast(syntax.kind()) {1715			Some(Self { syntax })1716		} else {1717			None1718		}1719	}1720	fn syntax(&self) -> &SyntaxNode {1721		&self.syntax1722	}1723}1724impl AstNode for ObjLocal {1725	fn can_cast(kind: SyntaxKind) -> bool {1726		kind == OBJ_LOCAL1727	}1728	fn cast(syntax: SyntaxNode) -> Option<Self> {1729		if Self::can_cast(syntax.kind()) {1730			Some(Self { syntax })1731		} else {1732			None1733		}1734	}1735	fn syntax(&self) -> &SyntaxNode {1736		&self.syntax1737	}1738}1739impl AstNode for MemberBindStmt {1740	fn can_cast(kind: SyntaxKind) -> bool {1741		kind == MEMBER_BIND_STMT1742	}1743	fn cast(syntax: SyntaxNode) -> Option<Self> {1744		if Self::can_cast(syntax.kind()) {1745			Some(Self { syntax })1746		} else {1747			None1748		}1749	}1750	fn syntax(&self) -> &SyntaxNode {1751		&self.syntax1752	}1753}1754impl AstNode for MemberAssertStmt {1755	fn can_cast(kind: SyntaxKind) -> bool {1756		kind == MEMBER_ASSERT_STMT1757	}1758	fn cast(syntax: SyntaxNode) -> Option<Self> {1759		if Self::can_cast(syntax.kind()) {1760			Some(Self { syntax })1761		} else {1762			None1763		}1764	}1765	fn syntax(&self) -> &SyntaxNode {1766		&self.syntax1767	}1768}1769impl AstNode for MemberFieldNormal {1770	fn can_cast(kind: SyntaxKind) -> bool {1771		kind == MEMBER_FIELD_NORMAL1772	}1773	fn cast(syntax: SyntaxNode) -> Option<Self> {1774		if Self::can_cast(syntax.kind()) {1775			Some(Self { syntax })1776		} else {1777			None1778		}1779	}1780	fn syntax(&self) -> &SyntaxNode {1781		&self.syntax1782	}1783}1784impl AstNode for MemberFieldMethod {1785	fn can_cast(kind: SyntaxKind) -> bool {1786		kind == MEMBER_FIELD_METHOD1787	}1788	fn cast(syntax: SyntaxNode) -> Option<Self> {1789		if Self::can_cast(syntax.kind()) {1790			Some(Self { syntax })1791		} else {1792			None1793		}1794	}1795	fn syntax(&self) -> &SyntaxNode {1796		&self.syntax1797	}1798}1799impl AstNode for FieldNameFixed {1800	fn can_cast(kind: SyntaxKind) -> bool {1801		kind == FIELD_NAME_FIXED1802	}1803	fn cast(syntax: SyntaxNode) -> Option<Self> {1804		if Self::can_cast(syntax.kind()) {1805			Some(Self { syntax })1806		} else {1807			None1808		}1809	}1810	fn syntax(&self) -> &SyntaxNode {1811		&self.syntax1812	}1813}1814impl AstNode for FieldNameDynamic {1815	fn can_cast(kind: SyntaxKind) -> bool {1816		kind == FIELD_NAME_DYNAMIC1817	}1818	fn cast(syntax: SyntaxNode) -> Option<Self> {1819		if Self::can_cast(syntax.kind()) {1820			Some(Self { syntax })1821		} else {1822			None1823		}1824	}1825	fn syntax(&self) -> &SyntaxNode {1826		&self.syntax1827	}1828}1829impl AstNode for ForSpec {1830	fn can_cast(kind: SyntaxKind) -> bool {1831		kind == FOR_SPEC1832	}1833	fn cast(syntax: SyntaxNode) -> Option<Self> {1834		if Self::can_cast(syntax.kind()) {1835			Some(Self { syntax })1836		} else {1837			None1838		}1839	}1840	fn syntax(&self) -> &SyntaxNode {1841		&self.syntax1842	}1843}1844impl AstNode for IfSpec {1845	fn can_cast(kind: SyntaxKind) -> bool {1846		kind == IF_SPEC1847	}1848	fn cast(syntax: SyntaxNode) -> Option<Self> {1849		if Self::can_cast(syntax.kind()) {1850			Some(Self { syntax })1851		} else {1852			None1853		}1854	}1855	fn syntax(&self) -> &SyntaxNode {1856		&self.syntax1857	}1858}1859impl AstNode for BindDestruct {1860	fn can_cast(kind: SyntaxKind) -> bool {1861		kind == BIND_DESTRUCT1862	}1863	fn cast(syntax: SyntaxNode) -> Option<Self> {1864		if Self::can_cast(syntax.kind()) {1865			Some(Self { syntax })1866		} else {1867			None1868		}1869	}1870	fn syntax(&self) -> &SyntaxNode {1871		&self.syntax1872	}1873}1874impl AstNode for BindFunction {1875	fn can_cast(kind: SyntaxKind) -> bool {1876		kind == BIND_FUNCTION1877	}1878	fn cast(syntax: SyntaxNode) -> Option<Self> {1879		if Self::can_cast(syntax.kind()) {1880			Some(Self { syntax })1881		} else {1882			None1883		}1884	}1885	fn syntax(&self) -> &SyntaxNode {1886		&self.syntax1887	}1888}1889impl AstNode for Param {1890	fn can_cast(kind: SyntaxKind) -> bool {1891		kind == PARAM1892	}1893	fn cast(syntax: SyntaxNode) -> Option<Self> {1894		if Self::can_cast(syntax.kind()) {1895			Some(Self { syntax })1896		} else {1897			None1898		}1899	}1900	fn syntax(&self) -> &SyntaxNode {1901		&self.syntax1902	}1903}1904impl AstNode for DestructFull {1905	fn can_cast(kind: SyntaxKind) -> bool {1906		kind == DESTRUCT_FULL1907	}1908	fn cast(syntax: SyntaxNode) -> Option<Self> {1909		if Self::can_cast(syntax.kind()) {1910			Some(Self { syntax })1911		} else {1912			None1913		}1914	}1915	fn syntax(&self) -> &SyntaxNode {1916		&self.syntax1917	}1918}1919impl AstNode for DestructSkip {1920	fn can_cast(kind: SyntaxKind) -> bool {1921		kind == DESTRUCT_SKIP1922	}1923	fn cast(syntax: SyntaxNode) -> Option<Self> {1924		if Self::can_cast(syntax.kind()) {1925			Some(Self { syntax })1926		} else {1927			None1928		}1929	}1930	fn syntax(&self) -> &SyntaxNode {1931		&self.syntax1932	}1933}1934impl AstNode for DestructArray {1935	fn can_cast(kind: SyntaxKind) -> bool {1936		kind == DESTRUCT_ARRAY1937	}1938	fn cast(syntax: SyntaxNode) -> Option<Self> {1939		if Self::can_cast(syntax.kind()) {1940			Some(Self { syntax })1941		} else {1942			None1943		}1944	}1945	fn syntax(&self) -> &SyntaxNode {1946		&self.syntax1947	}1948}1949impl AstNode for DestructObject {1950	fn can_cast(kind: SyntaxKind) -> bool {1951		kind == DESTRUCT_OBJECT1952	}1953	fn cast(syntax: SyntaxNode) -> Option<Self> {1954		if Self::can_cast(syntax.kind()) {1955			Some(Self { syntax })1956		} else {1957			None1958		}1959	}1960	fn syntax(&self) -> &SyntaxNode {1961		&self.syntax1962	}1963}1964impl AstNode for DestructObjectField {1965	fn can_cast(kind: SyntaxKind) -> bool {1966		kind == DESTRUCT_OBJECT_FIELD1967	}1968	fn cast(syntax: SyntaxNode) -> Option<Self> {1969		if Self::can_cast(syntax.kind()) {1970			Some(Self { syntax })1971		} else {1972			None1973		}1974	}1975	fn syntax(&self) -> &SyntaxNode {1976		&self.syntax1977	}1978}1979impl AstNode for DestructRest {1980	fn can_cast(kind: SyntaxKind) -> bool {1981		kind == DESTRUCT_REST1982	}1983	fn cast(syntax: SyntaxNode) -> Option<Self> {1984		if Self::can_cast(syntax.kind()) {1985			Some(Self { syntax })1986		} else {1987			None1988		}1989	}1990	fn syntax(&self) -> &SyntaxNode {1991		&self.syntax1992	}1993}1994impl AstNode for DestructArrayElement {1995	fn can_cast(kind: SyntaxKind) -> bool {1996		kind == DESTRUCT_ARRAY_ELEMENT1997	}1998	fn cast(syntax: SyntaxNode) -> Option<Self> {1999		if Self::can_cast(syntax.kind()) {2000			Some(Self { syntax })2001		} else {2002			None2003		}2004	}2005	fn syntax(&self) -> &SyntaxNode {2006		&self.syntax2007	}2008}2009impl From<ExprBinary> for Expr {2010	fn from(node: ExprBinary) -> Expr {2011		Expr::ExprBinary(node)2012	}2013}2014impl From<ExprUnary> for Expr {2015	fn from(node: ExprUnary) -> Expr {2016		Expr::ExprUnary(node)2017	}2018}2019impl From<ExprSlice> for Expr {2020	fn from(node: ExprSlice) -> Expr {2021		Expr::ExprSlice(node)2022	}2023}2024impl From<ExprIndex> for Expr {2025	fn from(node: ExprIndex) -> Expr {2026		Expr::ExprIndex(node)2027	}2028}2029impl From<ExprIndexExpr> for Expr {2030	fn from(node: ExprIndexExpr) -> Expr {2031		Expr::ExprIndexExpr(node)2032	}2033}2034impl From<ExprApply> for Expr {2035	fn from(node: ExprApply) -> Expr {2036		Expr::ExprApply(node)2037	}2038}2039impl From<ExprObjExtend> for Expr {2040	fn from(node: ExprObjExtend) -> Expr {2041		Expr::ExprObjExtend(node)2042	}2043}2044impl From<ExprParened> for Expr {2045	fn from(node: ExprParened) -> Expr {2046		Expr::ExprParened(node)2047	}2048}2049impl From<ExprIntrinsicThisFile> for Expr {2050	fn from(node: ExprIntrinsicThisFile) -> Expr {2051		Expr::ExprIntrinsicThisFile(node)2052	}2053}2054impl From<ExprIntrinsicId> for Expr {2055	fn from(node: ExprIntrinsicId) -> Expr {2056		Expr::ExprIntrinsicId(node)2057	}2058}2059impl From<ExprIntrinsic> for Expr {2060	fn from(node: ExprIntrinsic) -> Expr {2061		Expr::ExprIntrinsic(node)2062	}2063}2064impl From<ExprString> for Expr {2065	fn from(node: ExprString) -> Expr {2066		Expr::ExprString(node)2067	}2068}2069impl From<ExprNumber> for Expr {2070	fn from(node: ExprNumber) -> Expr {2071		Expr::ExprNumber(node)2072	}2073}2074impl From<ExprLiteral> for Expr {2075	fn from(node: ExprLiteral) -> Expr {2076		Expr::ExprLiteral(node)2077	}2078}2079impl From<ExprArray> for Expr {2080	fn from(node: ExprArray) -> Expr {2081		Expr::ExprArray(node)2082	}2083}2084impl From<ExprObject> for Expr {2085	fn from(node: ExprObject) -> Expr {2086		Expr::ExprObject(node)2087	}2088}2089impl From<ExprArrayComp> for Expr {2090	fn from(node: ExprArrayComp) -> Expr {2091		Expr::ExprArrayComp(node)2092	}2093}2094impl From<ExprImport> for Expr {2095	fn from(node: ExprImport) -> Expr {2096		Expr::ExprImport(node)2097	}2098}2099impl From<ExprVar> for Expr {2100	fn from(node: ExprVar) -> Expr {2101		Expr::ExprVar(node)2102	}2103}2104impl From<ExprLocal> for Expr {2105	fn from(node: ExprLocal) -> Expr {2106		Expr::ExprLocal(node)2107	}2108}2109impl From<ExprIfThenElse> for Expr {2110	fn from(node: ExprIfThenElse) -> Expr {2111		Expr::ExprIfThenElse(node)2112	}2113}2114impl From<ExprFunction> for Expr {2115	fn from(node: ExprFunction) -> Expr {2116		Expr::ExprFunction(node)2117	}2118}2119impl From<ExprAssert> for Expr {2120	fn from(node: ExprAssert) -> Expr {2121		Expr::ExprAssert(node)2122	}2123}2124impl From<ExprError> for Expr {2125	fn from(node: ExprError) -> Expr {2126		Expr::ExprError(node)2127	}2128}2129impl AstNode for Expr {2130	fn can_cast(kind: SyntaxKind) -> bool {2131		match kind {2132			EXPR_BINARY2133			| EXPR_UNARY2134			| EXPR_SLICE2135			| EXPR_INDEX2136			| EXPR_INDEX_EXPR2137			| EXPR_APPLY2138			| EXPR_OBJ_EXTEND2139			| EXPR_PARENED2140			| EXPR_INTRINSIC_THIS_FILE2141			| EXPR_INTRINSIC_ID2142			| EXPR_INTRINSIC2143			| EXPR_STRING2144			| EXPR_NUMBER2145			| EXPR_LITERAL2146			| EXPR_ARRAY2147			| EXPR_OBJECT2148			| EXPR_ARRAY_COMP2149			| EXPR_IMPORT2150			| EXPR_VAR2151			| EXPR_LOCAL2152			| EXPR_IF_THEN_ELSE2153			| EXPR_FUNCTION2154			| EXPR_ASSERT2155			| EXPR_ERROR => true,2156			_ => false,2157		}2158	}2159	fn cast(syntax: SyntaxNode) -> Option<Self> {2160		let res = match syntax.kind() {2161			EXPR_BINARY => Expr::ExprBinary(ExprBinary { syntax }),2162			EXPR_UNARY => Expr::ExprUnary(ExprUnary { syntax }),2163			EXPR_SLICE => Expr::ExprSlice(ExprSlice { syntax }),2164			EXPR_INDEX => Expr::ExprIndex(ExprIndex { syntax }),2165			EXPR_INDEX_EXPR => Expr::ExprIndexExpr(ExprIndexExpr { syntax }),2166			EXPR_APPLY => Expr::ExprApply(ExprApply { syntax }),2167			EXPR_OBJ_EXTEND => Expr::ExprObjExtend(ExprObjExtend { syntax }),2168			EXPR_PARENED => Expr::ExprParened(ExprParened { syntax }),2169			EXPR_INTRINSIC_THIS_FILE => {2170				Expr::ExprIntrinsicThisFile(ExprIntrinsicThisFile { syntax })2171			}2172			EXPR_INTRINSIC_ID => Expr::ExprIntrinsicId(ExprIntrinsicId { syntax }),2173			EXPR_INTRINSIC => Expr::ExprIntrinsic(ExprIntrinsic { syntax }),2174			EXPR_STRING => Expr::ExprString(ExprString { syntax }),2175			EXPR_NUMBER => Expr::ExprNumber(ExprNumber { syntax }),2176			EXPR_LITERAL => Expr::ExprLiteral(ExprLiteral { syntax }),2177			EXPR_ARRAY => Expr::ExprArray(ExprArray { syntax }),2178			EXPR_OBJECT => Expr::ExprObject(ExprObject { syntax }),2179			EXPR_ARRAY_COMP => Expr::ExprArrayComp(ExprArrayComp { syntax }),2180			EXPR_IMPORT => Expr::ExprImport(ExprImport { syntax }),2181			EXPR_VAR => Expr::ExprVar(ExprVar { syntax }),2182			EXPR_LOCAL => Expr::ExprLocal(ExprLocal { syntax }),2183			EXPR_IF_THEN_ELSE => Expr::ExprIfThenElse(ExprIfThenElse { syntax }),2184			EXPR_FUNCTION => Expr::ExprFunction(ExprFunction { syntax }),2185			EXPR_ASSERT => Expr::ExprAssert(ExprAssert { syntax }),2186			EXPR_ERROR => Expr::ExprError(ExprError { syntax }),2187			_ => return None,2188		};2189		Some(res)2190	}2191	fn syntax(&self) -> &SyntaxNode {2192		match self {2193			Expr::ExprBinary(it) => &it.syntax,2194			Expr::ExprUnary(it) => &it.syntax,2195			Expr::ExprSlice(it) => &it.syntax,2196			Expr::ExprIndex(it) => &it.syntax,2197			Expr::ExprIndexExpr(it) => &it.syntax,2198			Expr::ExprApply(it) => &it.syntax,2199			Expr::ExprObjExtend(it) => &it.syntax,2200			Expr::ExprParened(it) => &it.syntax,2201			Expr::ExprIntrinsicThisFile(it) => &it.syntax,2202			Expr::ExprIntrinsicId(it) => &it.syntax,2203			Expr::ExprIntrinsic(it) => &it.syntax,2204			Expr::ExprString(it) => &it.syntax,2205			Expr::ExprNumber(it) => &it.syntax,2206			Expr::ExprLiteral(it) => &it.syntax,2207			Expr::ExprArray(it) => &it.syntax,2208			Expr::ExprObject(it) => &it.syntax,2209			Expr::ExprArrayComp(it) => &it.syntax,2210			Expr::ExprImport(it) => &it.syntax,2211			Expr::ExprVar(it) => &it.syntax,2212			Expr::ExprLocal(it) => &it.syntax,2213			Expr::ExprIfThenElse(it) => &it.syntax,2214			Expr::ExprFunction(it) => &it.syntax,2215			Expr::ExprAssert(it) => &it.syntax,2216			Expr::ExprError(it) => &it.syntax,2217		}2218	}2219}2220impl From<ObjBodyComp> for ObjBody {2221	fn from(node: ObjBodyComp) -> ObjBody {2222		ObjBody::ObjBodyComp(node)2223	}2224}2225impl From<ObjBodyMemberList> for ObjBody {2226	fn from(node: ObjBodyMemberList) -> ObjBody {2227		ObjBody::ObjBodyMemberList(node)2228	}2229}2230impl AstNode for ObjBody {2231	fn can_cast(kind: SyntaxKind) -> bool {2232		match kind {2233			OBJ_BODY_COMP | OBJ_BODY_MEMBER_LIST => true,2234			_ => false,2235		}2236	}2237	fn cast(syntax: SyntaxNode) -> Option<Self> {2238		let res = match syntax.kind() {2239			OBJ_BODY_COMP => ObjBody::ObjBodyComp(ObjBodyComp { syntax }),2240			OBJ_BODY_MEMBER_LIST => ObjBody::ObjBodyMemberList(ObjBodyMemberList { syntax }),2241			_ => return None,2242		};2243		Some(res)2244	}2245	fn syntax(&self) -> &SyntaxNode {2246		match self {2247			ObjBody::ObjBodyComp(it) => &it.syntax,2248			ObjBody::ObjBodyMemberList(it) => &it.syntax,2249		}2250	}2251}2252impl From<ForSpec> for CompSpec {2253	fn from(node: ForSpec) -> CompSpec {2254		CompSpec::ForSpec(node)2255	}2256}2257impl From<IfSpec> for CompSpec {2258	fn from(node: IfSpec) -> CompSpec {2259		CompSpec::IfSpec(node)2260	}2261}2262impl AstNode for CompSpec {2263	fn can_cast(kind: SyntaxKind) -> bool {2264		match kind {2265			FOR_SPEC | IF_SPEC => true,2266			_ => false,2267		}2268	}2269	fn cast(syntax: SyntaxNode) -> Option<Self> {2270		let res = match syntax.kind() {2271			FOR_SPEC => CompSpec::ForSpec(ForSpec { syntax }),2272			IF_SPEC => CompSpec::IfSpec(IfSpec { syntax }),2273			_ => return None,2274		};2275		Some(res)2276	}2277	fn syntax(&self) -> &SyntaxNode {2278		match self {2279			CompSpec::ForSpec(it) => &it.syntax,2280			CompSpec::IfSpec(it) => &it.syntax,2281		}2282	}2283}2284impl From<BindDestruct> for Bind {2285	fn from(node: BindDestruct) -> Bind {2286		Bind::BindDestruct(node)2287	}2288}2289impl From<BindFunction> for Bind {2290	fn from(node: BindFunction) -> Bind {2291		Bind::BindFunction(node)2292	}2293}2294impl AstNode for Bind {2295	fn can_cast(kind: SyntaxKind) -> bool {2296		match kind {2297			BIND_DESTRUCT | BIND_FUNCTION => true,2298			_ => false,2299		}2300	}2301	fn cast(syntax: SyntaxNode) -> Option<Self> {2302		let res = match syntax.kind() {2303			BIND_DESTRUCT => Bind::BindDestruct(BindDestruct { syntax }),2304			BIND_FUNCTION => Bind::BindFunction(BindFunction { syntax }),2305			_ => return None,2306		};2307		Some(res)2308	}2309	fn syntax(&self) -> &SyntaxNode {2310		match self {2311			Bind::BindDestruct(it) => &it.syntax,2312			Bind::BindFunction(it) => &it.syntax,2313		}2314	}2315}2316impl From<MemberBindStmt> for Member {2317	fn from(node: MemberBindStmt) -> Member {2318		Member::MemberBindStmt(node)2319	}2320}2321impl From<MemberAssertStmt> for Member {2322	fn from(node: MemberAssertStmt) -> Member {2323		Member::MemberAssertStmt(node)2324	}2325}2326impl From<MemberFieldNormal> for Member {2327	fn from(node: MemberFieldNormal) -> Member {2328		Member::MemberFieldNormal(node)2329	}2330}2331impl From<MemberFieldMethod> for Member {2332	fn from(node: MemberFieldMethod) -> Member {2333		Member::MemberFieldMethod(node)2334	}2335}2336impl AstNode for Member {2337	fn can_cast(kind: SyntaxKind) -> bool {2338		match kind {2339			MEMBER_BIND_STMT | MEMBER_ASSERT_STMT | MEMBER_FIELD_NORMAL | MEMBER_FIELD_METHOD => {2340				true2341			}2342			_ => false,2343		}2344	}2345	fn cast(syntax: SyntaxNode) -> Option<Self> {2346		let res = match syntax.kind() {2347			MEMBER_BIND_STMT => Member::MemberBindStmt(MemberBindStmt { syntax }),2348			MEMBER_ASSERT_STMT => Member::MemberAssertStmt(MemberAssertStmt { syntax }),2349			MEMBER_FIELD_NORMAL => Member::MemberFieldNormal(MemberFieldNormal { syntax }),2350			MEMBER_FIELD_METHOD => Member::MemberFieldMethod(MemberFieldMethod { syntax }),2351			_ => return None,2352		};2353		Some(res)2354	}2355	fn syntax(&self) -> &SyntaxNode {2356		match self {2357			Member::MemberBindStmt(it) => &it.syntax,2358			Member::MemberAssertStmt(it) => &it.syntax,2359			Member::MemberFieldNormal(it) => &it.syntax,2360			Member::MemberFieldMethod(it) => &it.syntax,2361		}2362	}2363}2364impl From<FieldNameFixed> for FieldName {2365	fn from(node: FieldNameFixed) -> FieldName {2366		FieldName::FieldNameFixed(node)2367	}2368}2369impl From<FieldNameDynamic> for FieldName {2370	fn from(node: FieldNameDynamic) -> FieldName {2371		FieldName::FieldNameDynamic(node)2372	}2373}2374impl AstNode for FieldName {2375	fn can_cast(kind: SyntaxKind) -> bool {2376		match kind {2377			FIELD_NAME_FIXED | FIELD_NAME_DYNAMIC => true,2378			_ => false,2379		}2380	}2381	fn cast(syntax: SyntaxNode) -> Option<Self> {2382		let res = match syntax.kind() {2383			FIELD_NAME_FIXED => FieldName::FieldNameFixed(FieldNameFixed { syntax }),2384			FIELD_NAME_DYNAMIC => FieldName::FieldNameDynamic(FieldNameDynamic { syntax }),2385			_ => return None,2386		};2387		Some(res)2388	}2389	fn syntax(&self) -> &SyntaxNode {2390		match self {2391			FieldName::FieldNameFixed(it) => &it.syntax,2392			FieldName::FieldNameDynamic(it) => &it.syntax,2393		}2394	}2395}2396impl From<DestructFull> for Destruct {2397	fn from(node: DestructFull) -> Destruct {2398		Destruct::DestructFull(node)2399	}2400}2401impl From<DestructSkip> for Destruct {2402	fn from(node: DestructSkip) -> Destruct {2403		Destruct::DestructSkip(node)2404	}2405}2406impl From<DestructArray> for Destruct {2407	fn from(node: DestructArray) -> Destruct {2408		Destruct::DestructArray(node)2409	}2410}2411impl From<DestructObject> for Destruct {2412	fn from(node: DestructObject) -> Destruct {2413		Destruct::DestructObject(node)2414	}2415}2416impl AstNode for Destruct {2417	fn can_cast(kind: SyntaxKind) -> bool {2418		match kind {2419			DESTRUCT_FULL | DESTRUCT_SKIP | DESTRUCT_ARRAY | DESTRUCT_OBJECT => true,2420			_ => false,2421		}2422	}2423	fn cast(syntax: SyntaxNode) -> Option<Self> {2424		let res = match syntax.kind() {2425			DESTRUCT_FULL => Destruct::DestructFull(DestructFull { syntax }),2426			DESTRUCT_SKIP => Destruct::DestructSkip(DestructSkip { syntax }),2427			DESTRUCT_ARRAY => Destruct::DestructArray(DestructArray { syntax }),2428			DESTRUCT_OBJECT => Destruct::DestructObject(DestructObject { syntax }),2429			_ => return None,2430		};2431		Some(res)2432	}2433	fn syntax(&self) -> &SyntaxNode {2434		match self {2435			Destruct::DestructFull(it) => &it.syntax,2436			Destruct::DestructSkip(it) => &it.syntax,2437			Destruct::DestructArray(it) => &it.syntax,2438			Destruct::DestructObject(it) => &it.syntax,2439		}2440	}2441}2442impl From<DestructArrayElement> for DestructArrayPart {2443	fn from(node: DestructArrayElement) -> DestructArrayPart {2444		DestructArrayPart::DestructArrayElement(node)2445	}2446}2447impl From<DestructRest> for DestructArrayPart {2448	fn from(node: DestructRest) -> DestructArrayPart {2449		DestructArrayPart::DestructRest(node)2450	}2451}2452impl AstNode for DestructArrayPart {2453	fn can_cast(kind: SyntaxKind) -> bool {2454		match kind {2455			DESTRUCT_ARRAY_ELEMENT | DESTRUCT_REST => true,2456			_ => false,2457		}2458	}2459	fn cast(syntax: SyntaxNode) -> Option<Self> {2460		let res = match syntax.kind() {2461			DESTRUCT_ARRAY_ELEMENT => {2462				DestructArrayPart::DestructArrayElement(DestructArrayElement { syntax })2463			}2464			DESTRUCT_REST => DestructArrayPart::DestructRest(DestructRest { syntax }),2465			_ => return None,2466		};2467		Some(res)2468	}2469	fn syntax(&self) -> &SyntaxNode {2470		match self {2471			DestructArrayPart::DestructArrayElement(it) => &it.syntax,2472			DestructArrayPart::DestructRest(it) => &it.syntax,2473		}2474	}2475}2476impl AstToken for BinaryOperator {2477	fn can_cast(kind: SyntaxKind) -> bool {2478		BinaryOperatorKind::can_cast(kind)2479	}2480	fn cast(syntax: SyntaxToken) -> Option<Self> {2481		let kind = BinaryOperatorKind::cast(syntax.kind())?;2482		Some(BinaryOperator { syntax, kind })2483	}2484	fn syntax(&self) -> &SyntaxToken {2485		&self.syntax2486	}2487}2488impl BinaryOperatorKind {2489	fn can_cast(kind: SyntaxKind) -> bool {2490		match kind {2491			OR | AND | BIT_OR | BIT_XOR | BIT_AND | EQ | NE | LT | GT | LE | GE | IN_KW | LHS2492			| RHS | PLUS | MINUS | MUL | DIV | MODULO | META_OBJECT_APPLY | ERROR_NO_OPERATOR => true,2493			_ => false,2494		}2495	}2496	pub fn cast(kind: SyntaxKind) -> Option<Self> {2497		let res = match kind {2498			OR => Self::Or,2499			AND => Self::And,2500			BIT_OR => Self::BitOr,2501			BIT_XOR => Self::BitXor,2502			BIT_AND => Self::BitAnd,2503			EQ => Self::Eq,2504			NE => Self::Ne,2505			LT => Self::Lt,2506			GT => Self::Gt,2507			LE => Self::Le,2508			GE => Self::Ge,2509			IN_KW => Self::InKw,2510			LHS => Self::Lhs,2511			RHS => Self::Rhs,2512			PLUS => Self::Plus,2513			MINUS => Self::Minus,2514			MUL => Self::Mul,2515			DIV => Self::Div,2516			MODULO => Self::Modulo,2517			META_OBJECT_APPLY => Self::MetaObjectApply,2518			ERROR_NO_OPERATOR => Self::ErrorNoOperator,2519			_ => return None,2520		};2521		Some(res)2522	}2523}2524impl BinaryOperator {2525	pub fn kind(&self) -> BinaryOperatorKind {2526		self.kind2527	}2528}2529impl std::fmt::Display for BinaryOperator {2530	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2531		std::fmt::Display::fmt(self.syntax(), f)2532	}2533}2534impl AstToken for UnaryOperator {2535	fn can_cast(kind: SyntaxKind) -> bool {2536		UnaryOperatorKind::can_cast(kind)2537	}2538	fn cast(syntax: SyntaxToken) -> Option<Self> {2539		let kind = UnaryOperatorKind::cast(syntax.kind())?;2540		Some(UnaryOperator { syntax, kind })2541	}2542	fn syntax(&self) -> &SyntaxToken {2543		&self.syntax2544	}2545}2546impl UnaryOperatorKind {2547	fn can_cast(kind: SyntaxKind) -> bool {2548		match kind {2549			MINUS | NOT | BIT_NOT => true,2550			_ => false,2551		}2552	}2553	pub fn cast(kind: SyntaxKind) -> Option<Self> {2554		let res = match kind {2555			MINUS => Self::Minus,2556			NOT => Self::Not,2557			BIT_NOT => Self::BitNot,2558			_ => return None,2559		};2560		Some(res)2561	}2562}2563impl UnaryOperator {2564	pub fn kind(&self) -> UnaryOperatorKind {2565		self.kind2566	}2567}2568impl std::fmt::Display for UnaryOperator {2569	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2570		std::fmt::Display::fmt(self.syntax(), f)2571	}2572}2573impl AstToken for Literal {2574	fn can_cast(kind: SyntaxKind) -> bool {2575		LiteralKind::can_cast(kind)2576	}2577	fn cast(syntax: SyntaxToken) -> Option<Self> {2578		let kind = LiteralKind::cast(syntax.kind())?;2579		Some(Literal { syntax, kind })2580	}2581	fn syntax(&self) -> &SyntaxToken {2582		&self.syntax2583	}2584}2585impl LiteralKind {2586	fn can_cast(kind: SyntaxKind) -> bool {2587		match kind {2588			NULL_KW | TRUE_KW | FALSE_KW | SELF_KW | DOLLAR | SUPER_KW => true,2589			_ => false,2590		}2591	}2592	pub fn cast(kind: SyntaxKind) -> Option<Self> {2593		let res = match kind {2594			NULL_KW => Self::NullKw,2595			TRUE_KW => Self::TrueKw,2596			FALSE_KW => Self::FalseKw,2597			SELF_KW => Self::SelfKw,2598			DOLLAR => Self::Dollar,2599			SUPER_KW => Self::SuperKw,2600			_ => return None,2601		};2602		Some(res)2603	}2604}2605impl Literal {2606	pub fn kind(&self) -> LiteralKind {2607		self.kind2608	}2609}2610impl std::fmt::Display for Literal {2611	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2612		std::fmt::Display::fmt(self.syntax(), f)2613	}2614}2615impl AstToken for Text {2616	fn can_cast(kind: SyntaxKind) -> bool {2617		TextKind::can_cast(kind)2618	}2619	fn cast(syntax: SyntaxToken) -> Option<Self> {2620		let kind = TextKind::cast(syntax.kind())?;2621		Some(Text { syntax, kind })2622	}2623	fn syntax(&self) -> &SyntaxToken {2624		&self.syntax2625	}2626}2627impl TextKind {2628	fn can_cast(kind: SyntaxKind) -> bool {2629		match kind {2630			STRING_DOUBLE2631			| ERROR_STRING_DOUBLE_UNTERMINATED2632			| STRING_SINGLE2633			| ERROR_STRING_SINGLE_UNTERMINATED2634			| STRING_DOUBLE_VERBATIM2635			| ERROR_STRING_DOUBLE_VERBATIM_UNTERMINATED2636			| STRING_SINGLE_VERBATIM2637			| ERROR_STRING_SINGLE_VERBATIM_UNTERMINATED2638			| ERROR_STRING_VERBATIM_MISSING_QUOTES2639			| STRING_BLOCK2640			| ERROR_STRING_BLOCK_UNEXPECTED_END2641			| ERROR_STRING_BLOCK_MISSING_NEW_LINE2642			| ERROR_STRING_BLOCK_MISSING_TERMINATION2643			| ERROR_STRING_BLOCK_MISSING_INDENT => true,2644			_ => false,2645		}2646	}2647	pub fn cast(kind: SyntaxKind) -> Option<Self> {2648		let res = match kind {2649			STRING_DOUBLE => Self::StringDouble,2650			ERROR_STRING_DOUBLE_UNTERMINATED => Self::ErrorStringDoubleUnterminated,2651			STRING_SINGLE => Self::StringSingle,2652			ERROR_STRING_SINGLE_UNTERMINATED => Self::ErrorStringSingleUnterminated,2653			STRING_DOUBLE_VERBATIM => Self::StringDoubleVerbatim,2654			ERROR_STRING_DOUBLE_VERBATIM_UNTERMINATED => {2655				Self::ErrorStringDoubleVerbatimUnterminated2656			}2657			STRING_SINGLE_VERBATIM => Self::StringSingleVerbatim,2658			ERROR_STRING_SINGLE_VERBATIM_UNTERMINATED => {2659				Self::ErrorStringSingleVerbatimUnterminated2660			}2661			ERROR_STRING_VERBATIM_MISSING_QUOTES => Self::ErrorStringVerbatimMissingQuotes,2662			STRING_BLOCK => Self::StringBlock,2663			ERROR_STRING_BLOCK_UNEXPECTED_END => Self::ErrorStringBlockUnexpectedEnd,2664			ERROR_STRING_BLOCK_MISSING_NEW_LINE => Self::ErrorStringBlockMissingNewLine,2665			ERROR_STRING_BLOCK_MISSING_TERMINATION => Self::ErrorStringBlockMissingTermination,2666			ERROR_STRING_BLOCK_MISSING_INDENT => Self::ErrorStringBlockMissingIndent,2667			_ => return None,2668		};2669		Some(res)2670	}2671}2672impl Text {2673	pub fn kind(&self) -> TextKind {2674		self.kind2675	}2676}2677impl std::fmt::Display for Text {2678	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2679		std::fmt::Display::fmt(self.syntax(), f)2680	}2681}2682impl AstToken for Number {2683	fn can_cast(kind: SyntaxKind) -> bool {2684		NumberKind::can_cast(kind)2685	}2686	fn cast(syntax: SyntaxToken) -> Option<Self> {2687		let kind = NumberKind::cast(syntax.kind())?;2688		Some(Number { syntax, kind })2689	}2690	fn syntax(&self) -> &SyntaxToken {2691		&self.syntax2692	}2693}2694impl NumberKind {2695	fn can_cast(kind: SyntaxKind) -> bool {2696		match kind {2697			FLOAT2698			| ERROR_FLOAT_JUNK_AFTER_POINT2699			| ERROR_FLOAT_JUNK_AFTER_EXPONENT2700			| ERROR_FLOAT_JUNK_AFTER_EXPONENT_SIGN => true,2701			_ => false,2702		}2703	}2704	pub fn cast(kind: SyntaxKind) -> Option<Self> {2705		let res = match kind {2706			FLOAT => Self::Float,2707			ERROR_FLOAT_JUNK_AFTER_POINT => Self::ErrorFloatJunkAfterPoint,2708			ERROR_FLOAT_JUNK_AFTER_EXPONENT => Self::ErrorFloatJunkAfterExponent,2709			ERROR_FLOAT_JUNK_AFTER_EXPONENT_SIGN => Self::ErrorFloatJunkAfterExponentSign,2710			_ => return None,2711		};2712		Some(res)2713	}2714}2715impl Number {2716	pub fn kind(&self) -> NumberKind {2717		self.kind2718	}2719}2720impl std::fmt::Display for Number {2721	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2722		std::fmt::Display::fmt(self.syntax(), f)2723	}2724}2725impl AstToken for ImportKind {2726	fn can_cast(kind: SyntaxKind) -> bool {2727		ImportKindKind::can_cast(kind)2728	}2729	fn cast(syntax: SyntaxToken) -> Option<Self> {2730		let kind = ImportKindKind::cast(syntax.kind())?;2731		Some(ImportKind { syntax, kind })2732	}2733	fn syntax(&self) -> &SyntaxToken {2734		&self.syntax2735	}2736}2737impl ImportKindKind {2738	fn can_cast(kind: SyntaxKind) -> bool {2739		match kind {2740			IMPORTSTR_KW | IMPORTBIN_KW | IMPORT_KW => true,2741			_ => false,2742		}2743	}2744	pub fn cast(kind: SyntaxKind) -> Option<Self> {2745		let res = match kind {2746			IMPORTSTR_KW => Self::ImportstrKw,2747			IMPORTBIN_KW => Self::ImportbinKw,2748			IMPORT_KW => Self::ImportKw,2749			_ => return None,2750		};2751		Some(res)2752	}2753}2754impl ImportKind {2755	pub fn kind(&self) -> ImportKindKind {2756		self.kind2757	}2758}2759impl std::fmt::Display for ImportKind {2760	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2761		std::fmt::Display::fmt(self.syntax(), f)2762	}2763}2764impl AstToken for Visibility {2765	fn can_cast(kind: SyntaxKind) -> bool {2766		VisibilityKind::can_cast(kind)2767	}2768	fn cast(syntax: SyntaxToken) -> Option<Self> {2769		let kind = VisibilityKind::cast(syntax.kind())?;2770		Some(Visibility { syntax, kind })2771	}2772	fn syntax(&self) -> &SyntaxToken {2773		&self.syntax2774	}2775}2776impl VisibilityKind {2777	fn can_cast(kind: SyntaxKind) -> bool {2778		match kind {2779			COLONCOLONCOLON | COLONCOLON | COLON => true,2780			_ => false,2781		}2782	}2783	pub fn cast(kind: SyntaxKind) -> Option<Self> {2784		let res = match kind {2785			COLONCOLONCOLON => Self::Coloncoloncolon,2786			COLONCOLON => Self::Coloncolon,2787			COLON => Self::Colon,2788			_ => return None,2789		};2790		Some(res)2791	}2792}2793impl Visibility {2794	pub fn kind(&self) -> VisibilityKind {2795		self.kind2796	}2797}2798impl std::fmt::Display for Visibility {2799	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2800		std::fmt::Display::fmt(self.syntax(), f)2801	}2802}2803impl AstToken for Trivia {2804	fn can_cast(kind: SyntaxKind) -> bool {2805		TriviaKind::can_cast(kind)2806	}2807	fn cast(syntax: SyntaxToken) -> Option<Self> {2808		let kind = TriviaKind::cast(syntax.kind())?;2809		Some(Trivia { syntax, kind })2810	}2811	fn syntax(&self) -> &SyntaxToken {2812		&self.syntax2813	}2814}2815impl TriviaKind {2816	fn can_cast(kind: SyntaxKind) -> bool {2817		match kind {2818			WHITESPACE2819			| MULTI_LINE_COMMENT2820			| ERROR_COMMENT_TOO_SHORT2821			| ERROR_COMMENT_UNTERMINATED2822			| SINGLE_LINE_HASH_COMMENT2823			| SINGLE_LINE_SLASH_COMMENT => true,2824			_ => false,2825		}2826	}2827	pub fn cast(kind: SyntaxKind) -> Option<Self> {2828		let res = match kind {2829			WHITESPACE => Self::Whitespace,2830			MULTI_LINE_COMMENT => Self::MultiLineComment,2831			ERROR_COMMENT_TOO_SHORT => Self::ErrorCommentTooShort,2832			ERROR_COMMENT_UNTERMINATED => Self::ErrorCommentUnterminated,2833			SINGLE_LINE_HASH_COMMENT => Self::SingleLineHashComment,2834			SINGLE_LINE_SLASH_COMMENT => Self::SingleLineSlashComment,2835			_ => return None,2836		};2837		Some(res)2838	}2839}2840impl Trivia {2841	pub fn kind(&self) -> TriviaKind {2842		self.kind2843	}2844}2845impl std::fmt::Display for Trivia {2846	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2847		std::fmt::Display::fmt(self.syntax(), f)2848	}2849}2850impl AstToken for ParsingError {2851	fn can_cast(kind: SyntaxKind) -> bool {2852		ParsingErrorKind::can_cast(kind)2853	}2854	fn cast(syntax: SyntaxToken) -> Option<Self> {2855		let kind = ParsingErrorKind::cast(syntax.kind())?;2856		Some(ParsingError { syntax, kind })2857	}2858	fn syntax(&self) -> &SyntaxToken {2859		&self.syntax2860	}2861}2862impl ParsingErrorKind {2863	fn can_cast(kind: SyntaxKind) -> bool {2864		match kind {2865			ERROR_MISSING_TOKEN | ERROR_UNEXPECTED_TOKEN | ERROR_CUSTOM => true,2866			_ => false,2867		}2868	}2869	pub fn cast(kind: SyntaxKind) -> Option<Self> {2870		let res = match kind {2871			ERROR_MISSING_TOKEN => Self::ErrorMissingToken,2872			ERROR_UNEXPECTED_TOKEN => Self::ErrorUnexpectedToken,2873			ERROR_CUSTOM => Self::ErrorCustom,2874			_ => return None,2875		};2876		Some(res)2877	}2878}2879impl ParsingError {2880	pub fn kind(&self) -> ParsingErrorKind {2881		self.kind2882	}2883}2884impl std::fmt::Display for ParsingError {2885	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2886		std::fmt::Display::fmt(self.syntax(), f)2887	}2888}2889impl std::fmt::Display for Expr {2890	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2891		std::fmt::Display::fmt(self.syntax(), f)2892	}2893}2894impl std::fmt::Display for ObjBody {2895	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2896		std::fmt::Display::fmt(self.syntax(), f)2897	}2898}2899impl std::fmt::Display for CompSpec {2900	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2901		std::fmt::Display::fmt(self.syntax(), f)2902	}2903}2904impl std::fmt::Display for Bind {2905	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2906		std::fmt::Display::fmt(self.syntax(), f)2907	}2908}2909impl std::fmt::Display for Member {2910	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2911		std::fmt::Display::fmt(self.syntax(), f)2912	}2913}2914impl std::fmt::Display for FieldName {2915	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2916		std::fmt::Display::fmt(self.syntax(), f)2917	}2918}2919impl std::fmt::Display for Destruct {2920	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2921		std::fmt::Display::fmt(self.syntax(), f)2922	}2923}2924impl std::fmt::Display for DestructArrayPart {2925	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2926		std::fmt::Display::fmt(self.syntax(), f)2927	}2928}2929impl std::fmt::Display for SourceFile {2930	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2931		std::fmt::Display::fmt(self.syntax(), f)2932	}2933}2934impl std::fmt::Display for ExprBinary {2935	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2936		std::fmt::Display::fmt(self.syntax(), f)2937	}2938}2939impl std::fmt::Display for LhsExpr {2940	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2941		std::fmt::Display::fmt(self.syntax(), f)2942	}2943}2944impl std::fmt::Display for ExprUnary {2945	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2946		std::fmt::Display::fmt(self.syntax(), f)2947	}2948}2949impl std::fmt::Display for ExprSlice {2950	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2951		std::fmt::Display::fmt(self.syntax(), f)2952	}2953}2954impl std::fmt::Display for SliceDesc {2955	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2956		std::fmt::Display::fmt(self.syntax(), f)2957	}2958}2959impl std::fmt::Display for ExprIndex {2960	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2961		std::fmt::Display::fmt(self.syntax(), f)2962	}2963}2964impl std::fmt::Display for Name {2965	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2966		std::fmt::Display::fmt(self.syntax(), f)2967	}2968}2969impl std::fmt::Display for ExprIndexExpr {2970	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2971		std::fmt::Display::fmt(self.syntax(), f)2972	}2973}2974impl std::fmt::Display for ExprApply {2975	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2976		std::fmt::Display::fmt(self.syntax(), f)2977	}2978}2979impl std::fmt::Display for ArgsDesc {2980	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2981		std::fmt::Display::fmt(self.syntax(), f)2982	}2983}2984impl std::fmt::Display for ExprObjExtend {2985	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2986		std::fmt::Display::fmt(self.syntax(), f)2987	}2988}2989impl std::fmt::Display for ExprParened {2990	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2991		std::fmt::Display::fmt(self.syntax(), f)2992	}2993}2994impl std::fmt::Display for ExprLiteral {2995	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2996		std::fmt::Display::fmt(self.syntax(), f)2997	}2998}2999impl std::fmt::Display for ExprIntrinsicThisFile {3000	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {3001		std::fmt::Display::fmt(self.syntax(), f)3002	}3003}3004impl std::fmt::Display for ExprIntrinsicId {3005	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {3006		std::fmt::Display::fmt(self.syntax(), f)3007	}3008}3009impl std::fmt::Display for ExprIntrinsic {3010	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {3011		std::fmt::Display::fmt(self.syntax(), f)3012	}3013}3014impl std::fmt::Display for ExprString {3015	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {3016		std::fmt::Display::fmt(self.syntax(), f)3017	}3018}3019impl std::fmt::Display for ExprNumber {3020	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {3021		std::fmt::Display::fmt(self.syntax(), f)3022	}3023}3024impl std::fmt::Display for ExprArray {3025	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {3026		std::fmt::Display::fmt(self.syntax(), f)3027	}3028}3029impl std::fmt::Display for ExprObject {3030	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {3031		std::fmt::Display::fmt(self.syntax(), f)3032	}3033}3034impl std::fmt::Display for ExprArrayComp {3035	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {3036		std::fmt::Display::fmt(self.syntax(), f)3037	}3038}3039impl std::fmt::Display for ExprImport {3040	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {3041		std::fmt::Display::fmt(self.syntax(), f)3042	}3043}3044impl std::fmt::Display for ExprVar {3045	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {3046		std::fmt::Display::fmt(self.syntax(), f)3047	}3048}3049impl std::fmt::Display for ExprLocal {3050	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {3051		std::fmt::Display::fmt(self.syntax(), f)3052	}3053}3054impl std::fmt::Display for ExprIfThenElse {3055	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {3056		std::fmt::Display::fmt(self.syntax(), f)3057	}3058}3059impl std::fmt::Display for TrueExpr {3060	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {3061		std::fmt::Display::fmt(self.syntax(), f)3062	}3063}3064impl std::fmt::Display for FalseExpr {3065	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {3066		std::fmt::Display::fmt(self.syntax(), f)3067	}3068}3069impl std::fmt::Display for ExprFunction {3070	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {3071		std::fmt::Display::fmt(self.syntax(), f)3072	}3073}3074impl std::fmt::Display for ParamsDesc {3075	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {3076		std::fmt::Display::fmt(self.syntax(), f)3077	}3078}3079impl std::fmt::Display for ExprAssert {3080	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {3081		std::fmt::Display::fmt(self.syntax(), f)3082	}3083}3084impl std::fmt::Display for Assertion {3085	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {3086		std::fmt::Display::fmt(self.syntax(), f)3087	}3088}3089impl std::fmt::Display for ExprError {3090	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {3091		std::fmt::Display::fmt(self.syntax(), f)3092	}3093}3094impl std::fmt::Display for SliceDescEnd {3095	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {3096		std::fmt::Display::fmt(self.syntax(), f)3097	}3098}3099impl std::fmt::Display for SliceDescStep {3100	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {3101		std::fmt::Display::fmt(self.syntax(), f)3102	}3103}3104impl std::fmt::Display for Arg {3105	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {3106		std::fmt::Display::fmt(self.syntax(), f)3107	}3108}3109impl std::fmt::Display for ObjBodyComp {3110	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {3111		std::fmt::Display::fmt(self.syntax(), f)3112	}3113}3114impl std::fmt::Display for ObjLocalPostComma {3115	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {3116		std::fmt::Display::fmt(self.syntax(), f)3117	}3118}3119impl std::fmt::Display for ObjLocalPreComma {3120	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {3121		std::fmt::Display::fmt(self.syntax(), f)3122	}3123}3124impl std::fmt::Display for ObjBodyMemberList {3125	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {3126		std::fmt::Display::fmt(self.syntax(), f)3127	}3128}3129impl std::fmt::Display for ObjLocal {3130	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {3131		std::fmt::Display::fmt(self.syntax(), f)3132	}3133}3134impl std::fmt::Display for MemberBindStmt {3135	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {3136		std::fmt::Display::fmt(self.syntax(), f)3137	}3138}3139impl std::fmt::Display for MemberAssertStmt {3140	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {3141		std::fmt::Display::fmt(self.syntax(), f)3142	}3143}3144impl std::fmt::Display for MemberFieldNormal {3145	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {3146		std::fmt::Display::fmt(self.syntax(), f)3147	}3148}3149impl std::fmt::Display for MemberFieldMethod {3150	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {3151		std::fmt::Display::fmt(self.syntax(), f)3152	}3153}3154impl std::fmt::Display for FieldNameFixed {3155	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {3156		std::fmt::Display::fmt(self.syntax(), f)3157	}3158}3159impl std::fmt::Display for FieldNameDynamic {3160	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {3161		std::fmt::Display::fmt(self.syntax(), f)3162	}3163}3164impl std::fmt::Display for ForSpec {3165	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {3166		std::fmt::Display::fmt(self.syntax(), f)3167	}3168}3169impl std::fmt::Display for IfSpec {3170	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {3171		std::fmt::Display::fmt(self.syntax(), f)3172	}3173}3174impl std::fmt::Display for BindDestruct {3175	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {3176		std::fmt::Display::fmt(self.syntax(), f)3177	}3178}3179impl std::fmt::Display for BindFunction {3180	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {3181		std::fmt::Display::fmt(self.syntax(), f)3182	}3183}3184impl std::fmt::Display for Param {3185	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {3186		std::fmt::Display::fmt(self.syntax(), f)3187	}3188}3189impl std::fmt::Display for DestructFull {3190	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {3191		std::fmt::Display::fmt(self.syntax(), f)3192	}3193}3194impl std::fmt::Display for DestructSkip {3195	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {3196		std::fmt::Display::fmt(self.syntax(), f)3197	}3198}3199impl std::fmt::Display for DestructArray {3200	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {3201		std::fmt::Display::fmt(self.syntax(), f)3202	}3203}3204impl std::fmt::Display for DestructObject {3205	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {3206		std::fmt::Display::fmt(self.syntax(), f)3207	}3208}3209impl std::fmt::Display for DestructObjectField {3210	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {3211		std::fmt::Display::fmt(self.syntax(), f)3212	}3213}3214impl std::fmt::Display for DestructRest {3215	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {3216		std::fmt::Display::fmt(self.syntax(), f)3217	}3218}3219impl std::fmt::Display for DestructArrayElement {3220	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {3221		std::fmt::Display::fmt(self.syntax(), f)3222	}3223}
after · crates/jrsonnet-rowan-parser/src/generated/nodes.rs
1//! This is a generated file, please do not edit manually. Changes can be2//! made in codegeneration that lives in `xtask` top-level dir.34#![allow(non_snake_case, clippy::match_like_matches_macro)]5use crate::{6	ast::{support, AstChildren, AstNode, AstToken},7	SyntaxKind::{self, *},8	SyntaxNode, SyntaxToken, T,9};1011#[derive(Debug, Clone, PartialEq, Eq, Hash)]12pub struct SourceFile {13	pub(crate) syntax: SyntaxNode,14}15impl SourceFile {16	pub fn expr(&self) -> Option<Expr> {17		support::child(&self.syntax)18	}19}2021#[derive(Debug, Clone, PartialEq, Eq, Hash)]22pub struct ExprBinary {23	pub(crate) syntax: SyntaxNode,24}25impl ExprBinary {26	pub fn lhs(&self) -> Option<LhsExpr> {27		support::child(&self.syntax)28	}29	pub fn binary_operator(&self) -> Option<BinaryOperator> {30		support::token_child(&self.syntax)31	}32	pub fn rhs(&self) -> Option<Expr> {33		support::child(&self.syntax)34	}35}3637#[derive(Debug, Clone, PartialEq, Eq, Hash)]38pub struct LhsExpr {39	pub(crate) syntax: SyntaxNode,40}41impl LhsExpr {42	pub fn expr(&self) -> Option<Expr> {43		support::child(&self.syntax)44	}45}4647#[derive(Debug, Clone, PartialEq, Eq, Hash)]48pub struct ExprUnary {49	pub(crate) syntax: SyntaxNode,50}51impl ExprUnary {52	pub fn unary_operator(&self) -> Option<UnaryOperator> {53		support::token_child(&self.syntax)54	}55	pub fn rhs(&self) -> Option<Expr> {56		support::child(&self.syntax)57	}58}5960#[derive(Debug, Clone, PartialEq, Eq, Hash)]61pub struct ExprSlice {62	pub(crate) syntax: SyntaxNode,63}64impl ExprSlice {65	pub fn expr(&self) -> Option<Expr> {66		support::child(&self.syntax)67	}68	pub fn slice_desc(&self) -> Option<SliceDesc> {69		support::child(&self.syntax)70	}71}7273#[derive(Debug, Clone, PartialEq, Eq, Hash)]74pub struct SliceDesc {75	pub(crate) syntax: SyntaxNode,76}77impl SliceDesc {78	pub fn l_brack_token(&self) -> Option<SyntaxToken> {79		support::token(&self.syntax, T!['['])80	}81	pub fn from(&self) -> Option<Expr> {82		support::child(&self.syntax)83	}84	pub fn colon_token(&self) -> Option<SyntaxToken> {85		support::token(&self.syntax, T![:])86	}87	pub fn end(&self) -> Option<SliceDescEnd> {88		support::child(&self.syntax)89	}90	pub fn step(&self) -> Option<SliceDescStep> {91		support::child(&self.syntax)92	}93	pub fn r_brack_token(&self) -> Option<SyntaxToken> {94		support::token(&self.syntax, T![']'])95	}96}9798#[derive(Debug, Clone, PartialEq, Eq, Hash)]99pub struct ExprIndex {100	pub(crate) syntax: SyntaxNode,101}102impl ExprIndex {103	pub fn expr(&self) -> Option<Expr> {104		support::child(&self.syntax)105	}106	pub fn dot_token(&self) -> Option<SyntaxToken> {107		support::token(&self.syntax, T![.])108	}109	pub fn index(&self) -> Option<Name> {110		support::child(&self.syntax)111	}112}113114#[derive(Debug, Clone, PartialEq, Eq, Hash)]115pub struct Name {116	pub(crate) syntax: SyntaxNode,117}118impl Name {119	pub fn ident_lit(&self) -> Option<SyntaxToken> {120		support::token(&self.syntax, IDENT)121	}122}123124#[derive(Debug, Clone, PartialEq, Eq, Hash)]125pub struct ExprIndexExpr {126	pub(crate) syntax: SyntaxNode,127}128impl ExprIndexExpr {129	pub fn base(&self) -> Option<LhsExpr> {130		support::child(&self.syntax)131	}132	pub fn l_brack_token(&self) -> Option<SyntaxToken> {133		support::token(&self.syntax, T!['['])134	}135	pub fn index(&self) -> Option<Expr> {136		support::child(&self.syntax)137	}138	pub fn r_brack_token(&self) -> Option<SyntaxToken> {139		support::token(&self.syntax, T![']'])140	}141}142143#[derive(Debug, Clone, PartialEq, Eq, Hash)]144pub struct ExprApply {145	pub(crate) syntax: SyntaxNode,146}147impl ExprApply {148	pub fn expr(&self) -> Option<Expr> {149		support::child(&self.syntax)150	}151	pub fn args_desc(&self) -> Option<ArgsDesc> {152		support::child(&self.syntax)153	}154	pub fn tailstrict_kw_token(&self) -> Option<SyntaxToken> {155		support::token(&self.syntax, T![tailstrict])156	}157}158159#[derive(Debug, Clone, PartialEq, Eq, Hash)]160pub struct ArgsDesc {161	pub(crate) syntax: SyntaxNode,162}163impl ArgsDesc {164	pub fn l_paren_token(&self) -> Option<SyntaxToken> {165		support::token(&self.syntax, T!['('])166	}167	pub fn args(&self) -> AstChildren<Arg> {168		support::children(&self.syntax)169	}170	pub fn r_paren_token(&self) -> Option<SyntaxToken> {171		support::token(&self.syntax, T![')'])172	}173}174175#[derive(Debug, Clone, PartialEq, Eq, Hash)]176pub struct ExprObjExtend {177	pub(crate) syntax: SyntaxNode,178}179impl ExprObjExtend {180	pub fn lhs_expr(&self) -> Option<LhsExpr> {181		support::child(&self.syntax)182	}183	pub fn expr(&self) -> Option<Expr> {184		support::child(&self.syntax)185	}186}187188#[derive(Debug, Clone, PartialEq, Eq, Hash)]189pub struct ExprParened {190	pub(crate) syntax: SyntaxNode,191}192impl ExprParened {193	pub fn l_paren_token(&self) -> Option<SyntaxToken> {194		support::token(&self.syntax, T!['('])195	}196	pub fn expr(&self) -> Option<Expr> {197		support::child(&self.syntax)198	}199	pub fn r_paren_token(&self) -> Option<SyntaxToken> {200		support::token(&self.syntax, T![')'])201	}202}203204#[derive(Debug, Clone, PartialEq, Eq, Hash)]205pub struct ExprLiteral {206	pub(crate) syntax: SyntaxNode,207}208impl ExprLiteral {209	pub fn literal(&self) -> Option<Literal> {210		support::token_child(&self.syntax)211	}212}213214#[derive(Debug, Clone, PartialEq, Eq, Hash)]215pub struct ExprString {216	pub(crate) syntax: SyntaxNode,217}218impl ExprString {219	pub fn text(&self) -> Option<Text> {220		support::token_child(&self.syntax)221	}222}223224#[derive(Debug, Clone, PartialEq, Eq, Hash)]225pub struct ExprNumber {226	pub(crate) syntax: SyntaxNode,227}228impl ExprNumber {229	pub fn number(&self) -> Option<Number> {230		support::token_child(&self.syntax)231	}232}233234#[derive(Debug, Clone, PartialEq, Eq, Hash)]235pub struct ExprArray {236	pub(crate) syntax: SyntaxNode,237}238impl ExprArray {239	pub fn l_brack_token(&self) -> Option<SyntaxToken> {240		support::token(&self.syntax, T!['['])241	}242	pub fn exprs(&self) -> AstChildren<Expr> {243		support::children(&self.syntax)244	}245	pub fn r_brack_token(&self) -> Option<SyntaxToken> {246		support::token(&self.syntax, T![']'])247	}248}249250#[derive(Debug, Clone, PartialEq, Eq, Hash)]251pub struct ExprObject {252	pub(crate) syntax: SyntaxNode,253}254impl ExprObject {255	pub fn obj_body(&self) -> Option<ObjBody> {256		support::child(&self.syntax)257	}258}259260#[derive(Debug, Clone, PartialEq, Eq, Hash)]261pub struct ExprArrayComp {262	pub(crate) syntax: SyntaxNode,263}264impl ExprArrayComp {265	pub fn l_brack_token(&self) -> Option<SyntaxToken> {266		support::token(&self.syntax, T!['['])267	}268	pub fn expr(&self) -> Option<Expr> {269		support::child(&self.syntax)270	}271	pub fn comma_token(&self) -> Option<SyntaxToken> {272		support::token(&self.syntax, T![,])273	}274	pub fn comp_specs(&self) -> AstChildren<CompSpec> {275		support::children(&self.syntax)276	}277	pub fn r_brack_token(&self) -> Option<SyntaxToken> {278		support::token(&self.syntax, T![']'])279	}280}281282#[derive(Debug, Clone, PartialEq, Eq, Hash)]283pub struct ExprImport {284	pub(crate) syntax: SyntaxNode,285}286impl ExprImport {287	pub fn import_kind(&self) -> Option<ImportKind> {288		support::token_child(&self.syntax)289	}290	pub fn text(&self) -> Option<Text> {291		support::token_child(&self.syntax)292	}293}294295#[derive(Debug, Clone, PartialEq, Eq, Hash)]296pub struct ExprVar {297	pub(crate) syntax: SyntaxNode,298}299impl ExprVar {300	pub fn name(&self) -> Option<Name> {301		support::child(&self.syntax)302	}303}304305#[derive(Debug, Clone, PartialEq, Eq, Hash)]306pub struct ExprLocal {307	pub(crate) syntax: SyntaxNode,308}309impl ExprLocal {310	pub fn local_kw_token(&self) -> Option<SyntaxToken> {311		support::token(&self.syntax, T![local])312	}313	pub fn binds(&self) -> AstChildren<Bind> {314		support::children(&self.syntax)315	}316	pub fn semi_token(&self) -> Option<SyntaxToken> {317		support::token(&self.syntax, T![;])318	}319	pub fn expr(&self) -> Option<Expr> {320		support::child(&self.syntax)321	}322}323324#[derive(Debug, Clone, PartialEq, Eq, Hash)]325pub struct ExprIfThenElse {326	pub(crate) syntax: SyntaxNode,327}328impl ExprIfThenElse {329	pub fn if_kw_token(&self) -> Option<SyntaxToken> {330		support::token(&self.syntax, T![if])331	}332	pub fn cond(&self) -> Option<Expr> {333		support::child(&self.syntax)334	}335	pub fn then_kw_token(&self) -> Option<SyntaxToken> {336		support::token(&self.syntax, T![then])337	}338	pub fn then(&self) -> Option<TrueExpr> {339		support::child(&self.syntax)340	}341	pub fn else_kw_token(&self) -> Option<SyntaxToken> {342		support::token(&self.syntax, T![else])343	}344	pub fn else_(&self) -> Option<FalseExpr> {345		support::child(&self.syntax)346	}347}348349#[derive(Debug, Clone, PartialEq, Eq, Hash)]350pub struct TrueExpr {351	pub(crate) syntax: SyntaxNode,352}353impl TrueExpr {354	pub fn expr(&self) -> Option<Expr> {355		support::child(&self.syntax)356	}357}358359#[derive(Debug, Clone, PartialEq, Eq, Hash)]360pub struct FalseExpr {361	pub(crate) syntax: SyntaxNode,362}363impl FalseExpr {364	pub fn expr(&self) -> Option<Expr> {365		support::child(&self.syntax)366	}367}368369#[derive(Debug, Clone, PartialEq, Eq, Hash)]370pub struct ExprFunction {371	pub(crate) syntax: SyntaxNode,372}373impl ExprFunction {374	pub fn function_kw_token(&self) -> Option<SyntaxToken> {375		support::token(&self.syntax, T![function])376	}377	pub fn l_paren_token(&self) -> Option<SyntaxToken> {378		support::token(&self.syntax, T!['('])379	}380	pub fn params_desc(&self) -> Option<ParamsDesc> {381		support::child(&self.syntax)382	}383	pub fn r_paren_token(&self) -> Option<SyntaxToken> {384		support::token(&self.syntax, T![')'])385	}386	pub fn expr(&self) -> Option<Expr> {387		support::child(&self.syntax)388	}389}390391#[derive(Debug, Clone, PartialEq, Eq, Hash)]392pub struct ParamsDesc {393	pub(crate) syntax: SyntaxNode,394}395impl ParamsDesc {396	pub fn l_paren_token(&self) -> Option<SyntaxToken> {397		support::token(&self.syntax, T!['('])398	}399	pub fn params(&self) -> AstChildren<Param> {400		support::children(&self.syntax)401	}402	pub fn r_paren_token(&self) -> Option<SyntaxToken> {403		support::token(&self.syntax, T![')'])404	}405}406407#[derive(Debug, Clone, PartialEq, Eq, Hash)]408pub struct ExprAssert {409	pub(crate) syntax: SyntaxNode,410}411impl ExprAssert {412	pub fn assertion(&self) -> Option<Assertion> {413		support::child(&self.syntax)414	}415	pub fn semi_token(&self) -> Option<SyntaxToken> {416		support::token(&self.syntax, T![;])417	}418	pub fn expr(&self) -> Option<Expr> {419		support::child(&self.syntax)420	}421}422423#[derive(Debug, Clone, PartialEq, Eq, Hash)]424pub struct Assertion {425	pub(crate) syntax: SyntaxNode,426}427impl Assertion {428	pub fn assert_kw_token(&self) -> Option<SyntaxToken> {429		support::token(&self.syntax, T![assert])430	}431	pub fn condition(&self) -> Option<LhsExpr> {432		support::child(&self.syntax)433	}434	pub fn colon_token(&self) -> Option<SyntaxToken> {435		support::token(&self.syntax, T![:])436	}437	pub fn message(&self) -> Option<Expr> {438		support::child(&self.syntax)439	}440}441442#[derive(Debug, Clone, PartialEq, Eq, Hash)]443pub struct ExprError {444	pub(crate) syntax: SyntaxNode,445}446impl ExprError {447	pub fn error_kw_token(&self) -> Option<SyntaxToken> {448		support::token(&self.syntax, T![error])449	}450	pub fn expr(&self) -> Option<Expr> {451		support::child(&self.syntax)452	}453}454455#[derive(Debug, Clone, PartialEq, Eq, Hash)]456pub struct SliceDescEnd {457	pub(crate) syntax: SyntaxNode,458}459impl SliceDescEnd {460	pub fn expr(&self) -> Option<Expr> {461		support::child(&self.syntax)462	}463}464465#[derive(Debug, Clone, PartialEq, Eq, Hash)]466pub struct SliceDescStep {467	pub(crate) syntax: SyntaxNode,468}469impl SliceDescStep {470	pub fn expr(&self) -> Option<Expr> {471		support::child(&self.syntax)472	}473}474475#[derive(Debug, Clone, PartialEq, Eq, Hash)]476pub struct Arg {477	pub(crate) syntax: SyntaxNode,478}479impl Arg {480	pub fn name(&self) -> Option<Name> {481		support::child(&self.syntax)482	}483	pub fn assign_token(&self) -> Option<SyntaxToken> {484		support::token(&self.syntax, T![=])485	}486	pub fn expr(&self) -> Option<Expr> {487		support::child(&self.syntax)488	}489}490491#[derive(Debug, Clone, PartialEq, Eq, Hash)]492pub struct ObjBodyComp {493	pub(crate) syntax: SyntaxNode,494}495impl ObjBodyComp {496	pub fn l_brace_token(&self) -> Option<SyntaxToken> {497		support::token(&self.syntax, T!['{'])498	}499	pub fn member_comps(&self) -> AstChildren<MemberComp> {500		support::children(&self.syntax)501	}502	pub fn comp_specs(&self) -> AstChildren<CompSpec> {503		support::children(&self.syntax)504	}505	pub fn r_brace_token(&self) -> Option<SyntaxToken> {506		support::token(&self.syntax, T!['}'])507	}508}509510#[derive(Debug, Clone, PartialEq, Eq, Hash)]511pub struct ObjBodyMemberList {512	pub(crate) syntax: SyntaxNode,513}514impl ObjBodyMemberList {515	pub fn l_brace_token(&self) -> Option<SyntaxToken> {516		support::token(&self.syntax, T!['{'])517	}518	pub fn members(&self) -> AstChildren<Member> {519		support::children(&self.syntax)520	}521	pub fn r_brace_token(&self) -> Option<SyntaxToken> {522		support::token(&self.syntax, T!['}'])523	}524}525526#[derive(Debug, Clone, PartialEq, Eq, Hash)]527pub struct MemberBindStmt {528	pub(crate) syntax: SyntaxNode,529}530impl MemberBindStmt {531	pub fn obj_local(&self) -> Option<ObjLocal> {532		support::child(&self.syntax)533	}534}535536#[derive(Debug, Clone, PartialEq, Eq, Hash)]537pub struct ObjLocal {538	pub(crate) syntax: SyntaxNode,539}540impl ObjLocal {541	pub fn local_kw_token(&self) -> Option<SyntaxToken> {542		support::token(&self.syntax, T![local])543	}544	pub fn bind(&self) -> Option<Bind> {545		support::child(&self.syntax)546	}547}548549#[derive(Debug, Clone, PartialEq, Eq, Hash)]550pub struct MemberAssertStmt {551	pub(crate) syntax: SyntaxNode,552}553impl MemberAssertStmt {554	pub fn assertion(&self) -> Option<Assertion> {555		support::child(&self.syntax)556	}557}558559#[derive(Debug, Clone, PartialEq, Eq, Hash)]560pub struct MemberFieldNormal {561	pub(crate) syntax: SyntaxNode,562}563impl MemberFieldNormal {564	pub fn field_name(&self) -> Option<FieldName> {565		support::child(&self.syntax)566	}567	pub fn plus_token(&self) -> Option<SyntaxToken> {568		support::token(&self.syntax, T![+])569	}570	pub fn visibility(&self) -> Option<Visibility> {571		support::token_child(&self.syntax)572	}573	pub fn expr(&self) -> Option<Expr> {574		support::child(&self.syntax)575	}576}577578#[derive(Debug, Clone, PartialEq, Eq, Hash)]579pub struct MemberFieldMethod {580	pub(crate) syntax: SyntaxNode,581}582impl MemberFieldMethod {583	pub fn field_name(&self) -> Option<FieldName> {584		support::child(&self.syntax)585	}586	pub fn params_desc(&self) -> Option<ParamsDesc> {587		support::child(&self.syntax)588	}589	pub fn visibility(&self) -> Option<Visibility> {590		support::token_child(&self.syntax)591	}592	pub fn expr(&self) -> Option<Expr> {593		support::child(&self.syntax)594	}595}596597#[derive(Debug, Clone, PartialEq, Eq, Hash)]598pub struct FieldNameFixed {599	pub(crate) syntax: SyntaxNode,600}601impl FieldNameFixed {602	pub fn id(&self) -> Option<Name> {603		support::child(&self.syntax)604	}605	pub fn text(&self) -> Option<Text> {606		support::token_child(&self.syntax)607	}608}609610#[derive(Debug, Clone, PartialEq, Eq, Hash)]611pub struct FieldNameDynamic {612	pub(crate) syntax: SyntaxNode,613}614impl FieldNameDynamic {615	pub fn l_brack_token(&self) -> Option<SyntaxToken> {616		support::token(&self.syntax, T!['['])617	}618	pub fn expr(&self) -> Option<Expr> {619		support::child(&self.syntax)620	}621	pub fn r_brack_token(&self) -> Option<SyntaxToken> {622		support::token(&self.syntax, T![']'])623	}624}625626#[derive(Debug, Clone, PartialEq, Eq, Hash)]627pub struct ForSpec {628	pub(crate) syntax: SyntaxNode,629}630impl ForSpec {631	pub fn for_kw_token(&self) -> Option<SyntaxToken> {632		support::token(&self.syntax, T![for])633	}634	pub fn bind(&self) -> Option<Name> {635		support::child(&self.syntax)636	}637	pub fn in_kw_token(&self) -> Option<SyntaxToken> {638		support::token(&self.syntax, T![in])639	}640	pub fn expr(&self) -> Option<Expr> {641		support::child(&self.syntax)642	}643}644645#[derive(Debug, Clone, PartialEq, Eq, Hash)]646pub struct IfSpec {647	pub(crate) syntax: SyntaxNode,648}649impl IfSpec {650	pub fn if_kw_token(&self) -> Option<SyntaxToken> {651		support::token(&self.syntax, T![if])652	}653	pub fn expr(&self) -> Option<Expr> {654		support::child(&self.syntax)655	}656}657658#[derive(Debug, Clone, PartialEq, Eq, Hash)]659pub struct BindDestruct {660	pub(crate) syntax: SyntaxNode,661}662impl BindDestruct {663	pub fn into(&self) -> Option<Destruct> {664		support::child(&self.syntax)665	}666	pub fn assign_token(&self) -> Option<SyntaxToken> {667		support::token(&self.syntax, T![=])668	}669	pub fn value(&self) -> Option<Expr> {670		support::child(&self.syntax)671	}672}673674#[derive(Debug, Clone, PartialEq, Eq, Hash)]675pub struct BindFunction {676	pub(crate) syntax: SyntaxNode,677}678impl BindFunction {679	pub fn name(&self) -> Option<Name> {680		support::child(&self.syntax)681	}682	pub fn params(&self) -> Option<ParamsDesc> {683		support::child(&self.syntax)684	}685	pub fn assign_token(&self) -> Option<SyntaxToken> {686		support::token(&self.syntax, T![=])687	}688	pub fn value(&self) -> Option<Expr> {689		support::child(&self.syntax)690	}691}692693#[derive(Debug, Clone, PartialEq, Eq, Hash)]694pub struct Param {695	pub(crate) syntax: SyntaxNode,696}697impl Param {698	pub fn destruct(&self) -> Option<Destruct> {699		support::child(&self.syntax)700	}701	pub fn assign_token(&self) -> Option<SyntaxToken> {702		support::token(&self.syntax, T![=])703	}704	pub fn expr(&self) -> Option<Expr> {705		support::child(&self.syntax)706	}707}708709#[derive(Debug, Clone, PartialEq, Eq, Hash)]710pub struct DestructFull {711	pub(crate) syntax: SyntaxNode,712}713impl DestructFull {714	pub fn name(&self) -> Option<Name> {715		support::child(&self.syntax)716	}717}718719#[derive(Debug, Clone, PartialEq, Eq, Hash)]720pub struct DestructSkip {721	pub(crate) syntax: SyntaxNode,722}723impl DestructSkip {724	pub fn question_mark_token(&self) -> Option<SyntaxToken> {725		support::token(&self.syntax, T![?])726	}727}728729#[derive(Debug, Clone, PartialEq, Eq, Hash)]730pub struct DestructArray {731	pub(crate) syntax: SyntaxNode,732}733impl DestructArray {734	pub fn l_brack_token(&self) -> Option<SyntaxToken> {735		support::token(&self.syntax, T!['['])736	}737	pub fn destruct_array_parts(&self) -> AstChildren<DestructArrayPart> {738		support::children(&self.syntax)739	}740	pub fn r_brack_token(&self) -> Option<SyntaxToken> {741		support::token(&self.syntax, T![']'])742	}743}744745#[derive(Debug, Clone, PartialEq, Eq, Hash)]746pub struct DestructObject {747	pub(crate) syntax: SyntaxNode,748}749impl DestructObject {750	pub fn l_brace_token(&self) -> Option<SyntaxToken> {751		support::token(&self.syntax, T!['{'])752	}753	pub fn destruct_object_fields(&self) -> AstChildren<DestructObjectField> {754		support::children(&self.syntax)755	}756	pub fn destruct_rest(&self) -> Option<DestructRest> {757		support::child(&self.syntax)758	}759	pub fn comma_token(&self) -> Option<SyntaxToken> {760		support::token(&self.syntax, T![,])761	}762	pub fn r_brace_token(&self) -> Option<SyntaxToken> {763		support::token(&self.syntax, T!['}'])764	}765}766767#[derive(Debug, Clone, PartialEq, Eq, Hash)]768pub struct DestructObjectField {769	pub(crate) syntax: SyntaxNode,770}771impl DestructObjectField {772	pub fn field(&self) -> Option<Name> {773		support::child(&self.syntax)774	}775	pub fn colon_token(&self) -> Option<SyntaxToken> {776		support::token(&self.syntax, T![:])777	}778	pub fn destruct(&self) -> Option<Destruct> {779		support::child(&self.syntax)780	}781	pub fn assign_token(&self) -> Option<SyntaxToken> {782		support::token(&self.syntax, T![=])783	}784	pub fn expr(&self) -> Option<Expr> {785		support::child(&self.syntax)786	}787}788789#[derive(Debug, Clone, PartialEq, Eq, Hash)]790pub struct DestructRest {791	pub(crate) syntax: SyntaxNode,792}793impl DestructRest {794	pub fn dotdotdot_token(&self) -> Option<SyntaxToken> {795		support::token(&self.syntax, T![...])796	}797	pub fn into(&self) -> Option<Name> {798		support::child(&self.syntax)799	}800}801802#[derive(Debug, Clone, PartialEq, Eq, Hash)]803pub struct DestructArrayElement {804	pub(crate) syntax: SyntaxNode,805}806impl DestructArrayElement {807	pub fn destruct(&self) -> Option<Destruct> {808		support::child(&self.syntax)809	}810}811812#[derive(Debug, Clone, PartialEq, Eq, Hash)]813pub enum Expr {814	ExprBinary(ExprBinary),815	ExprUnary(ExprUnary),816	ExprSlice(ExprSlice),817	ExprIndex(ExprIndex),818	ExprIndexExpr(ExprIndexExpr),819	ExprApply(ExprApply),820	ExprObjExtend(ExprObjExtend),821	ExprParened(ExprParened),822	ExprString(ExprString),823	ExprNumber(ExprNumber),824	ExprLiteral(ExprLiteral),825	ExprArray(ExprArray),826	ExprObject(ExprObject),827	ExprArrayComp(ExprArrayComp),828	ExprImport(ExprImport),829	ExprVar(ExprVar),830	ExprLocal(ExprLocal),831	ExprIfThenElse(ExprIfThenElse),832	ExprFunction(ExprFunction),833	ExprAssert(ExprAssert),834	ExprError(ExprError),835}836837#[derive(Debug, Clone, PartialEq, Eq, Hash)]838pub enum ObjBody {839	ObjBodyComp(ObjBodyComp),840	ObjBodyMemberList(ObjBodyMemberList),841}842843#[derive(Debug, Clone, PartialEq, Eq, Hash)]844pub enum CompSpec {845	ForSpec(ForSpec),846	IfSpec(IfSpec),847}848849#[derive(Debug, Clone, PartialEq, Eq, Hash)]850pub enum Bind {851	BindDestruct(BindDestruct),852	BindFunction(BindFunction),853}854855#[derive(Debug, Clone, PartialEq, Eq, Hash)]856pub enum MemberComp {857	MemberBindStmt(MemberBindStmt),858	MemberFieldNormal(MemberFieldNormal),859	MemberFieldMethod(MemberFieldMethod),860}861862#[derive(Debug, Clone, PartialEq, Eq, Hash)]863pub enum Member {864	MemberBindStmt(MemberBindStmt),865	MemberAssertStmt(MemberAssertStmt),866	MemberFieldNormal(MemberFieldNormal),867	MemberFieldMethod(MemberFieldMethod),868}869870#[derive(Debug, Clone, PartialEq, Eq, Hash)]871pub enum FieldName {872	FieldNameFixed(FieldNameFixed),873	FieldNameDynamic(FieldNameDynamic),874}875876#[derive(Debug, Clone, PartialEq, Eq, Hash)]877pub enum Destruct {878	DestructFull(DestructFull),879	DestructSkip(DestructSkip),880	DestructArray(DestructArray),881	DestructObject(DestructObject),882}883884#[derive(Debug, Clone, PartialEq, Eq, Hash)]885pub enum DestructArrayPart {886	DestructArrayElement(DestructArrayElement),887	DestructRest(DestructRest),888}889890#[derive(Debug, Clone, PartialEq, Eq, Hash)]891pub struct BinaryOperator {892	syntax: SyntaxToken,893	kind: BinaryOperatorKind,894}895896#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]897pub enum BinaryOperatorKind {898	Or,899	And,900	BitOr,901	BitXor,902	BitAnd,903	Eq,904	Ne,905	Lt,906	Gt,907	Le,908	Ge,909	InKw,910	Lhs,911	Rhs,912	Plus,913	Minus,914	Mul,915	Div,916	Modulo,917	MetaObjectApply,918	ErrorNoOperator,919}920921#[derive(Debug, Clone, PartialEq, Eq, Hash)]922pub struct UnaryOperator {923	syntax: SyntaxToken,924	kind: UnaryOperatorKind,925}926927#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]928pub enum UnaryOperatorKind {929	Minus,930	Not,931	BitNot,932}933934#[derive(Debug, Clone, PartialEq, Eq, Hash)]935pub struct Literal {936	syntax: SyntaxToken,937	kind: LiteralKind,938}939940#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]941pub enum LiteralKind {942	NullKw,943	TrueKw,944	FalseKw,945	SelfKw,946	Dollar,947	SuperKw,948}949950#[derive(Debug, Clone, PartialEq, Eq, Hash)]951pub struct Text {952	syntax: SyntaxToken,953	kind: TextKind,954}955956#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]957pub enum TextKind {958	StringDouble,959	ErrorStringDoubleUnterminated,960	StringSingle,961	ErrorStringSingleUnterminated,962	StringDoubleVerbatim,963	ErrorStringDoubleVerbatimUnterminated,964	StringSingleVerbatim,965	ErrorStringSingleVerbatimUnterminated,966	ErrorStringVerbatimMissingQuotes,967	StringBlock,968	ErrorStringBlockUnexpectedEnd,969	ErrorStringBlockMissingNewLine,970	ErrorStringBlockMissingTermination,971	ErrorStringBlockMissingIndent,972}973974#[derive(Debug, Clone, PartialEq, Eq, Hash)]975pub struct Number {976	syntax: SyntaxToken,977	kind: NumberKind,978}979980#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]981pub enum NumberKind {982	Float,983	ErrorFloatJunkAfterPoint,984	ErrorFloatJunkAfterExponent,985	ErrorFloatJunkAfterExponentSign,986}987988#[derive(Debug, Clone, PartialEq, Eq, Hash)]989pub struct ImportKind {990	syntax: SyntaxToken,991	kind: ImportKindKind,992}993994#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]995pub enum ImportKindKind {996	ImportstrKw,997	ImportbinKw,998	ImportKw,999}10001001#[derive(Debug, Clone, PartialEq, Eq, Hash)]1002pub struct Visibility {1003	syntax: SyntaxToken,1004	kind: VisibilityKind,1005}10061007#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]1008pub enum VisibilityKind {1009	Coloncoloncolon,1010	Coloncolon,1011	Colon,1012}10131014#[derive(Debug, Clone, PartialEq, Eq, Hash)]1015pub struct Trivia {1016	syntax: SyntaxToken,1017	kind: TriviaKind,1018}10191020#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]1021pub enum TriviaKind {1022	Whitespace,1023	MultiLineComment,1024	ErrorCommentTooShort,1025	ErrorCommentUnterminated,1026	SingleLineHashComment,1027	SingleLineSlashComment,1028}10291030#[derive(Debug, Clone, PartialEq, Eq, Hash)]1031pub struct CustomError {1032	syntax: SyntaxToken,1033	kind: CustomErrorKind,1034}10351036#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]1037pub enum CustomErrorKind {1038	ErrorMissingToken,1039	ErrorUnexpectedToken,1040	ErrorCustom,1041}1042impl AstNode for SourceFile {1043	fn can_cast(kind: SyntaxKind) -> bool {1044		kind == SOURCE_FILE1045	}1046	fn cast(syntax: SyntaxNode) -> Option<Self> {1047		if Self::can_cast(syntax.kind()) {1048			Some(Self { syntax })1049		} else {1050			None1051		}1052	}1053	fn syntax(&self) -> &SyntaxNode {1054		&self.syntax1055	}1056}1057impl AstNode for ExprBinary {1058	fn can_cast(kind: SyntaxKind) -> bool {1059		kind == EXPR_BINARY1060	}1061	fn cast(syntax: SyntaxNode) -> Option<Self> {1062		if Self::can_cast(syntax.kind()) {1063			Some(Self { syntax })1064		} else {1065			None1066		}1067	}1068	fn syntax(&self) -> &SyntaxNode {1069		&self.syntax1070	}1071}1072impl AstNode for LhsExpr {1073	fn can_cast(kind: SyntaxKind) -> bool {1074		kind == LHS_EXPR1075	}1076	fn cast(syntax: SyntaxNode) -> Option<Self> {1077		if Self::can_cast(syntax.kind()) {1078			Some(Self { syntax })1079		} else {1080			None1081		}1082	}1083	fn syntax(&self) -> &SyntaxNode {1084		&self.syntax1085	}1086}1087impl AstNode for ExprUnary {1088	fn can_cast(kind: SyntaxKind) -> bool {1089		kind == EXPR_UNARY1090	}1091	fn cast(syntax: SyntaxNode) -> Option<Self> {1092		if Self::can_cast(syntax.kind()) {1093			Some(Self { syntax })1094		} else {1095			None1096		}1097	}1098	fn syntax(&self) -> &SyntaxNode {1099		&self.syntax1100	}1101}1102impl AstNode for ExprSlice {1103	fn can_cast(kind: SyntaxKind) -> bool {1104		kind == EXPR_SLICE1105	}1106	fn cast(syntax: SyntaxNode) -> Option<Self> {1107		if Self::can_cast(syntax.kind()) {1108			Some(Self { syntax })1109		} else {1110			None1111		}1112	}1113	fn syntax(&self) -> &SyntaxNode {1114		&self.syntax1115	}1116}1117impl AstNode for SliceDesc {1118	fn can_cast(kind: SyntaxKind) -> bool {1119		kind == SLICE_DESC1120	}1121	fn cast(syntax: SyntaxNode) -> Option<Self> {1122		if Self::can_cast(syntax.kind()) {1123			Some(Self { syntax })1124		} else {1125			None1126		}1127	}1128	fn syntax(&self) -> &SyntaxNode {1129		&self.syntax1130	}1131}1132impl AstNode for ExprIndex {1133	fn can_cast(kind: SyntaxKind) -> bool {1134		kind == EXPR_INDEX1135	}1136	fn cast(syntax: SyntaxNode) -> Option<Self> {1137		if Self::can_cast(syntax.kind()) {1138			Some(Self { syntax })1139		} else {1140			None1141		}1142	}1143	fn syntax(&self) -> &SyntaxNode {1144		&self.syntax1145	}1146}1147impl AstNode for Name {1148	fn can_cast(kind: SyntaxKind) -> bool {1149		kind == NAME1150	}1151	fn cast(syntax: SyntaxNode) -> Option<Self> {1152		if Self::can_cast(syntax.kind()) {1153			Some(Self { syntax })1154		} else {1155			None1156		}1157	}1158	fn syntax(&self) -> &SyntaxNode {1159		&self.syntax1160	}1161}1162impl AstNode for ExprIndexExpr {1163	fn can_cast(kind: SyntaxKind) -> bool {1164		kind == EXPR_INDEX_EXPR1165	}1166	fn cast(syntax: SyntaxNode) -> Option<Self> {1167		if Self::can_cast(syntax.kind()) {1168			Some(Self { syntax })1169		} else {1170			None1171		}1172	}1173	fn syntax(&self) -> &SyntaxNode {1174		&self.syntax1175	}1176}1177impl AstNode for ExprApply {1178	fn can_cast(kind: SyntaxKind) -> bool {1179		kind == EXPR_APPLY1180	}1181	fn cast(syntax: SyntaxNode) -> Option<Self> {1182		if Self::can_cast(syntax.kind()) {1183			Some(Self { syntax })1184		} else {1185			None1186		}1187	}1188	fn syntax(&self) -> &SyntaxNode {1189		&self.syntax1190	}1191}1192impl AstNode for ArgsDesc {1193	fn can_cast(kind: SyntaxKind) -> bool {1194		kind == ARGS_DESC1195	}1196	fn cast(syntax: SyntaxNode) -> Option<Self> {1197		if Self::can_cast(syntax.kind()) {1198			Some(Self { syntax })1199		} else {1200			None1201		}1202	}1203	fn syntax(&self) -> &SyntaxNode {1204		&self.syntax1205	}1206}1207impl AstNode for ExprObjExtend {1208	fn can_cast(kind: SyntaxKind) -> bool {1209		kind == EXPR_OBJ_EXTEND1210	}1211	fn cast(syntax: SyntaxNode) -> Option<Self> {1212		if Self::can_cast(syntax.kind()) {1213			Some(Self { syntax })1214		} else {1215			None1216		}1217	}1218	fn syntax(&self) -> &SyntaxNode {1219		&self.syntax1220	}1221}1222impl AstNode for ExprParened {1223	fn can_cast(kind: SyntaxKind) -> bool {1224		kind == EXPR_PARENED1225	}1226	fn cast(syntax: SyntaxNode) -> Option<Self> {1227		if Self::can_cast(syntax.kind()) {1228			Some(Self { syntax })1229		} else {1230			None1231		}1232	}1233	fn syntax(&self) -> &SyntaxNode {1234		&self.syntax1235	}1236}1237impl AstNode for ExprLiteral {1238	fn can_cast(kind: SyntaxKind) -> bool {1239		kind == EXPR_LITERAL1240	}1241	fn cast(syntax: SyntaxNode) -> Option<Self> {1242		if Self::can_cast(syntax.kind()) {1243			Some(Self { syntax })1244		} else {1245			None1246		}1247	}1248	fn syntax(&self) -> &SyntaxNode {1249		&self.syntax1250	}1251}1252impl AstNode for ExprString {1253	fn can_cast(kind: SyntaxKind) -> bool {1254		kind == EXPR_STRING1255	}1256	fn cast(syntax: SyntaxNode) -> Option<Self> {1257		if Self::can_cast(syntax.kind()) {1258			Some(Self { syntax })1259		} else {1260			None1261		}1262	}1263	fn syntax(&self) -> &SyntaxNode {1264		&self.syntax1265	}1266}1267impl AstNode for ExprNumber {1268	fn can_cast(kind: SyntaxKind) -> bool {1269		kind == EXPR_NUMBER1270	}1271	fn cast(syntax: SyntaxNode) -> Option<Self> {1272		if Self::can_cast(syntax.kind()) {1273			Some(Self { syntax })1274		} else {1275			None1276		}1277	}1278	fn syntax(&self) -> &SyntaxNode {1279		&self.syntax1280	}1281}1282impl AstNode for ExprArray {1283	fn can_cast(kind: SyntaxKind) -> bool {1284		kind == EXPR_ARRAY1285	}1286	fn cast(syntax: SyntaxNode) -> Option<Self> {1287		if Self::can_cast(syntax.kind()) {1288			Some(Self { syntax })1289		} else {1290			None1291		}1292	}1293	fn syntax(&self) -> &SyntaxNode {1294		&self.syntax1295	}1296}1297impl AstNode for ExprObject {1298	fn can_cast(kind: SyntaxKind) -> bool {1299		kind == EXPR_OBJECT1300	}1301	fn cast(syntax: SyntaxNode) -> Option<Self> {1302		if Self::can_cast(syntax.kind()) {1303			Some(Self { syntax })1304		} else {1305			None1306		}1307	}1308	fn syntax(&self) -> &SyntaxNode {1309		&self.syntax1310	}1311}1312impl AstNode for ExprArrayComp {1313	fn can_cast(kind: SyntaxKind) -> bool {1314		kind == EXPR_ARRAY_COMP1315	}1316	fn cast(syntax: SyntaxNode) -> Option<Self> {1317		if Self::can_cast(syntax.kind()) {1318			Some(Self { syntax })1319		} else {1320			None1321		}1322	}1323	fn syntax(&self) -> &SyntaxNode {1324		&self.syntax1325	}1326}1327impl AstNode for ExprImport {1328	fn can_cast(kind: SyntaxKind) -> bool {1329		kind == EXPR_IMPORT1330	}1331	fn cast(syntax: SyntaxNode) -> Option<Self> {1332		if Self::can_cast(syntax.kind()) {1333			Some(Self { syntax })1334		} else {1335			None1336		}1337	}1338	fn syntax(&self) -> &SyntaxNode {1339		&self.syntax1340	}1341}1342impl AstNode for ExprVar {1343	fn can_cast(kind: SyntaxKind) -> bool {1344		kind == EXPR_VAR1345	}1346	fn cast(syntax: SyntaxNode) -> Option<Self> {1347		if Self::can_cast(syntax.kind()) {1348			Some(Self { syntax })1349		} else {1350			None1351		}1352	}1353	fn syntax(&self) -> &SyntaxNode {1354		&self.syntax1355	}1356}1357impl AstNode for ExprLocal {1358	fn can_cast(kind: SyntaxKind) -> bool {1359		kind == EXPR_LOCAL1360	}1361	fn cast(syntax: SyntaxNode) -> Option<Self> {1362		if Self::can_cast(syntax.kind()) {1363			Some(Self { syntax })1364		} else {1365			None1366		}1367	}1368	fn syntax(&self) -> &SyntaxNode {1369		&self.syntax1370	}1371}1372impl AstNode for ExprIfThenElse {1373	fn can_cast(kind: SyntaxKind) -> bool {1374		kind == EXPR_IF_THEN_ELSE1375	}1376	fn cast(syntax: SyntaxNode) -> Option<Self> {1377		if Self::can_cast(syntax.kind()) {1378			Some(Self { syntax })1379		} else {1380			None1381		}1382	}1383	fn syntax(&self) -> &SyntaxNode {1384		&self.syntax1385	}1386}1387impl AstNode for TrueExpr {1388	fn can_cast(kind: SyntaxKind) -> bool {1389		kind == TRUE_EXPR1390	}1391	fn cast(syntax: SyntaxNode) -> Option<Self> {1392		if Self::can_cast(syntax.kind()) {1393			Some(Self { syntax })1394		} else {1395			None1396		}1397	}1398	fn syntax(&self) -> &SyntaxNode {1399		&self.syntax1400	}1401}1402impl AstNode for FalseExpr {1403	fn can_cast(kind: SyntaxKind) -> bool {1404		kind == FALSE_EXPR1405	}1406	fn cast(syntax: SyntaxNode) -> Option<Self> {1407		if Self::can_cast(syntax.kind()) {1408			Some(Self { syntax })1409		} else {1410			None1411		}1412	}1413	fn syntax(&self) -> &SyntaxNode {1414		&self.syntax1415	}1416}1417impl AstNode for ExprFunction {1418	fn can_cast(kind: SyntaxKind) -> bool {1419		kind == EXPR_FUNCTION1420	}1421	fn cast(syntax: SyntaxNode) -> Option<Self> {1422		if Self::can_cast(syntax.kind()) {1423			Some(Self { syntax })1424		} else {1425			None1426		}1427	}1428	fn syntax(&self) -> &SyntaxNode {1429		&self.syntax1430	}1431}1432impl AstNode for ParamsDesc {1433	fn can_cast(kind: SyntaxKind) -> bool {1434		kind == PARAMS_DESC1435	}1436	fn cast(syntax: SyntaxNode) -> Option<Self> {1437		if Self::can_cast(syntax.kind()) {1438			Some(Self { syntax })1439		} else {1440			None1441		}1442	}1443	fn syntax(&self) -> &SyntaxNode {1444		&self.syntax1445	}1446}1447impl AstNode for ExprAssert {1448	fn can_cast(kind: SyntaxKind) -> bool {1449		kind == EXPR_ASSERT1450	}1451	fn cast(syntax: SyntaxNode) -> Option<Self> {1452		if Self::can_cast(syntax.kind()) {1453			Some(Self { syntax })1454		} else {1455			None1456		}1457	}1458	fn syntax(&self) -> &SyntaxNode {1459		&self.syntax1460	}1461}1462impl AstNode for Assertion {1463	fn can_cast(kind: SyntaxKind) -> bool {1464		kind == ASSERTION1465	}1466	fn cast(syntax: SyntaxNode) -> Option<Self> {1467		if Self::can_cast(syntax.kind()) {1468			Some(Self { syntax })1469		} else {1470			None1471		}1472	}1473	fn syntax(&self) -> &SyntaxNode {1474		&self.syntax1475	}1476}1477impl AstNode for ExprError {1478	fn can_cast(kind: SyntaxKind) -> bool {1479		kind == EXPR_ERROR1480	}1481	fn cast(syntax: SyntaxNode) -> Option<Self> {1482		if Self::can_cast(syntax.kind()) {1483			Some(Self { syntax })1484		} else {1485			None1486		}1487	}1488	fn syntax(&self) -> &SyntaxNode {1489		&self.syntax1490	}1491}1492impl AstNode for SliceDescEnd {1493	fn can_cast(kind: SyntaxKind) -> bool {1494		kind == SLICE_DESC_END1495	}1496	fn cast(syntax: SyntaxNode) -> Option<Self> {1497		if Self::can_cast(syntax.kind()) {1498			Some(Self { syntax })1499		} else {1500			None1501		}1502	}1503	fn syntax(&self) -> &SyntaxNode {1504		&self.syntax1505	}1506}1507impl AstNode for SliceDescStep {1508	fn can_cast(kind: SyntaxKind) -> bool {1509		kind == SLICE_DESC_STEP1510	}1511	fn cast(syntax: SyntaxNode) -> Option<Self> {1512		if Self::can_cast(syntax.kind()) {1513			Some(Self { syntax })1514		} else {1515			None1516		}1517	}1518	fn syntax(&self) -> &SyntaxNode {1519		&self.syntax1520	}1521}1522impl AstNode for Arg {1523	fn can_cast(kind: SyntaxKind) -> bool {1524		kind == ARG1525	}1526	fn cast(syntax: SyntaxNode) -> Option<Self> {1527		if Self::can_cast(syntax.kind()) {1528			Some(Self { syntax })1529		} else {1530			None1531		}1532	}1533	fn syntax(&self) -> &SyntaxNode {1534		&self.syntax1535	}1536}1537impl AstNode for ObjBodyComp {1538	fn can_cast(kind: SyntaxKind) -> bool {1539		kind == OBJ_BODY_COMP1540	}1541	fn cast(syntax: SyntaxNode) -> Option<Self> {1542		if Self::can_cast(syntax.kind()) {1543			Some(Self { syntax })1544		} else {1545			None1546		}1547	}1548	fn syntax(&self) -> &SyntaxNode {1549		&self.syntax1550	}1551}1552impl AstNode for ObjBodyMemberList {1553	fn can_cast(kind: SyntaxKind) -> bool {1554		kind == OBJ_BODY_MEMBER_LIST1555	}1556	fn cast(syntax: SyntaxNode) -> Option<Self> {1557		if Self::can_cast(syntax.kind()) {1558			Some(Self { syntax })1559		} else {1560			None1561		}1562	}1563	fn syntax(&self) -> &SyntaxNode {1564		&self.syntax1565	}1566}1567impl AstNode for MemberBindStmt {1568	fn can_cast(kind: SyntaxKind) -> bool {1569		kind == MEMBER_BIND_STMT1570	}1571	fn cast(syntax: SyntaxNode) -> Option<Self> {1572		if Self::can_cast(syntax.kind()) {1573			Some(Self { syntax })1574		} else {1575			None1576		}1577	}1578	fn syntax(&self) -> &SyntaxNode {1579		&self.syntax1580	}1581}1582impl AstNode for ObjLocal {1583	fn can_cast(kind: SyntaxKind) -> bool {1584		kind == OBJ_LOCAL1585	}1586	fn cast(syntax: SyntaxNode) -> Option<Self> {1587		if Self::can_cast(syntax.kind()) {1588			Some(Self { syntax })1589		} else {1590			None1591		}1592	}1593	fn syntax(&self) -> &SyntaxNode {1594		&self.syntax1595	}1596}1597impl AstNode for MemberAssertStmt {1598	fn can_cast(kind: SyntaxKind) -> bool {1599		kind == MEMBER_ASSERT_STMT1600	}1601	fn cast(syntax: SyntaxNode) -> Option<Self> {1602		if Self::can_cast(syntax.kind()) {1603			Some(Self { syntax })1604		} else {1605			None1606		}1607	}1608	fn syntax(&self) -> &SyntaxNode {1609		&self.syntax1610	}1611}1612impl AstNode for MemberFieldNormal {1613	fn can_cast(kind: SyntaxKind) -> bool {1614		kind == MEMBER_FIELD_NORMAL1615	}1616	fn cast(syntax: SyntaxNode) -> Option<Self> {1617		if Self::can_cast(syntax.kind()) {1618			Some(Self { syntax })1619		} else {1620			None1621		}1622	}1623	fn syntax(&self) -> &SyntaxNode {1624		&self.syntax1625	}1626}1627impl AstNode for MemberFieldMethod {1628	fn can_cast(kind: SyntaxKind) -> bool {1629		kind == MEMBER_FIELD_METHOD1630	}1631	fn cast(syntax: SyntaxNode) -> Option<Self> {1632		if Self::can_cast(syntax.kind()) {1633			Some(Self { syntax })1634		} else {1635			None1636		}1637	}1638	fn syntax(&self) -> &SyntaxNode {1639		&self.syntax1640	}1641}1642impl AstNode for FieldNameFixed {1643	fn can_cast(kind: SyntaxKind) -> bool {1644		kind == FIELD_NAME_FIXED1645	}1646	fn cast(syntax: SyntaxNode) -> Option<Self> {1647		if Self::can_cast(syntax.kind()) {1648			Some(Self { syntax })1649		} else {1650			None1651		}1652	}1653	fn syntax(&self) -> &SyntaxNode {1654		&self.syntax1655	}1656}1657impl AstNode for FieldNameDynamic {1658	fn can_cast(kind: SyntaxKind) -> bool {1659		kind == FIELD_NAME_DYNAMIC1660	}1661	fn cast(syntax: SyntaxNode) -> Option<Self> {1662		if Self::can_cast(syntax.kind()) {1663			Some(Self { syntax })1664		} else {1665			None1666		}1667	}1668	fn syntax(&self) -> &SyntaxNode {1669		&self.syntax1670	}1671}1672impl AstNode for ForSpec {1673	fn can_cast(kind: SyntaxKind) -> bool {1674		kind == FOR_SPEC1675	}1676	fn cast(syntax: SyntaxNode) -> Option<Self> {1677		if Self::can_cast(syntax.kind()) {1678			Some(Self { syntax })1679		} else {1680			None1681		}1682	}1683	fn syntax(&self) -> &SyntaxNode {1684		&self.syntax1685	}1686}1687impl AstNode for IfSpec {1688	fn can_cast(kind: SyntaxKind) -> bool {1689		kind == IF_SPEC1690	}1691	fn cast(syntax: SyntaxNode) -> Option<Self> {1692		if Self::can_cast(syntax.kind()) {1693			Some(Self { syntax })1694		} else {1695			None1696		}1697	}1698	fn syntax(&self) -> &SyntaxNode {1699		&self.syntax1700	}1701}1702impl AstNode for BindDestruct {1703	fn can_cast(kind: SyntaxKind) -> bool {1704		kind == BIND_DESTRUCT1705	}1706	fn cast(syntax: SyntaxNode) -> Option<Self> {1707		if Self::can_cast(syntax.kind()) {1708			Some(Self { syntax })1709		} else {1710			None1711		}1712	}1713	fn syntax(&self) -> &SyntaxNode {1714		&self.syntax1715	}1716}1717impl AstNode for BindFunction {1718	fn can_cast(kind: SyntaxKind) -> bool {1719		kind == BIND_FUNCTION1720	}1721	fn cast(syntax: SyntaxNode) -> Option<Self> {1722		if Self::can_cast(syntax.kind()) {1723			Some(Self { syntax })1724		} else {1725			None1726		}1727	}1728	fn syntax(&self) -> &SyntaxNode {1729		&self.syntax1730	}1731}1732impl AstNode for Param {1733	fn can_cast(kind: SyntaxKind) -> bool {1734		kind == PARAM1735	}1736	fn cast(syntax: SyntaxNode) -> Option<Self> {1737		if Self::can_cast(syntax.kind()) {1738			Some(Self { syntax })1739		} else {1740			None1741		}1742	}1743	fn syntax(&self) -> &SyntaxNode {1744		&self.syntax1745	}1746}1747impl AstNode for DestructFull {1748	fn can_cast(kind: SyntaxKind) -> bool {1749		kind == DESTRUCT_FULL1750	}1751	fn cast(syntax: SyntaxNode) -> Option<Self> {1752		if Self::can_cast(syntax.kind()) {1753			Some(Self { syntax })1754		} else {1755			None1756		}1757	}1758	fn syntax(&self) -> &SyntaxNode {1759		&self.syntax1760	}1761}1762impl AstNode for DestructSkip {1763	fn can_cast(kind: SyntaxKind) -> bool {1764		kind == DESTRUCT_SKIP1765	}1766	fn cast(syntax: SyntaxNode) -> Option<Self> {1767		if Self::can_cast(syntax.kind()) {1768			Some(Self { syntax })1769		} else {1770			None1771		}1772	}1773	fn syntax(&self) -> &SyntaxNode {1774		&self.syntax1775	}1776}1777impl AstNode for DestructArray {1778	fn can_cast(kind: SyntaxKind) -> bool {1779		kind == DESTRUCT_ARRAY1780	}1781	fn cast(syntax: SyntaxNode) -> Option<Self> {1782		if Self::can_cast(syntax.kind()) {1783			Some(Self { syntax })1784		} else {1785			None1786		}1787	}1788	fn syntax(&self) -> &SyntaxNode {1789		&self.syntax1790	}1791}1792impl AstNode for DestructObject {1793	fn can_cast(kind: SyntaxKind) -> bool {1794		kind == DESTRUCT_OBJECT1795	}1796	fn cast(syntax: SyntaxNode) -> Option<Self> {1797		if Self::can_cast(syntax.kind()) {1798			Some(Self { syntax })1799		} else {1800			None1801		}1802	}1803	fn syntax(&self) -> &SyntaxNode {1804		&self.syntax1805	}1806}1807impl AstNode for DestructObjectField {1808	fn can_cast(kind: SyntaxKind) -> bool {1809		kind == DESTRUCT_OBJECT_FIELD1810	}1811	fn cast(syntax: SyntaxNode) -> Option<Self> {1812		if Self::can_cast(syntax.kind()) {1813			Some(Self { syntax })1814		} else {1815			None1816		}1817	}1818	fn syntax(&self) -> &SyntaxNode {1819		&self.syntax1820	}1821}1822impl AstNode for DestructRest {1823	fn can_cast(kind: SyntaxKind) -> bool {1824		kind == DESTRUCT_REST1825	}1826	fn cast(syntax: SyntaxNode) -> Option<Self> {1827		if Self::can_cast(syntax.kind()) {1828			Some(Self { syntax })1829		} else {1830			None1831		}1832	}1833	fn syntax(&self) -> &SyntaxNode {1834		&self.syntax1835	}1836}1837impl AstNode for DestructArrayElement {1838	fn can_cast(kind: SyntaxKind) -> bool {1839		kind == DESTRUCT_ARRAY_ELEMENT1840	}1841	fn cast(syntax: SyntaxNode) -> Option<Self> {1842		if Self::can_cast(syntax.kind()) {1843			Some(Self { syntax })1844		} else {1845			None1846		}1847	}1848	fn syntax(&self) -> &SyntaxNode {1849		&self.syntax1850	}1851}1852impl From<ExprBinary> for Expr {1853	fn from(node: ExprBinary) -> Expr {1854		Expr::ExprBinary(node)1855	}1856}1857impl From<ExprUnary> for Expr {1858	fn from(node: ExprUnary) -> Expr {1859		Expr::ExprUnary(node)1860	}1861}1862impl From<ExprSlice> for Expr {1863	fn from(node: ExprSlice) -> Expr {1864		Expr::ExprSlice(node)1865	}1866}1867impl From<ExprIndex> for Expr {1868	fn from(node: ExprIndex) -> Expr {1869		Expr::ExprIndex(node)1870	}1871}1872impl From<ExprIndexExpr> for Expr {1873	fn from(node: ExprIndexExpr) -> Expr {1874		Expr::ExprIndexExpr(node)1875	}1876}1877impl From<ExprApply> for Expr {1878	fn from(node: ExprApply) -> Expr {1879		Expr::ExprApply(node)1880	}1881}1882impl From<ExprObjExtend> for Expr {1883	fn from(node: ExprObjExtend) -> Expr {1884		Expr::ExprObjExtend(node)1885	}1886}1887impl From<ExprParened> for Expr {1888	fn from(node: ExprParened) -> Expr {1889		Expr::ExprParened(node)1890	}1891}1892impl From<ExprString> for Expr {1893	fn from(node: ExprString) -> Expr {1894		Expr::ExprString(node)1895	}1896}1897impl From<ExprNumber> for Expr {1898	fn from(node: ExprNumber) -> Expr {1899		Expr::ExprNumber(node)1900	}1901}1902impl From<ExprLiteral> for Expr {1903	fn from(node: ExprLiteral) -> Expr {1904		Expr::ExprLiteral(node)1905	}1906}1907impl From<ExprArray> for Expr {1908	fn from(node: ExprArray) -> Expr {1909		Expr::ExprArray(node)1910	}1911}1912impl From<ExprObject> for Expr {1913	fn from(node: ExprObject) -> Expr {1914		Expr::ExprObject(node)1915	}1916}1917impl From<ExprArrayComp> for Expr {1918	fn from(node: ExprArrayComp) -> Expr {1919		Expr::ExprArrayComp(node)1920	}1921}1922impl From<ExprImport> for Expr {1923	fn from(node: ExprImport) -> Expr {1924		Expr::ExprImport(node)1925	}1926}1927impl From<ExprVar> for Expr {1928	fn from(node: ExprVar) -> Expr {1929		Expr::ExprVar(node)1930	}1931}1932impl From<ExprLocal> for Expr {1933	fn from(node: ExprLocal) -> Expr {1934		Expr::ExprLocal(node)1935	}1936}1937impl From<ExprIfThenElse> for Expr {1938	fn from(node: ExprIfThenElse) -> Expr {1939		Expr::ExprIfThenElse(node)1940	}1941}1942impl From<ExprFunction> for Expr {1943	fn from(node: ExprFunction) -> Expr {1944		Expr::ExprFunction(node)1945	}1946}1947impl From<ExprAssert> for Expr {1948	fn from(node: ExprAssert) -> Expr {1949		Expr::ExprAssert(node)1950	}1951}1952impl From<ExprError> for Expr {1953	fn from(node: ExprError) -> Expr {1954		Expr::ExprError(node)1955	}1956}1957impl AstNode for Expr {1958	fn can_cast(kind: SyntaxKind) -> bool {1959		match kind {1960			EXPR_BINARY | EXPR_UNARY | EXPR_SLICE | EXPR_INDEX | EXPR_INDEX_EXPR | EXPR_APPLY1961			| EXPR_OBJ_EXTEND | EXPR_PARENED | EXPR_STRING | EXPR_NUMBER | EXPR_LITERAL1962			| EXPR_ARRAY | EXPR_OBJECT | EXPR_ARRAY_COMP | EXPR_IMPORT | EXPR_VAR | EXPR_LOCAL1963			| EXPR_IF_THEN_ELSE | EXPR_FUNCTION | EXPR_ASSERT | EXPR_ERROR => true,1964			_ => false,1965		}1966	}1967	fn cast(syntax: SyntaxNode) -> Option<Self> {1968		let res = match syntax.kind() {1969			EXPR_BINARY => Expr::ExprBinary(ExprBinary { syntax }),1970			EXPR_UNARY => Expr::ExprUnary(ExprUnary { syntax }),1971			EXPR_SLICE => Expr::ExprSlice(ExprSlice { syntax }),1972			EXPR_INDEX => Expr::ExprIndex(ExprIndex { syntax }),1973			EXPR_INDEX_EXPR => Expr::ExprIndexExpr(ExprIndexExpr { syntax }),1974			EXPR_APPLY => Expr::ExprApply(ExprApply { syntax }),1975			EXPR_OBJ_EXTEND => Expr::ExprObjExtend(ExprObjExtend { syntax }),1976			EXPR_PARENED => Expr::ExprParened(ExprParened { syntax }),1977			EXPR_STRING => Expr::ExprString(ExprString { syntax }),1978			EXPR_NUMBER => Expr::ExprNumber(ExprNumber { syntax }),1979			EXPR_LITERAL => Expr::ExprLiteral(ExprLiteral { syntax }),1980			EXPR_ARRAY => Expr::ExprArray(ExprArray { syntax }),1981			EXPR_OBJECT => Expr::ExprObject(ExprObject { syntax }),1982			EXPR_ARRAY_COMP => Expr::ExprArrayComp(ExprArrayComp { syntax }),1983			EXPR_IMPORT => Expr::ExprImport(ExprImport { syntax }),1984			EXPR_VAR => Expr::ExprVar(ExprVar { syntax }),1985			EXPR_LOCAL => Expr::ExprLocal(ExprLocal { syntax }),1986			EXPR_IF_THEN_ELSE => Expr::ExprIfThenElse(ExprIfThenElse { syntax }),1987			EXPR_FUNCTION => Expr::ExprFunction(ExprFunction { syntax }),1988			EXPR_ASSERT => Expr::ExprAssert(ExprAssert { syntax }),1989			EXPR_ERROR => Expr::ExprError(ExprError { syntax }),1990			_ => return None,1991		};1992		Some(res)1993	}1994	fn syntax(&self) -> &SyntaxNode {1995		match self {1996			Expr::ExprBinary(it) => &it.syntax,1997			Expr::ExprUnary(it) => &it.syntax,1998			Expr::ExprSlice(it) => &it.syntax,1999			Expr::ExprIndex(it) => &it.syntax,2000			Expr::ExprIndexExpr(it) => &it.syntax,2001			Expr::ExprApply(it) => &it.syntax,2002			Expr::ExprObjExtend(it) => &it.syntax,2003			Expr::ExprParened(it) => &it.syntax,2004			Expr::ExprString(it) => &it.syntax,2005			Expr::ExprNumber(it) => &it.syntax,2006			Expr::ExprLiteral(it) => &it.syntax,2007			Expr::ExprArray(it) => &it.syntax,2008			Expr::ExprObject(it) => &it.syntax,2009			Expr::ExprArrayComp(it) => &it.syntax,2010			Expr::ExprImport(it) => &it.syntax,2011			Expr::ExprVar(it) => &it.syntax,2012			Expr::ExprLocal(it) => &it.syntax,2013			Expr::ExprIfThenElse(it) => &it.syntax,2014			Expr::ExprFunction(it) => &it.syntax,2015			Expr::ExprAssert(it) => &it.syntax,2016			Expr::ExprError(it) => &it.syntax,2017		}2018	}2019}2020impl From<ObjBodyComp> for ObjBody {2021	fn from(node: ObjBodyComp) -> ObjBody {2022		ObjBody::ObjBodyComp(node)2023	}2024}2025impl From<ObjBodyMemberList> for ObjBody {2026	fn from(node: ObjBodyMemberList) -> ObjBody {2027		ObjBody::ObjBodyMemberList(node)2028	}2029}2030impl AstNode for ObjBody {2031	fn can_cast(kind: SyntaxKind) -> bool {2032		match kind {2033			OBJ_BODY_COMP | OBJ_BODY_MEMBER_LIST => true,2034			_ => false,2035		}2036	}2037	fn cast(syntax: SyntaxNode) -> Option<Self> {2038		let res = match syntax.kind() {2039			OBJ_BODY_COMP => ObjBody::ObjBodyComp(ObjBodyComp { syntax }),2040			OBJ_BODY_MEMBER_LIST => ObjBody::ObjBodyMemberList(ObjBodyMemberList { syntax }),2041			_ => return None,2042		};2043		Some(res)2044	}2045	fn syntax(&self) -> &SyntaxNode {2046		match self {2047			ObjBody::ObjBodyComp(it) => &it.syntax,2048			ObjBody::ObjBodyMemberList(it) => &it.syntax,2049		}2050	}2051}2052impl From<ForSpec> for CompSpec {2053	fn from(node: ForSpec) -> CompSpec {2054		CompSpec::ForSpec(node)2055	}2056}2057impl From<IfSpec> for CompSpec {2058	fn from(node: IfSpec) -> CompSpec {2059		CompSpec::IfSpec(node)2060	}2061}2062impl AstNode for CompSpec {2063	fn can_cast(kind: SyntaxKind) -> bool {2064		match kind {2065			FOR_SPEC | IF_SPEC => true,2066			_ => false,2067		}2068	}2069	fn cast(syntax: SyntaxNode) -> Option<Self> {2070		let res = match syntax.kind() {2071			FOR_SPEC => CompSpec::ForSpec(ForSpec { syntax }),2072			IF_SPEC => CompSpec::IfSpec(IfSpec { syntax }),2073			_ => return None,2074		};2075		Some(res)2076	}2077	fn syntax(&self) -> &SyntaxNode {2078		match self {2079			CompSpec::ForSpec(it) => &it.syntax,2080			CompSpec::IfSpec(it) => &it.syntax,2081		}2082	}2083}2084impl From<BindDestruct> for Bind {2085	fn from(node: BindDestruct) -> Bind {2086		Bind::BindDestruct(node)2087	}2088}2089impl From<BindFunction> for Bind {2090	fn from(node: BindFunction) -> Bind {2091		Bind::BindFunction(node)2092	}2093}2094impl AstNode for Bind {2095	fn can_cast(kind: SyntaxKind) -> bool {2096		match kind {2097			BIND_DESTRUCT | BIND_FUNCTION => true,2098			_ => false,2099		}2100	}2101	fn cast(syntax: SyntaxNode) -> Option<Self> {2102		let res = match syntax.kind() {2103			BIND_DESTRUCT => Bind::BindDestruct(BindDestruct { syntax }),2104			BIND_FUNCTION => Bind::BindFunction(BindFunction { syntax }),2105			_ => return None,2106		};2107		Some(res)2108	}2109	fn syntax(&self) -> &SyntaxNode {2110		match self {2111			Bind::BindDestruct(it) => &it.syntax,2112			Bind::BindFunction(it) => &it.syntax,2113		}2114	}2115}2116impl From<MemberBindStmt> for MemberComp {2117	fn from(node: MemberBindStmt) -> MemberComp {2118		MemberComp::MemberBindStmt(node)2119	}2120}2121impl From<MemberFieldNormal> for MemberComp {2122	fn from(node: MemberFieldNormal) -> MemberComp {2123		MemberComp::MemberFieldNormal(node)2124	}2125}2126impl From<MemberFieldMethod> for MemberComp {2127	fn from(node: MemberFieldMethod) -> MemberComp {2128		MemberComp::MemberFieldMethod(node)2129	}2130}2131impl AstNode for MemberComp {2132	fn can_cast(kind: SyntaxKind) -> bool {2133		match kind {2134			MEMBER_BIND_STMT | MEMBER_FIELD_NORMAL | MEMBER_FIELD_METHOD => true,2135			_ => false,2136		}2137	}2138	fn cast(syntax: SyntaxNode) -> Option<Self> {2139		let res = match syntax.kind() {2140			MEMBER_BIND_STMT => MemberComp::MemberBindStmt(MemberBindStmt { syntax }),2141			MEMBER_FIELD_NORMAL => MemberComp::MemberFieldNormal(MemberFieldNormal { syntax }),2142			MEMBER_FIELD_METHOD => MemberComp::MemberFieldMethod(MemberFieldMethod { syntax }),2143			_ => return None,2144		};2145		Some(res)2146	}2147	fn syntax(&self) -> &SyntaxNode {2148		match self {2149			MemberComp::MemberBindStmt(it) => &it.syntax,2150			MemberComp::MemberFieldNormal(it) => &it.syntax,2151			MemberComp::MemberFieldMethod(it) => &it.syntax,2152		}2153	}2154}2155impl From<MemberBindStmt> for Member {2156	fn from(node: MemberBindStmt) -> Member {2157		Member::MemberBindStmt(node)2158	}2159}2160impl From<MemberAssertStmt> for Member {2161	fn from(node: MemberAssertStmt) -> Member {2162		Member::MemberAssertStmt(node)2163	}2164}2165impl From<MemberFieldNormal> for Member {2166	fn from(node: MemberFieldNormal) -> Member {2167		Member::MemberFieldNormal(node)2168	}2169}2170impl From<MemberFieldMethod> for Member {2171	fn from(node: MemberFieldMethod) -> Member {2172		Member::MemberFieldMethod(node)2173	}2174}2175impl AstNode for Member {2176	fn can_cast(kind: SyntaxKind) -> bool {2177		match kind {2178			MEMBER_BIND_STMT | MEMBER_ASSERT_STMT | MEMBER_FIELD_NORMAL | MEMBER_FIELD_METHOD => {2179				true2180			}2181			_ => false,2182		}2183	}2184	fn cast(syntax: SyntaxNode) -> Option<Self> {2185		let res = match syntax.kind() {2186			MEMBER_BIND_STMT => Member::MemberBindStmt(MemberBindStmt { syntax }),2187			MEMBER_ASSERT_STMT => Member::MemberAssertStmt(MemberAssertStmt { syntax }),2188			MEMBER_FIELD_NORMAL => Member::MemberFieldNormal(MemberFieldNormal { syntax }),2189			MEMBER_FIELD_METHOD => Member::MemberFieldMethod(MemberFieldMethod { syntax }),2190			_ => return None,2191		};2192		Some(res)2193	}2194	fn syntax(&self) -> &SyntaxNode {2195		match self {2196			Member::MemberBindStmt(it) => &it.syntax,2197			Member::MemberAssertStmt(it) => &it.syntax,2198			Member::MemberFieldNormal(it) => &it.syntax,2199			Member::MemberFieldMethod(it) => &it.syntax,2200		}2201	}2202}2203impl From<FieldNameFixed> for FieldName {2204	fn from(node: FieldNameFixed) -> FieldName {2205		FieldName::FieldNameFixed(node)2206	}2207}2208impl From<FieldNameDynamic> for FieldName {2209	fn from(node: FieldNameDynamic) -> FieldName {2210		FieldName::FieldNameDynamic(node)2211	}2212}2213impl AstNode for FieldName {2214	fn can_cast(kind: SyntaxKind) -> bool {2215		match kind {2216			FIELD_NAME_FIXED | FIELD_NAME_DYNAMIC => true,2217			_ => false,2218		}2219	}2220	fn cast(syntax: SyntaxNode) -> Option<Self> {2221		let res = match syntax.kind() {2222			FIELD_NAME_FIXED => FieldName::FieldNameFixed(FieldNameFixed { syntax }),2223			FIELD_NAME_DYNAMIC => FieldName::FieldNameDynamic(FieldNameDynamic { syntax }),2224			_ => return None,2225		};2226		Some(res)2227	}2228	fn syntax(&self) -> &SyntaxNode {2229		match self {2230			FieldName::FieldNameFixed(it) => &it.syntax,2231			FieldName::FieldNameDynamic(it) => &it.syntax,2232		}2233	}2234}2235impl From<DestructFull> for Destruct {2236	fn from(node: DestructFull) -> Destruct {2237		Destruct::DestructFull(node)2238	}2239}2240impl From<DestructSkip> for Destruct {2241	fn from(node: DestructSkip) -> Destruct {2242		Destruct::DestructSkip(node)2243	}2244}2245impl From<DestructArray> for Destruct {2246	fn from(node: DestructArray) -> Destruct {2247		Destruct::DestructArray(node)2248	}2249}2250impl From<DestructObject> for Destruct {2251	fn from(node: DestructObject) -> Destruct {2252		Destruct::DestructObject(node)2253	}2254}2255impl AstNode for Destruct {2256	fn can_cast(kind: SyntaxKind) -> bool {2257		match kind {2258			DESTRUCT_FULL | DESTRUCT_SKIP | DESTRUCT_ARRAY | DESTRUCT_OBJECT => true,2259			_ => false,2260		}2261	}2262	fn cast(syntax: SyntaxNode) -> Option<Self> {2263		let res = match syntax.kind() {2264			DESTRUCT_FULL => Destruct::DestructFull(DestructFull { syntax }),2265			DESTRUCT_SKIP => Destruct::DestructSkip(DestructSkip { syntax }),2266			DESTRUCT_ARRAY => Destruct::DestructArray(DestructArray { syntax }),2267			DESTRUCT_OBJECT => Destruct::DestructObject(DestructObject { syntax }),2268			_ => return None,2269		};2270		Some(res)2271	}2272	fn syntax(&self) -> &SyntaxNode {2273		match self {2274			Destruct::DestructFull(it) => &it.syntax,2275			Destruct::DestructSkip(it) => &it.syntax,2276			Destruct::DestructArray(it) => &it.syntax,2277			Destruct::DestructObject(it) => &it.syntax,2278		}2279	}2280}2281impl From<DestructArrayElement> for DestructArrayPart {2282	fn from(node: DestructArrayElement) -> DestructArrayPart {2283		DestructArrayPart::DestructArrayElement(node)2284	}2285}2286impl From<DestructRest> for DestructArrayPart {2287	fn from(node: DestructRest) -> DestructArrayPart {2288		DestructArrayPart::DestructRest(node)2289	}2290}2291impl AstNode for DestructArrayPart {2292	fn can_cast(kind: SyntaxKind) -> bool {2293		match kind {2294			DESTRUCT_ARRAY_ELEMENT | DESTRUCT_REST => true,2295			_ => false,2296		}2297	}2298	fn cast(syntax: SyntaxNode) -> Option<Self> {2299		let res = match syntax.kind() {2300			DESTRUCT_ARRAY_ELEMENT => {2301				DestructArrayPart::DestructArrayElement(DestructArrayElement { syntax })2302			}2303			DESTRUCT_REST => DestructArrayPart::DestructRest(DestructRest { syntax }),2304			_ => return None,2305		};2306		Some(res)2307	}2308	fn syntax(&self) -> &SyntaxNode {2309		match self {2310			DestructArrayPart::DestructArrayElement(it) => &it.syntax,2311			DestructArrayPart::DestructRest(it) => &it.syntax,2312		}2313	}2314}2315impl AstToken for BinaryOperator {2316	fn can_cast(kind: SyntaxKind) -> bool {2317		BinaryOperatorKind::can_cast(kind)2318	}2319	fn cast(syntax: SyntaxToken) -> Option<Self> {2320		let kind = BinaryOperatorKind::cast(syntax.kind())?;2321		Some(BinaryOperator { syntax, kind })2322	}2323	fn syntax(&self) -> &SyntaxToken {2324		&self.syntax2325	}2326}2327impl BinaryOperatorKind {2328	fn can_cast(kind: SyntaxKind) -> bool {2329		match kind {2330			OR | AND | BIT_OR | BIT_XOR | BIT_AND | EQ | NE | LT | GT | LE | GE | IN_KW | LHS2331			| RHS | PLUS | MINUS | MUL | DIV | MODULO | META_OBJECT_APPLY | ERROR_NO_OPERATOR => true,2332			_ => false,2333		}2334	}2335	pub fn cast(kind: SyntaxKind) -> Option<Self> {2336		let res = match kind {2337			OR => Self::Or,2338			AND => Self::And,2339			BIT_OR => Self::BitOr,2340			BIT_XOR => Self::BitXor,2341			BIT_AND => Self::BitAnd,2342			EQ => Self::Eq,2343			NE => Self::Ne,2344			LT => Self::Lt,2345			GT => Self::Gt,2346			LE => Self::Le,2347			GE => Self::Ge,2348			IN_KW => Self::InKw,2349			LHS => Self::Lhs,2350			RHS => Self::Rhs,2351			PLUS => Self::Plus,2352			MINUS => Self::Minus,2353			MUL => Self::Mul,2354			DIV => Self::Div,2355			MODULO => Self::Modulo,2356			META_OBJECT_APPLY => Self::MetaObjectApply,2357			ERROR_NO_OPERATOR => Self::ErrorNoOperator,2358			_ => return None,2359		};2360		Some(res)2361	}2362}2363impl BinaryOperator {2364	pub fn kind(&self) -> BinaryOperatorKind {2365		self.kind2366	}2367}2368impl std::fmt::Display for BinaryOperator {2369	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2370		std::fmt::Display::fmt(self.syntax(), f)2371	}2372}2373impl AstToken for UnaryOperator {2374	fn can_cast(kind: SyntaxKind) -> bool {2375		UnaryOperatorKind::can_cast(kind)2376	}2377	fn cast(syntax: SyntaxToken) -> Option<Self> {2378		let kind = UnaryOperatorKind::cast(syntax.kind())?;2379		Some(UnaryOperator { syntax, kind })2380	}2381	fn syntax(&self) -> &SyntaxToken {2382		&self.syntax2383	}2384}2385impl UnaryOperatorKind {2386	fn can_cast(kind: SyntaxKind) -> bool {2387		match kind {2388			MINUS | NOT | BIT_NOT => true,2389			_ => false,2390		}2391	}2392	pub fn cast(kind: SyntaxKind) -> Option<Self> {2393		let res = match kind {2394			MINUS => Self::Minus,2395			NOT => Self::Not,2396			BIT_NOT => Self::BitNot,2397			_ => return None,2398		};2399		Some(res)2400	}2401}2402impl UnaryOperator {2403	pub fn kind(&self) -> UnaryOperatorKind {2404		self.kind2405	}2406}2407impl std::fmt::Display for UnaryOperator {2408	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2409		std::fmt::Display::fmt(self.syntax(), f)2410	}2411}2412impl AstToken for Literal {2413	fn can_cast(kind: SyntaxKind) -> bool {2414		LiteralKind::can_cast(kind)2415	}2416	fn cast(syntax: SyntaxToken) -> Option<Self> {2417		let kind = LiteralKind::cast(syntax.kind())?;2418		Some(Literal { syntax, kind })2419	}2420	fn syntax(&self) -> &SyntaxToken {2421		&self.syntax2422	}2423}2424impl LiteralKind {2425	fn can_cast(kind: SyntaxKind) -> bool {2426		match kind {2427			NULL_KW | TRUE_KW | FALSE_KW | SELF_KW | DOLLAR | SUPER_KW => true,2428			_ => false,2429		}2430	}2431	pub fn cast(kind: SyntaxKind) -> Option<Self> {2432		let res = match kind {2433			NULL_KW => Self::NullKw,2434			TRUE_KW => Self::TrueKw,2435			FALSE_KW => Self::FalseKw,2436			SELF_KW => Self::SelfKw,2437			DOLLAR => Self::Dollar,2438			SUPER_KW => Self::SuperKw,2439			_ => return None,2440		};2441		Some(res)2442	}2443}2444impl Literal {2445	pub fn kind(&self) -> LiteralKind {2446		self.kind2447	}2448}2449impl std::fmt::Display for Literal {2450	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2451		std::fmt::Display::fmt(self.syntax(), f)2452	}2453}2454impl AstToken for Text {2455	fn can_cast(kind: SyntaxKind) -> bool {2456		TextKind::can_cast(kind)2457	}2458	fn cast(syntax: SyntaxToken) -> Option<Self> {2459		let kind = TextKind::cast(syntax.kind())?;2460		Some(Text { syntax, kind })2461	}2462	fn syntax(&self) -> &SyntaxToken {2463		&self.syntax2464	}2465}2466impl TextKind {2467	fn can_cast(kind: SyntaxKind) -> bool {2468		match kind {2469			STRING_DOUBLE2470			| ERROR_STRING_DOUBLE_UNTERMINATED2471			| STRING_SINGLE2472			| ERROR_STRING_SINGLE_UNTERMINATED2473			| STRING_DOUBLE_VERBATIM2474			| ERROR_STRING_DOUBLE_VERBATIM_UNTERMINATED2475			| STRING_SINGLE_VERBATIM2476			| ERROR_STRING_SINGLE_VERBATIM_UNTERMINATED2477			| ERROR_STRING_VERBATIM_MISSING_QUOTES2478			| STRING_BLOCK2479			| ERROR_STRING_BLOCK_UNEXPECTED_END2480			| ERROR_STRING_BLOCK_MISSING_NEW_LINE2481			| ERROR_STRING_BLOCK_MISSING_TERMINATION2482			| ERROR_STRING_BLOCK_MISSING_INDENT => true,2483			_ => false,2484		}2485	}2486	pub fn cast(kind: SyntaxKind) -> Option<Self> {2487		let res = match kind {2488			STRING_DOUBLE => Self::StringDouble,2489			ERROR_STRING_DOUBLE_UNTERMINATED => Self::ErrorStringDoubleUnterminated,2490			STRING_SINGLE => Self::StringSingle,2491			ERROR_STRING_SINGLE_UNTERMINATED => Self::ErrorStringSingleUnterminated,2492			STRING_DOUBLE_VERBATIM => Self::StringDoubleVerbatim,2493			ERROR_STRING_DOUBLE_VERBATIM_UNTERMINATED => {2494				Self::ErrorStringDoubleVerbatimUnterminated2495			}2496			STRING_SINGLE_VERBATIM => Self::StringSingleVerbatim,2497			ERROR_STRING_SINGLE_VERBATIM_UNTERMINATED => {2498				Self::ErrorStringSingleVerbatimUnterminated2499			}2500			ERROR_STRING_VERBATIM_MISSING_QUOTES => Self::ErrorStringVerbatimMissingQuotes,2501			STRING_BLOCK => Self::StringBlock,2502			ERROR_STRING_BLOCK_UNEXPECTED_END => Self::ErrorStringBlockUnexpectedEnd,2503			ERROR_STRING_BLOCK_MISSING_NEW_LINE => Self::ErrorStringBlockMissingNewLine,2504			ERROR_STRING_BLOCK_MISSING_TERMINATION => Self::ErrorStringBlockMissingTermination,2505			ERROR_STRING_BLOCK_MISSING_INDENT => Self::ErrorStringBlockMissingIndent,2506			_ => return None,2507		};2508		Some(res)2509	}2510}2511impl Text {2512	pub fn kind(&self) -> TextKind {2513		self.kind2514	}2515}2516impl std::fmt::Display for Text {2517	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2518		std::fmt::Display::fmt(self.syntax(), f)2519	}2520}2521impl AstToken for Number {2522	fn can_cast(kind: SyntaxKind) -> bool {2523		NumberKind::can_cast(kind)2524	}2525	fn cast(syntax: SyntaxToken) -> Option<Self> {2526		let kind = NumberKind::cast(syntax.kind())?;2527		Some(Number { syntax, kind })2528	}2529	fn syntax(&self) -> &SyntaxToken {2530		&self.syntax2531	}2532}2533impl NumberKind {2534	fn can_cast(kind: SyntaxKind) -> bool {2535		match kind {2536			FLOAT2537			| ERROR_FLOAT_JUNK_AFTER_POINT2538			| ERROR_FLOAT_JUNK_AFTER_EXPONENT2539			| ERROR_FLOAT_JUNK_AFTER_EXPONENT_SIGN => true,2540			_ => false,2541		}2542	}2543	pub fn cast(kind: SyntaxKind) -> Option<Self> {2544		let res = match kind {2545			FLOAT => Self::Float,2546			ERROR_FLOAT_JUNK_AFTER_POINT => Self::ErrorFloatJunkAfterPoint,2547			ERROR_FLOAT_JUNK_AFTER_EXPONENT => Self::ErrorFloatJunkAfterExponent,2548			ERROR_FLOAT_JUNK_AFTER_EXPONENT_SIGN => Self::ErrorFloatJunkAfterExponentSign,2549			_ => return None,2550		};2551		Some(res)2552	}2553}2554impl Number {2555	pub fn kind(&self) -> NumberKind {2556		self.kind2557	}2558}2559impl std::fmt::Display for Number {2560	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2561		std::fmt::Display::fmt(self.syntax(), f)2562	}2563}2564impl AstToken for ImportKind {2565	fn can_cast(kind: SyntaxKind) -> bool {2566		ImportKindKind::can_cast(kind)2567	}2568	fn cast(syntax: SyntaxToken) -> Option<Self> {2569		let kind = ImportKindKind::cast(syntax.kind())?;2570		Some(ImportKind { syntax, kind })2571	}2572	fn syntax(&self) -> &SyntaxToken {2573		&self.syntax2574	}2575}2576impl ImportKindKind {2577	fn can_cast(kind: SyntaxKind) -> bool {2578		match kind {2579			IMPORTSTR_KW | IMPORTBIN_KW | IMPORT_KW => true,2580			_ => false,2581		}2582	}2583	pub fn cast(kind: SyntaxKind) -> Option<Self> {2584		let res = match kind {2585			IMPORTSTR_KW => Self::ImportstrKw,2586			IMPORTBIN_KW => Self::ImportbinKw,2587			IMPORT_KW => Self::ImportKw,2588			_ => return None,2589		};2590		Some(res)2591	}2592}2593impl ImportKind {2594	pub fn kind(&self) -> ImportKindKind {2595		self.kind2596	}2597}2598impl std::fmt::Display for ImportKind {2599	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2600		std::fmt::Display::fmt(self.syntax(), f)2601	}2602}2603impl AstToken for Visibility {2604	fn can_cast(kind: SyntaxKind) -> bool {2605		VisibilityKind::can_cast(kind)2606	}2607	fn cast(syntax: SyntaxToken) -> Option<Self> {2608		let kind = VisibilityKind::cast(syntax.kind())?;2609		Some(Visibility { syntax, kind })2610	}2611	fn syntax(&self) -> &SyntaxToken {2612		&self.syntax2613	}2614}2615impl VisibilityKind {2616	fn can_cast(kind: SyntaxKind) -> bool {2617		match kind {2618			COLONCOLONCOLON | COLONCOLON | COLON => true,2619			_ => false,2620		}2621	}2622	pub fn cast(kind: SyntaxKind) -> Option<Self> {2623		let res = match kind {2624			COLONCOLONCOLON => Self::Coloncoloncolon,2625			COLONCOLON => Self::Coloncolon,2626			COLON => Self::Colon,2627			_ => return None,2628		};2629		Some(res)2630	}2631}2632impl Visibility {2633	pub fn kind(&self) -> VisibilityKind {2634		self.kind2635	}2636}2637impl std::fmt::Display for Visibility {2638	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2639		std::fmt::Display::fmt(self.syntax(), f)2640	}2641}2642impl AstToken for Trivia {2643	fn can_cast(kind: SyntaxKind) -> bool {2644		TriviaKind::can_cast(kind)2645	}2646	fn cast(syntax: SyntaxToken) -> Option<Self> {2647		let kind = TriviaKind::cast(syntax.kind())?;2648		Some(Trivia { syntax, kind })2649	}2650	fn syntax(&self) -> &SyntaxToken {2651		&self.syntax2652	}2653}2654impl TriviaKind {2655	fn can_cast(kind: SyntaxKind) -> bool {2656		match kind {2657			WHITESPACE2658			| MULTI_LINE_COMMENT2659			| ERROR_COMMENT_TOO_SHORT2660			| ERROR_COMMENT_UNTERMINATED2661			| SINGLE_LINE_HASH_COMMENT2662			| SINGLE_LINE_SLASH_COMMENT => true,2663			_ => false,2664		}2665	}2666	pub fn cast(kind: SyntaxKind) -> Option<Self> {2667		let res = match kind {2668			WHITESPACE => Self::Whitespace,2669			MULTI_LINE_COMMENT => Self::MultiLineComment,2670			ERROR_COMMENT_TOO_SHORT => Self::ErrorCommentTooShort,2671			ERROR_COMMENT_UNTERMINATED => Self::ErrorCommentUnterminated,2672			SINGLE_LINE_HASH_COMMENT => Self::SingleLineHashComment,2673			SINGLE_LINE_SLASH_COMMENT => Self::SingleLineSlashComment,2674			_ => return None,2675		};2676		Some(res)2677	}2678}2679impl Trivia {2680	pub fn kind(&self) -> TriviaKind {2681		self.kind2682	}2683}2684impl std::fmt::Display for Trivia {2685	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2686		std::fmt::Display::fmt(self.syntax(), f)2687	}2688}2689impl AstToken for CustomError {2690	fn can_cast(kind: SyntaxKind) -> bool {2691		CustomErrorKind::can_cast(kind)2692	}2693	fn cast(syntax: SyntaxToken) -> Option<Self> {2694		let kind = CustomErrorKind::cast(syntax.kind())?;2695		Some(CustomError { syntax, kind })2696	}2697	fn syntax(&self) -> &SyntaxToken {2698		&self.syntax2699	}2700}2701impl CustomErrorKind {2702	fn can_cast(kind: SyntaxKind) -> bool {2703		match kind {2704			ERROR_MISSING_TOKEN | ERROR_UNEXPECTED_TOKEN | ERROR_CUSTOM => true,2705			_ => false,2706		}2707	}2708	pub fn cast(kind: SyntaxKind) -> Option<Self> {2709		let res = match kind {2710			ERROR_MISSING_TOKEN => Self::ErrorMissingToken,2711			ERROR_UNEXPECTED_TOKEN => Self::ErrorUnexpectedToken,2712			ERROR_CUSTOM => Self::ErrorCustom,2713			_ => return None,2714		};2715		Some(res)2716	}2717}2718impl CustomError {2719	pub fn kind(&self) -> CustomErrorKind {2720		self.kind2721	}2722}2723impl std::fmt::Display for CustomError {2724	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2725		std::fmt::Display::fmt(self.syntax(), f)2726	}2727}2728impl std::fmt::Display for Expr {2729	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2730		std::fmt::Display::fmt(self.syntax(), f)2731	}2732}2733impl std::fmt::Display for ObjBody {2734	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2735		std::fmt::Display::fmt(self.syntax(), f)2736	}2737}2738impl std::fmt::Display for CompSpec {2739	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2740		std::fmt::Display::fmt(self.syntax(), f)2741	}2742}2743impl std::fmt::Display for Bind {2744	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2745		std::fmt::Display::fmt(self.syntax(), f)2746	}2747}2748impl std::fmt::Display for MemberComp {2749	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2750		std::fmt::Display::fmt(self.syntax(), f)2751	}2752}2753impl std::fmt::Display for Member {2754	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2755		std::fmt::Display::fmt(self.syntax(), f)2756	}2757}2758impl std::fmt::Display for FieldName {2759	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2760		std::fmt::Display::fmt(self.syntax(), f)2761	}2762}2763impl std::fmt::Display for Destruct {2764	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2765		std::fmt::Display::fmt(self.syntax(), f)2766	}2767}2768impl std::fmt::Display for DestructArrayPart {2769	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2770		std::fmt::Display::fmt(self.syntax(), f)2771	}2772}2773impl std::fmt::Display for SourceFile {2774	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2775		std::fmt::Display::fmt(self.syntax(), f)2776	}2777}2778impl std::fmt::Display for ExprBinary {2779	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2780		std::fmt::Display::fmt(self.syntax(), f)2781	}2782}2783impl std::fmt::Display for LhsExpr {2784	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2785		std::fmt::Display::fmt(self.syntax(), f)2786	}2787}2788impl std::fmt::Display for ExprUnary {2789	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2790		std::fmt::Display::fmt(self.syntax(), f)2791	}2792}2793impl std::fmt::Display for ExprSlice {2794	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2795		std::fmt::Display::fmt(self.syntax(), f)2796	}2797}2798impl std::fmt::Display for SliceDesc {2799	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2800		std::fmt::Display::fmt(self.syntax(), f)2801	}2802}2803impl std::fmt::Display for ExprIndex {2804	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2805		std::fmt::Display::fmt(self.syntax(), f)2806	}2807}2808impl std::fmt::Display for Name {2809	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2810		std::fmt::Display::fmt(self.syntax(), f)2811	}2812}2813impl std::fmt::Display for ExprIndexExpr {2814	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2815		std::fmt::Display::fmt(self.syntax(), f)2816	}2817}2818impl std::fmt::Display for ExprApply {2819	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2820		std::fmt::Display::fmt(self.syntax(), f)2821	}2822}2823impl std::fmt::Display for ArgsDesc {2824	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2825		std::fmt::Display::fmt(self.syntax(), f)2826	}2827}2828impl std::fmt::Display for ExprObjExtend {2829	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2830		std::fmt::Display::fmt(self.syntax(), f)2831	}2832}2833impl std::fmt::Display for ExprParened {2834	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2835		std::fmt::Display::fmt(self.syntax(), f)2836	}2837}2838impl std::fmt::Display for ExprLiteral {2839	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2840		std::fmt::Display::fmt(self.syntax(), f)2841	}2842}2843impl std::fmt::Display for ExprString {2844	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2845		std::fmt::Display::fmt(self.syntax(), f)2846	}2847}2848impl std::fmt::Display for ExprNumber {2849	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2850		std::fmt::Display::fmt(self.syntax(), f)2851	}2852}2853impl std::fmt::Display for ExprArray {2854	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2855		std::fmt::Display::fmt(self.syntax(), f)2856	}2857}2858impl std::fmt::Display for ExprObject {2859	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2860		std::fmt::Display::fmt(self.syntax(), f)2861	}2862}2863impl std::fmt::Display for ExprArrayComp {2864	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2865		std::fmt::Display::fmt(self.syntax(), f)2866	}2867}2868impl std::fmt::Display for ExprImport {2869	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2870		std::fmt::Display::fmt(self.syntax(), f)2871	}2872}2873impl std::fmt::Display for ExprVar {2874	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2875		std::fmt::Display::fmt(self.syntax(), f)2876	}2877}2878impl std::fmt::Display for ExprLocal {2879	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2880		std::fmt::Display::fmt(self.syntax(), f)2881	}2882}2883impl std::fmt::Display for ExprIfThenElse {2884	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2885		std::fmt::Display::fmt(self.syntax(), f)2886	}2887}2888impl std::fmt::Display for TrueExpr {2889	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2890		std::fmt::Display::fmt(self.syntax(), f)2891	}2892}2893impl std::fmt::Display for FalseExpr {2894	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2895		std::fmt::Display::fmt(self.syntax(), f)2896	}2897}2898impl std::fmt::Display for ExprFunction {2899	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2900		std::fmt::Display::fmt(self.syntax(), f)2901	}2902}2903impl std::fmt::Display for ParamsDesc {2904	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2905		std::fmt::Display::fmt(self.syntax(), f)2906	}2907}2908impl std::fmt::Display for ExprAssert {2909	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2910		std::fmt::Display::fmt(self.syntax(), f)2911	}2912}2913impl std::fmt::Display for Assertion {2914	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2915		std::fmt::Display::fmt(self.syntax(), f)2916	}2917}2918impl std::fmt::Display for ExprError {2919	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2920		std::fmt::Display::fmt(self.syntax(), f)2921	}2922}2923impl std::fmt::Display for SliceDescEnd {2924	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2925		std::fmt::Display::fmt(self.syntax(), f)2926	}2927}2928impl std::fmt::Display for SliceDescStep {2929	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2930		std::fmt::Display::fmt(self.syntax(), f)2931	}2932}2933impl std::fmt::Display for Arg {2934	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2935		std::fmt::Display::fmt(self.syntax(), f)2936	}2937}2938impl std::fmt::Display for ObjBodyComp {2939	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2940		std::fmt::Display::fmt(self.syntax(), f)2941	}2942}2943impl std::fmt::Display for ObjBodyMemberList {2944	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2945		std::fmt::Display::fmt(self.syntax(), f)2946	}2947}2948impl std::fmt::Display for MemberBindStmt {2949	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2950		std::fmt::Display::fmt(self.syntax(), f)2951	}2952}2953impl std::fmt::Display for ObjLocal {2954	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2955		std::fmt::Display::fmt(self.syntax(), f)2956	}2957}2958impl std::fmt::Display for MemberAssertStmt {2959	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2960		std::fmt::Display::fmt(self.syntax(), f)2961	}2962}2963impl std::fmt::Display for MemberFieldNormal {2964	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2965		std::fmt::Display::fmt(self.syntax(), f)2966	}2967}2968impl std::fmt::Display for MemberFieldMethod {2969	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2970		std::fmt::Display::fmt(self.syntax(), f)2971	}2972}2973impl std::fmt::Display for FieldNameFixed {2974	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2975		std::fmt::Display::fmt(self.syntax(), f)2976	}2977}2978impl std::fmt::Display for FieldNameDynamic {2979	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2980		std::fmt::Display::fmt(self.syntax(), f)2981	}2982}2983impl std::fmt::Display for ForSpec {2984	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2985		std::fmt::Display::fmt(self.syntax(), f)2986	}2987}2988impl std::fmt::Display for IfSpec {2989	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2990		std::fmt::Display::fmt(self.syntax(), f)2991	}2992}2993impl std::fmt::Display for BindDestruct {2994	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {2995		std::fmt::Display::fmt(self.syntax(), f)2996	}2997}2998impl std::fmt::Display for BindFunction {2999	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {3000		std::fmt::Display::fmt(self.syntax(), f)3001	}3002}3003impl std::fmt::Display for Param {3004	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {3005		std::fmt::Display::fmt(self.syntax(), f)3006	}3007}3008impl std::fmt::Display for DestructFull {3009	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {3010		std::fmt::Display::fmt(self.syntax(), f)3011	}3012}3013impl std::fmt::Display for DestructSkip {3014	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {3015		std::fmt::Display::fmt(self.syntax(), f)3016	}3017}3018impl std::fmt::Display for DestructArray {3019	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {3020		std::fmt::Display::fmt(self.syntax(), f)3021	}3022}3023impl std::fmt::Display for DestructObject {3024	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {3025		std::fmt::Display::fmt(self.syntax(), f)3026	}3027}3028impl std::fmt::Display for DestructObjectField {3029	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {3030		std::fmt::Display::fmt(self.syntax(), f)3031	}3032}3033impl std::fmt::Display for DestructRest {3034	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {3035		std::fmt::Display::fmt(self.syntax(), f)3036	}3037}3038impl std::fmt::Display for DestructArrayElement {3039	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {3040		std::fmt::Display::fmt(self.syntax(), f)3041	}3042}
modifiedcrates/jrsonnet-rowan-parser/src/generated/syntax_kinds.rsdiffbeforeafterboth
--- a/crates/jrsonnet-rowan-parser/src/generated/syntax_kinds.rs
+++ b/crates/jrsonnet-rowan-parser/src/generated/syntax_kinds.rs
@@ -89,12 +89,6 @@
 	ASSIGN,
 	#[token("?")]
 	QUESTION_MARK,
-	#[token("$intrinsicThisFile")]
-	INTRINSIC_THIS_FILE,
-	#[token("$intrinsicId")]
-	INTRINSIC_ID,
-	#[token("$intrinsic")]
-	INTRINSIC,
 	#[regex("(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?(?:[eE][+-]?[0-9]+)?")]
 	FLOAT,
 	#[regex("(?:0|[1-9][0-9]*)\\.[^0-9]")]
@@ -199,9 +193,6 @@
 	EXPR_OBJ_EXTEND,
 	EXPR_PARENED,
 	EXPR_LITERAL,
-	EXPR_INTRINSIC_THIS_FILE,
-	EXPR_INTRINSIC_ID,
-	EXPR_INTRINSIC,
 	EXPR_STRING,
 	EXPR_NUMBER,
 	EXPR_ARRAY,
@@ -222,11 +213,9 @@
 	SLICE_DESC_STEP,
 	ARG,
 	OBJ_BODY_COMP,
-	OBJ_LOCAL_POST_COMMA,
-	OBJ_LOCAL_PRE_COMMA,
 	OBJ_BODY_MEMBER_LIST,
-	OBJ_LOCAL,
 	MEMBER_BIND_STMT,
+	OBJ_LOCAL,
 	MEMBER_ASSERT_STMT,
 	MEMBER_FIELD_NORMAL,
 	MEMBER_FIELD_METHOD,
@@ -248,6 +237,7 @@
 	OBJ_BODY,
 	COMP_SPEC,
 	BIND,
+	MEMBER_COMP,
 	MEMBER,
 	FIELD_NAME,
 	DESTRUCT,
@@ -260,7 +250,7 @@
 	IMPORT_KIND,
 	VISIBILITY,
 	TRIVIA,
-	PARSING_ERROR,
+	CUSTOM_ERROR,
 	#[doc(hidden)]
 	__LAST,
 }
@@ -271,18 +261,18 @@
 			OR | AND | BIT_OR | BIT_XOR | BIT_AND | EQ | NE | LT | GT | LE | GE | LHS | RHS
 			| PLUS | MINUS | MUL | DIV | MODULO | NOT | BIT_NOT | L_BRACK | R_BRACK | L_PAREN
 			| R_PAREN | L_BRACE | R_BRACE | COLON | COLONCOLON | COLONCOLONCOLON | SEMI | DOT
-			| DOTDOTDOT | COMMA | DOLLAR | ASSIGN | QUESTION_MARK | INTRINSIC_THIS_FILE
-			| INTRINSIC_ID | INTRINSIC | TAILSTRICT_KW | IMPORTSTR_KW | IMPORTBIN_KW
-			| IMPORT_KW | LOCAL_KW | IF_KW | THEN_KW | ELSE_KW | FUNCTION_KW | ERROR_KW | IN_KW
-			| NULL_KW | TRUE_KW | FALSE_KW | SELF_KW | SUPER_KW | FOR_KW | ASSERT_KW => true,
+			| DOTDOTDOT | COMMA | DOLLAR | ASSIGN | QUESTION_MARK | TAILSTRICT_KW
+			| IMPORTSTR_KW | IMPORTBIN_KW | IMPORT_KW | LOCAL_KW | IF_KW | THEN_KW | ELSE_KW
+			| FUNCTION_KW | ERROR_KW | IN_KW | NULL_KW | TRUE_KW | FALSE_KW | SELF_KW
+			| SUPER_KW | FOR_KW | ASSERT_KW => true,
 			_ => false,
 		}
 	}
 	pub fn is_enum(self) -> bool {
 		match self {
-			EXPR | OBJ_BODY | COMP_SPEC | BIND | MEMBER | FIELD_NAME | DESTRUCT
+			EXPR | OBJ_BODY | COMP_SPEC | BIND | MEMBER_COMP | MEMBER | FIELD_NAME | DESTRUCT
 			| DESTRUCT_ARRAY_PART | BINARY_OPERATOR | UNARY_OPERATOR | LITERAL | TEXT | NUMBER
-			| IMPORT_KIND | VISIBILITY | TRIVIA | PARSING_ERROR => true,
+			| IMPORT_KIND | VISIBILITY | TRIVIA | CUSTOM_ERROR => true,
 			_ => false,
 		}
 	}
@@ -295,5 +285,5 @@
 	}
 }
 #[macro_export]
-macro_rules ! T { [||] => { $ crate :: SyntaxKind :: OR } ; [&&] => { $ crate :: SyntaxKind :: AND } ; [|] => { $ crate :: SyntaxKind :: BIT_OR } ; [^] => { $ crate :: SyntaxKind :: BIT_XOR } ; [&] => { $ crate :: SyntaxKind :: BIT_AND } ; [==] => { $ crate :: SyntaxKind :: EQ } ; [!=] => { $ crate :: SyntaxKind :: NE } ; [<] => { $ crate :: SyntaxKind :: LT } ; [>] => { $ crate :: SyntaxKind :: GT } ; [<=] => { $ crate :: SyntaxKind :: LE } ; [>=] => { $ crate :: SyntaxKind :: GE } ; [<<] => { $ crate :: SyntaxKind :: LHS } ; [>>] => { $ crate :: SyntaxKind :: RHS } ; [+] => { $ crate :: SyntaxKind :: PLUS } ; [-] => { $ crate :: SyntaxKind :: MINUS } ; [*] => { $ crate :: SyntaxKind :: MUL } ; [/] => { $ crate :: SyntaxKind :: DIV } ; [%] => { $ crate :: SyntaxKind :: MODULO } ; [!] => { $ crate :: SyntaxKind :: NOT } ; [~] => { $ crate :: SyntaxKind :: BIT_NOT } ; ['['] => { $ crate :: SyntaxKind :: L_BRACK } ; [']'] => { $ crate :: SyntaxKind :: R_BRACK } ; ['('] => { $ crate :: SyntaxKind :: L_PAREN } ; [')'] => { $ crate :: SyntaxKind :: R_PAREN } ; ['{'] => { $ crate :: SyntaxKind :: L_BRACE } ; ['}'] => { $ crate :: SyntaxKind :: R_BRACE } ; [:] => { $ crate :: SyntaxKind :: COLON } ; [::] => { $ crate :: SyntaxKind :: COLONCOLON } ; [:::] => { $ crate :: SyntaxKind :: COLONCOLONCOLON } ; [;] => { $ crate :: SyntaxKind :: SEMI } ; [.] => { $ crate :: SyntaxKind :: DOT } ; [...] => { $ crate :: SyntaxKind :: DOTDOTDOT } ; [,] => { $ crate :: SyntaxKind :: COMMA } ; ['$'] => { $ crate :: SyntaxKind :: DOLLAR } ; [=] => { $ crate :: SyntaxKind :: ASSIGN } ; [?] => { $ crate :: SyntaxKind :: QUESTION_MARK } ; ["$intrinsicThisFile"] => { $ crate :: SyntaxKind :: INTRINSIC_THIS_FILE } ; ["$intrinsicId"] => { $ crate :: SyntaxKind :: INTRINSIC_ID } ; ["$intrinsic"] => { $ crate :: SyntaxKind :: INTRINSIC } ; [tailstrict] => { $ crate :: SyntaxKind :: TAILSTRICT_KW } ; [importstr] => { $ crate :: SyntaxKind :: IMPORTSTR_KW } ; [importbin] => { $ crate :: SyntaxKind :: IMPORTBIN_KW } ; [import] => { $ crate :: SyntaxKind :: IMPORT_KW } ; [local] => { $ crate :: SyntaxKind :: LOCAL_KW } ; [if] => { $ crate :: SyntaxKind :: IF_KW } ; [then] => { $ crate :: SyntaxKind :: THEN_KW } ; [else] => { $ crate :: SyntaxKind :: ELSE_KW } ; [function] => { $ crate :: SyntaxKind :: FUNCTION_KW } ; [error] => { $ crate :: SyntaxKind :: ERROR_KW } ; [in] => { $ crate :: SyntaxKind :: IN_KW } ; [null] => { $ crate :: SyntaxKind :: NULL_KW } ; [true] => { $ crate :: SyntaxKind :: TRUE_KW } ; [false] => { $ crate :: SyntaxKind :: FALSE_KW } ; [self] => { $ crate :: SyntaxKind :: SELF_KW } ; [super] => { $ crate :: SyntaxKind :: SUPER_KW } ; [for] => { $ crate :: SyntaxKind :: FOR_KW } ; [assert] => { $ crate :: SyntaxKind :: ASSERT_KW } }
+macro_rules ! T { [||] => { $ crate :: SyntaxKind :: OR } ; [&&] => { $ crate :: SyntaxKind :: AND } ; [|] => { $ crate :: SyntaxKind :: BIT_OR } ; [^] => { $ crate :: SyntaxKind :: BIT_XOR } ; [&] => { $ crate :: SyntaxKind :: BIT_AND } ; [==] => { $ crate :: SyntaxKind :: EQ } ; [!=] => { $ crate :: SyntaxKind :: NE } ; [<] => { $ crate :: SyntaxKind :: LT } ; [>] => { $ crate :: SyntaxKind :: GT } ; [<=] => { $ crate :: SyntaxKind :: LE } ; [>=] => { $ crate :: SyntaxKind :: GE } ; [<<] => { $ crate :: SyntaxKind :: LHS } ; [>>] => { $ crate :: SyntaxKind :: RHS } ; [+] => { $ crate :: SyntaxKind :: PLUS } ; [-] => { $ crate :: SyntaxKind :: MINUS } ; [*] => { $ crate :: SyntaxKind :: MUL } ; [/] => { $ crate :: SyntaxKind :: DIV } ; [%] => { $ crate :: SyntaxKind :: MODULO } ; [!] => { $ crate :: SyntaxKind :: NOT } ; [~] => { $ crate :: SyntaxKind :: BIT_NOT } ; ['['] => { $ crate :: SyntaxKind :: L_BRACK } ; [']'] => { $ crate :: SyntaxKind :: R_BRACK } ; ['('] => { $ crate :: SyntaxKind :: L_PAREN } ; [')'] => { $ crate :: SyntaxKind :: R_PAREN } ; ['{'] => { $ crate :: SyntaxKind :: L_BRACE } ; ['}'] => { $ crate :: SyntaxKind :: R_BRACE } ; [:] => { $ crate :: SyntaxKind :: COLON } ; [::] => { $ crate :: SyntaxKind :: COLONCOLON } ; [:::] => { $ crate :: SyntaxKind :: COLONCOLONCOLON } ; [;] => { $ crate :: SyntaxKind :: SEMI } ; [.] => { $ crate :: SyntaxKind :: DOT } ; [...] => { $ crate :: SyntaxKind :: DOTDOTDOT } ; [,] => { $ crate :: SyntaxKind :: COMMA } ; ['$'] => { $ crate :: SyntaxKind :: DOLLAR } ; [=] => { $ crate :: SyntaxKind :: ASSIGN } ; [?] => { $ crate :: SyntaxKind :: QUESTION_MARK } ; [tailstrict] => { $ crate :: SyntaxKind :: TAILSTRICT_KW } ; [importstr] => { $ crate :: SyntaxKind :: IMPORTSTR_KW } ; [importbin] => { $ crate :: SyntaxKind :: IMPORTBIN_KW } ; [import] => { $ crate :: SyntaxKind :: IMPORT_KW } ; [local] => { $ crate :: SyntaxKind :: LOCAL_KW } ; [if] => { $ crate :: SyntaxKind :: IF_KW } ; [then] => { $ crate :: SyntaxKind :: THEN_KW } ; [else] => { $ crate :: SyntaxKind :: ELSE_KW } ; [function] => { $ crate :: SyntaxKind :: FUNCTION_KW } ; [error] => { $ crate :: SyntaxKind :: ERROR_KW } ; [in] => { $ crate :: SyntaxKind :: IN_KW } ; [null] => { $ crate :: SyntaxKind :: NULL_KW } ; [true] => { $ crate :: SyntaxKind :: TRUE_KW } ; [false] => { $ crate :: SyntaxKind :: FALSE_KW } ; [self] => { $ crate :: SyntaxKind :: SELF_KW } ; [super] => { $ crate :: SyntaxKind :: SUPER_KW } ; [for] => { $ crate :: SyntaxKind :: FOR_KW } ; [assert] => { $ crate :: SyntaxKind :: ASSERT_KW } }
 pub use T;
modifiedcrates/jrsonnet-rowan-parser/src/parser.rsdiffbeforeafterboth
--- a/crates/jrsonnet-rowan-parser/src/parser.rs
+++ b/crates/jrsonnet-rowan-parser/src/parser.rs
@@ -114,7 +114,13 @@
 	pub fn parse(mut self) -> Vec<Event> {
 		let m = self.start();
 		expr(&mut self);
-		self.expect(EOF);
+		if !self.at(EOF) {
+			let m = self.start();
+			while !self.at(EOF) {
+				self.bump();
+			}
+			m.complete_error(&mut self, "unexpected tokens after end");
+		}
 		m.complete(&mut self, SOURCE_FILE);
 
 		self.events
@@ -832,21 +838,6 @@
 		let m = p.start();
 		name(p);
 		m.complete(p, EXPR_VAR)
-	} else if p.at(INTRINSIC_THIS_FILE) {
-		let m = p.start();
-		p.bump();
-		m.complete(p, EXPR_INTRINSIC_THIS_FILE)
-	} else if p.at(INTRINSIC_ID) {
-		let m = p.start();
-		p.bump();
-		m.complete(p, EXPR_INTRINSIC_ID)
-	} else if p.at(INTRINSIC) {
-		let m = p.start();
-		p.bump();
-		p.expect(T!['(']);
-		name(p);
-		p.expect(T![')']);
-		m.complete(p, EXPR_INTRINSIC)
 	} else if p.at(T![if]) {
 		let m = p.start();
 		p.bump();
addedcrates/jrsonnet-rowan-parser/src/snapshots/jrsonnet_rowan_parser__tests__continue_after_total_failure.snapdiffbeforeafterboth
--- /dev/null
+++ b/crates/jrsonnet-rowan-parser/src/snapshots/jrsonnet_rowan_parser__tests__continue_after_total_failure.snap
@@ -0,0 +1,74 @@
+---
+source: crates/jrsonnet-rowan-parser/src/tests.rs
+expression: "local intr = $intrinsic(test);\n\nlocal a = 1, b = 2, c = a + b;\n\n[c]\n"
+---
+SOURCE_FILE@0..68
+  EXPR_LOCAL@0..29
+    LOCAL_KW@0..5 "local"
+    WHITESPACE@5..6 " "
+    BIND_DESTRUCT@6..14
+      DESTRUCT_FULL@6..10
+        NAME@6..10
+          IDENT@6..10 "intr"
+      WHITESPACE@10..11 " "
+      ASSIGN@11..12 "="
+      WHITESPACE@12..13 " "
+      EXPR_LITERAL@13..14
+        DOLLAR@13..14 "$"
+    ERROR_UNEXPECTED_TOKEN@14..23
+      IDENT@14..23 "intrinsic"
+    EXPR_PARENED@23..29
+      L_PAREN@23..24 "("
+      EXPR_VAR@24..28
+        NAME@24..28
+          IDENT@24..28 "test"
+      R_PAREN@28..29 ")"
+  ERROR_CUSTOM@29..67
+    SEMI@29..30 ";"
+    WHITESPACE@30..32 "\n\n"
+    LOCAL_KW@32..37 "local"
+    WHITESPACE@37..38 " "
+    IDENT@38..39 "a"
+    WHITESPACE@39..40 " "
+    ASSIGN@40..41 "="
+    WHITESPACE@41..42 " "
+    FLOAT@42..43 "1"
+    COMMA@43..44 ","
+    WHITESPACE@44..45 " "
+    IDENT@45..46 "b"
+    WHITESPACE@46..47 " "
+    ASSIGN@47..48 "="
+    WHITESPACE@48..49 " "
+    FLOAT@49..50 "2"
+    COMMA@50..51 ","
+    WHITESPACE@51..52 " "
+    IDENT@52..53 "c"
+    WHITESPACE@53..54 " "
+    ASSIGN@54..55 "="
+    WHITESPACE@55..56 " "
+    IDENT@56..57 "a"
+    WHITESPACE@57..58 " "
+    PLUS@58..59 "+"
+    WHITESPACE@59..60 " "
+    IDENT@60..61 "b"
+    SEMI@61..62 ";"
+    WHITESPACE@62..64 "\n\n"
+    L_BRACK@64..65 "["
+    IDENT@65..66 "c"
+    R_BRACK@66..67 "]"
+  WHITESPACE@67..68 "\n"
+===
+LocatedSyntaxError { error: Unexpected { expected: Unnamed(SyntaxKindSet([L_BRACK, L_PAREN, L_BRACE, SEMI, DOT, COMMA])), found: IDENT }, range: 14..23 }
+LocatedSyntaxError { error: Custom { error: "unexpected tokens after end" }, range: 29..67 }
+===
+  x syntax error
+   ,-[1:1]
+ 1 | ,-> local intr = $intrinsic(test);
+   : ||              ^^^^|^^^^
+   : ||                  `-- expected L_BRACK, L_PAREN, L_BRACE, SEMI, DOT or COMMA, found IDENT
+ 2 | |
+ 3 | |   local a = 1, b = 2, c = a + b;
+ 4 | |
+ 5 | |-> [c]
+   : `---- unexpected tokens after end
+   `----
modifiedcrates/jrsonnet-rowan-parser/src/snapshots/jrsonnet_rowan_parser__tests__no_lhs.snapdiffbeforeafterboth
--- a/crates/jrsonnet-rowan-parser/src/snapshots/jrsonnet_rowan_parser__tests__no_lhs.snap
+++ b/crates/jrsonnet-rowan-parser/src/snapshots/jrsonnet_rowan_parser__tests__no_lhs.snap
@@ -2,19 +2,21 @@
 source: crates/jrsonnet-rowan-parser/src/tests.rs
 expression: "+ 2\n"
 ---
-SOURCE_FILE@0..2
+SOURCE_FILE@0..4
   ERROR_MISSING_TOKEN@0..0
-  ERROR_UNEXPECTED_TOKEN@0..1
+  ERROR_CUSTOM@0..3
     PLUS@0..1 "+"
-  WHITESPACE@1..2 " "
+    WHITESPACE@1..2 " "
+    FLOAT@2..3 "2"
+  WHITESPACE@3..4 "\n"
 ===
 LocatedSyntaxError { error: Missing { expected: Named("expression") }, range: 0..0 }
-LocatedSyntaxError { error: Unexpected { expected: Unnamed(SyntaxKindSet([EOF])), found: PLUS }, range: 0..1 }
+LocatedSyntaxError { error: Custom { error: "unexpected tokens after end" }, range: 0..3 }
 ===
   x syntax error
    ,----
  1 | + 2
-   : ^|
-   : |`-- expected EOF, found PLUS
+   : ^^|
+   : | `-- unexpected tokens after end
    : `-- missing expression
    `----
modifiedcrates/jrsonnet-rowan-parser/src/snapshots/jrsonnet_rowan_parser__tests__no_operator.snapdiffbeforeafterboth
--- a/crates/jrsonnet-rowan-parser/src/snapshots/jrsonnet_rowan_parser__tests__no_operator.snap
+++ b/crates/jrsonnet-rowan-parser/src/snapshots/jrsonnet_rowan_parser__tests__no_operator.snap
@@ -6,15 +6,15 @@
   EXPR_NUMBER@0..1
     FLOAT@0..1 "2"
   WHITESPACE@1..2 " "
-  ERROR_UNEXPECTED_TOKEN@2..3
+  ERROR_CUSTOM@2..3
     FLOAT@2..3 "2"
   WHITESPACE@3..4 "\n"
 ===
-LocatedSyntaxError { error: Unexpected { expected: Unnamed(SyntaxKindSet([EOF, L_BRACK, L_PAREN, L_BRACE, DOT])), found: FLOAT }, range: 2..3 }
+LocatedSyntaxError { error: Custom { error: "unexpected tokens after end" }, range: 2..3 }
 ===
   x syntax error
    ,----
  1 | 2 2
    :   |
-   :   `-- expected EOF, L_BRACK, L_PAREN, L_BRACE or DOT, found FLOAT
+   :   `-- unexpected tokens after end
    `----
modifiedcrates/jrsonnet-rowan-parser/src/tests.rsdiffbeforeafterboth
--- a/crates/jrsonnet-rowan-parser/src/tests.rs
+++ b/crates/jrsonnet-rowan-parser/src/tests.rs
@@ -228,6 +228,14 @@
 			a: function(x) x,
 		}
 	"#
+
+	continue_after_total_failure => r#"
+		local intr = $intrinsic(test);
+
+		local a = 1, b = 2, c = a + b;
+
+		[c]
+	"#
 );
 
 #[test]
modifiedcrates/jrsonnet-rowan-parser/src/token_set.rsdiffbeforeafterboth
--- a/crates/jrsonnet-rowan-parser/src/token_set.rs
+++ b/crates/jrsonnet-rowan-parser/src/token_set.rs
@@ -27,7 +27,10 @@
 		SyntaxKindSet(self.0 | mask(kind))
 	}
 
-	pub const fn contains(&self, kind: SyntaxKind) -> bool {
+	pub fn contains(&self, kind: SyntaxKind) -> bool {
+		if !is_token(kind) {
+			return false;
+		}
 		self.0 & mask(kind) != 0
 	}
 }
@@ -74,6 +77,9 @@
 }
 
 const fn mask(kind: SyntaxKind) -> u128 {
+	if kind as u32 > 128 {
+		panic!("mask for not a token kind")
+	}
 	1u128 << (kind as u128)
 }
 
@@ -95,3 +101,6 @@
 		"can't keep KindSet as bitset"
 	);
 }
+fn is_token(kind: SyntaxKind) -> bool {
+	(kind as u32) < 127
+}
modifiedxtask/src/sourcegen/kinds.rsdiffbeforeafterboth
--- a/xtask/src/sourcegen/kinds.rs
+++ b/xtask/src/sourcegen/kinds.rs
@@ -247,9 +247,6 @@
 		"$" => "DOLLAR";
 		"=" => "ASSIGN";
 		"?" => "QUESTION_MARK";
-		"$intrinsicThisFile" => "INTRINSIC_THIS_FILE";
-		"$intrinsicId" => "INTRINSIC_ID";
-		"$intrinsic" => "INTRINSIC";
 		// Literals
 		lit("FLOAT") => r"(?:0|[1-9][0-9]*)(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?";
 		error("FLOAT_JUNK_AFTER_POINT") => r"(?:0|[1-9][0-9]*)\.[^0-9]";