From 37115e817d98158ac71f2b31dc20cf02a786f24f Mon Sep 17 00:00:00 2001 From: Dmitry Selyutin Date: Tue, 16 Jan 2024 22:09:45 +0300 Subject: [PATCH] oppc: rename NotEq to Ne --- src/openpower/oppc/pc_ast.py | 2 +- src/openpower/oppc/pc_code.py | 6 +++--- src/openpower/oppc/pc_lexer.py | 4 ++-- src/openpower/oppc/pc_parser.py | 2 +- src/openpower/oppc/pc_pseudocode.py | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/openpower/oppc/pc_ast.py b/src/openpower/oppc/pc_ast.py index 3505fa88..520ea089 100644 --- a/src/openpower/oppc/pc_ast.py +++ b/src/openpower/oppc/pc_ast.py @@ -346,7 +346,7 @@ class Eq(Token): pass -class NotEq(Token): +class Ne(Token): r"""(?:≠|!=)""" pass diff --git a/src/openpower/oppc/pc_code.py b/src/openpower/oppc/pc_code.py index 49b045e6..a178a65c 100644 --- a/src/openpower/oppc/pc_code.py +++ b/src/openpower/oppc/pc_code.py @@ -261,7 +261,7 @@ class CodeVisitor(pc_util.Visitor): comparison = ( pc_ast.Lt, pc_ast.Le, - pc_ast.Eq, pc_ast.NotEq, + pc_ast.Eq, pc_ast.Ne, pc_ast.Ge, pc_ast.Gt, pc_ast.LtU, pc_ast.GtU, ) @@ -296,7 +296,7 @@ class CodeVisitor(pc_util.Visitor): pc_ast.Not, pc_ast.Add, pc_ast.Sub, pc_ast.Mul, pc_ast.Div, pc_ast.Mod, pc_ast.Lt, pc_ast.Le, - pc_ast.Eq, pc_ast.NotEq, + pc_ast.Eq, pc_ast.Ne, pc_ast.Ge, pc_ast.Gt, pc_ast.LtU, pc_ast.GtU, pc_ast.LShift, pc_ast.RShift, @@ -315,9 +315,9 @@ class CodeVisitor(pc_util.Visitor): pc_ast.Lt: "oppc_lt", pc_ast.Le: "oppc_le", pc_ast.Eq: "oppc_eq", + pc_ast.Ne: "oppc_ne", pc_ast.LtU: "oppc_ltu", pc_ast.GtU: "oppc_gtu", - pc_ast.NotEq: "oppc_noteq", pc_ast.Ge: "oppc_ge", pc_ast.Gt: "oppc_gt", pc_ast.LShift: "oppc_lshift", diff --git a/src/openpower/oppc/pc_lexer.py b/src/openpower/oppc/pc_lexer.py index bfa2c3b0..b7290ef1 100644 --- a/src/openpower/oppc/pc_lexer.py +++ b/src/openpower/oppc/pc_lexer.py @@ -408,7 +408,7 @@ class Lexer: t_ASSIGN = pc_ast.AssignOp.__doc__ t_LTU = pc_ast.LtU.__doc__ t_GTU = pc_ast.GtU.__doc__ - t_NE = pc_ast.NotEq.__doc__ + t_NE = pc_ast.Ne.__doc__ t_LE = pc_ast.Le.__doc__ t_GE = pc_ast.Ge.__doc__ t_LSHIFT = pc_ast.LShift.__doc__ @@ -537,7 +537,7 @@ class IndentLexer(Lexer): "ASSIGN": pc_ast.AssignOp, "LTU": pc_ast.LtU, "GTU": pc_ast.GtU, - "NE": pc_ast.NotEq, + "NE": pc_ast.Ne, "LE": pc_ast.Le, "GE": pc_ast.Ge, "LSHIFT": pc_ast.LShift, diff --git a/src/openpower/oppc/pc_parser.py b/src/openpower/oppc/pc_parser.py index a7a0ffbe..0de6673f 100644 --- a/src/openpower/oppc/pc_parser.py +++ b/src/openpower/oppc/pc_parser.py @@ -53,7 +53,7 @@ binary_ops = { "<": pc_ast.Lt, ">": pc_ast.Gt, "=": pc_ast.Eq, - "!=": pc_ast.NotEq, + "!=": pc_ast.Ne, } unary_ops = { "+": pc_ast.Plus, diff --git a/src/openpower/oppc/pc_pseudocode.py b/src/openpower/oppc/pc_pseudocode.py index 6804eb26..c53c8315 100644 --- a/src/openpower/oppc/pc_pseudocode.py +++ b/src/openpower/oppc/pc_pseudocode.py @@ -223,7 +223,7 @@ class PseudocodeVisitor(pc_util.Visitor): pc_ast.Mul, pc_ast.MulS, pc_ast.MulU, pc_ast.Div, pc_ast.DivT, pc_ast.Mod, pc_ast.Sqrt, - pc_ast.Eq, pc_ast.NotEq, + pc_ast.Eq, pc_ast.Ne, pc_ast.Lt, pc_ast.Le, pc_ast.LtU, pc_ast.Gt, pc_ast.Ge, pc_ast.GtU, pc_ast.LShift, pc_ast.RShift, @@ -244,7 +244,7 @@ class PseudocodeVisitor(pc_util.Visitor): pc_ast.Mod: "%", pc_ast.Sqrt: "√", pc_ast.Eq: "=", - pc_ast.NotEq: "!=", + pc_ast.Ne: "!=", pc_ast.Lt: "<", pc_ast.Le: "<=", pc_ast.LtU: "