adding in noteq

This commit is contained in:
Paul R. Tagliamonte 2013-03-09 17:15:56 -05:00
parent ccfcefe207
commit 0424446d56
2 changed files with 7 additions and 1 deletions

View File

@ -152,6 +152,7 @@ class HyASTCompiler(object):
ctx=ast.Load()) ctx=ast.Load())
@builds("=") @builds("=")
@builds("!=")
@builds("<") @builds("<")
@builds("<=") @builds("<=")
@builds(">") @builds(">")
@ -161,8 +162,8 @@ class HyASTCompiler(object):
@builds("is-not") @builds("is-not")
@builds("not-in") @builds("not-in")
def compile_compare_op_expression(self, expression): def compile_compare_op_expression(self, expression):
# NotEq | Lt | LtE | Gt | GtE | Is | IsNot | In | NotIn
ops = {"=": ast.Eq, ops = {"=": ast.Eq,
"!=": ast.NotEq,
"<": ast.Lt, "<": ast.Lt,
"<=": ast.LtE, "<=": ast.LtE,
">": ast.Gt, ">": ast.Gt,

View File

@ -20,6 +20,11 @@
(assert (not-in "f" ["a" "b" "c" "d"]))) (assert (not-in "f" ["a" "b" "c" "d"])))
(defn test_noteq []
"NATIVE: not eq"
(assert (!= 2 3)))
(defn test_numops [] (defn test_numops []
"NATIVE: test numpos" "NATIVE: test numpos"
(assert (> 5 4 3 2 1)) (assert (> 5 4 3 2 1))