Add binary operator '_' for left shift

If the command line option yus to allow the underscore character in
symbols is NOT selected, then interpret underscore as a new binary
operator meaning to do a left shift of the left side value by the
number of bit positions indicated by the right side value.  As for the
arithmetic operators, both values must be literal (numeric constants
or symbols equated to a numeric constant).
This commit is contained in:
Stephen Casner
2021-02-13 15:25:08 -08:00
committed by Rhialto The M
parent e452ac437c
commit dcdbc02b2e
6 changed files with 148 additions and 90 deletions

View File

@@ -31,7 +31,10 @@ typedef struct ex_tree {
/* Divide */
EX_AND = 12,
/* bitwise and */
EX_OR = 13 /* bitwise or */
EX_OR = 13,
/* bitwise or */
EX_LSH = 14
/* left shift */
} type;
char *cp; /* points to end of parsed expression */