mirror of
https://github.com/RustPython/Parser.git
synced 2025-08-31 07:38:04 +00:00
Add Ast
as top level enum (#58)
This commit is contained in:
parent
6c5c311bab
commit
3654cf0bdf
2 changed files with 61 additions and 9 deletions
|
@ -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>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue