Mercurial > python-compiler.rs
comparison 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 |
comparison
equal
deleted
inserted
replaced
85:09f5e0d7bcf3 | 86:a7b1db623f41 |
---|---|
101 | 101 |
102 Call(Box<expr>, Vec<expr>, Vec<keyword>), | 102 Call(Box<expr>, Vec<expr>, Vec<keyword>), |
103 Num(String), | 103 Num(String), |
104 Str(String), | 104 Str(String), |
105 //Bytes(String), | 105 //Bytes(String), |
106 NameConstant(String), | 106 NameConstant(name_constant), |
107 Ellipsis, | 107 Ellipsis, |
108 | 108 |
109 // the following expression can appear in assignment context | 109 // the following expression can appear in assignment context |
110 Attribute(Box<expr>, String, expr_context), | 110 Attribute(Box<expr>, String, expr_context), |
111 Subscript(Box<expr>, Box<slice>, expr_context), | 111 Subscript(Box<expr>, Box<slice>, expr_context), |
121 Store, | 121 Store, |
122 Del, | 122 Del, |
123 AugLoad, | 123 AugLoad, |
124 AugStore, | 124 AugStore, |
125 Param | 125 Param |
126 } | |
127 | |
128 #[derive(Clone, Debug, PartialEq, Eq, Hash)] | |
129 pub enum name_constant { | |
130 True, | |
131 False, | |
132 None_ | |
126 } | 133 } |
127 | 134 |
128 #[derive(Clone, Debug, PartialEq, Eq, Hash)] | 135 #[derive(Clone, Debug, PartialEq, Eq, Hash)] |
129 pub enum slice { | 136 pub enum slice { |
130 Slice(Option<expr>, Option<expr>, Option<expr>), | 137 Slice(Option<expr>, Option<expr>, Option<expr>), |