Add Ast as top level enum (#58)

This commit is contained in:
Jeong, YunWon 2023-05-19 01:53:39 +09:00 committed by GitHub
parent 6c5c311bab
commit 3654cf0bdf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 61 additions and 9 deletions

View file

@ -1,6 +1,34 @@
// File automatically generated by ast/asdl_rs.py.
use crate::text_size::TextRange;
#[derive(Clone, Debug, PartialEq)]
#[derive(is_macro::Is)]
pub enum Ast<R = TextRange> {
#[is(name = "module")]
Mod(Mod<R>),
Stmt(Stmt<R>),
Expr(Expr<R>),
ExprContext(ExprContext),
Boolop(Boolop),
Operator(Operator),
Unaryop(Unaryop),
Cmpop(Cmpop),
Comprehension(Comprehension<R>),
Excepthandler(Excepthandler<R>),
Arguments(Arguments<R>),
Arg(Arg<R>),
Keyword(Keyword<R>),
Alias(Alias<R>),
Withitem(Withitem<R>),
MatchCase(MatchCase<R>),
Pattern(Pattern<R>),
TypeIgnore(TypeIgnore<R>),
}
impl<R> Node for Ast<R> {
const NAME: &'static str = "AST";
const FIELD_NAMES: &'static [&'static str] = &[];
}
#[derive(Clone, Debug, PartialEq)]
pub struct ModModule<R = TextRange> {
pub range: OptionalRange<R>,