Mercurial > python-compiler.rs
changeset 15:a0fb169fe0f9
Add forgotten cmpop values.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Thu, 02 Jun 2016 05:45:22 +0100 |
parents | 719a27f1c1c7 |
children | b21a246349f3 |
files | src/ast_convert.rs |
diffstat | 1 files changed, 18 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ast_convert.rs +++ b/src/ast_convert.rs @@ -83,7 +83,13 @@ fn parse_cmpop(py: Python, ast: PyObject let eq_type = ast_module.get(py, "Eq").unwrap(); let noteq_type = ast_module.get(py, "NotEq").unwrap(); let lt_type = ast_module.get(py, "Lt").unwrap(); + let lte_type = ast_module.get(py, "LtE").unwrap(); let gt_type = ast_module.get(py, "Gt").unwrap(); + let gte_type = ast_module.get(py, "GtE").unwrap(); + let is_type = ast_module.get(py, "Is").unwrap(); + let is_not_type = ast_module.get(py, "IsNot").unwrap(); + let in_type = ast_module.get(py, "In").unwrap(); + let not_in_type = ast_module.get(py, "NotIn").unwrap(); assert!(is_instance(&ast, &ast_type)); @@ -93,8 +99,20 @@ fn parse_cmpop(py: Python, ast: PyObject cmpop::NotEq } else if is_instance(&ast, <_type) { cmpop::Lt + } else if is_instance(&ast, <e_type) { + cmpop::LtE } else if is_instance(&ast, >_type) { cmpop::Gt + } else if is_instance(&ast, >e_type) { + cmpop::GtE + } else if is_instance(&ast, &is_type) { + cmpop::Is + } else if is_instance(&ast, &is_not_type) { + cmpop::IsNot + } else if is_instance(&ast, &in_type) { + cmpop::In + } else if is_instance(&ast, ¬_in_type) { + cmpop::NotIn } else { unreachable!() }