summaryrefslogtreecommitdiff
path: root/src/mp-equation-lexer.l
diff options
context:
space:
mode:
authorStefan Tauner <[email protected]>2012-04-13 01:45:02 +0200
committerStefano Karapetsas <[email protected]>2012-04-22 19:27:00 +0200
commit7155e47537e3707d42a675d2603386963c6d9156 (patch)
treea1b6e49f43b9408f1dbcb83e41b9606c83d19fd0 /src/mp-equation-lexer.l
parent5f32b5b06eed534bf0201266169dcb7e8d833349 (diff)
downloadmate-calc-7155e47537e3707d42a675d2603386963c6d9156.tar.bz2
mate-calc-7155e47537e3707d42a675d2603386963c6d9156.tar.xz
Support shifts with keyboard
This patch also changes the shift operation itself to use MPNumber for the multiplier too. Previously a signed int was used, which led to "interesting" results for bigger numbers. This was hidden because the GUI did not allow shifts with more than 15 places. Signed-off-by: Stefan Tauner <[email protected]>
Diffstat (limited to 'src/mp-equation-lexer.l')
-rw-r--r--src/mp-equation-lexer.l4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mp-equation-lexer.l b/src/mp-equation-lexer.l
index bbc9765..74eb7d5 100644
--- a/src/mp-equation-lexer.l
+++ b/src/mp-equation-lexer.l
@@ -75,6 +75,8 @@ MOD [mM][oO][dD]
AND "∧"|[aA][nN][dD]
OR "∨"|[oO][rR]
XOR "⊻"|"⊕"|[xX][oO][rR]
+LSHIFT "<<"
+RSHIFT ">>"
NOT "¬"|"~"|[nN][oO][tT]
RE "⃰ℜ"
IM "ℑ"
@@ -94,6 +96,8 @@ IN [iI][nN]
"√" {return tROOT;}
"∛" {return tROOT3;}
"∜" {return tROOT4;}
+{LSHIFT} {return tLSHIFT;}
+{RSHIFT} {return tRSHIFT;}
{NOT} {return tNOT;}
{AND} {return tAND;}
{OR} {return tOR;}