Mercurial > python-compiler.rs
diff src/python_ast.rs @ 86:a7b1db623f41
Implement NameConstant correctly.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Wed, 22 Jun 2016 22:55:55 +0100 |
parents | e59cd5754268 |
children | 859d44f143b8 |
line wrap: on
line diff
--- a/src/python_ast.rs +++ b/src/python_ast.rs @@ -103,7 +103,7 @@ pub enum expr { Num(String), Str(String), //Bytes(String), - NameConstant(String), + NameConstant(name_constant), Ellipsis, // the following expression can appear in assignment context @@ -126,6 +126,13 @@ pub enum expr_context { } #[derive(Clone, Debug, PartialEq, Eq, Hash)] +pub enum name_constant { + True, + False, + None_ +} + +#[derive(Clone, Debug, PartialEq, Eq, Hash)] pub enum slice { Slice(Option<expr>, Option<expr>, Option<expr>), ExtSlice(Vec<slice>),