aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Matz <matz@suse.de>2023-07-12 15:10:10 +0200
committerMichael Matz <matz@suse.de>2023-07-13 17:21:06 +0200
commitf6f78318fca803c4907fb8d7f6ded8295f1947b1 (patch)
tree9cf054e87f1dbdcc39778a7696501e076c422f40
parent22e90ac5af46c01ee4972cf04e835266862bbb35 (diff)
downloadgdb-f6f78318fca803c4907fb8d7f6ded8295f1947b1.zip
gdb-f6f78318fca803c4907fb8d7f6ded8295f1947b1.tar.gz
gdb-f6f78318fca803c4907fb8d7f6ded8295f1947b1.tar.bz2
Let '^' through the lexer
so that the (existing) code in parser and expression evaluator actually get to see it and handle it as XOR. Also adjust docu to match what's there.
-rw-r--r--ld/ld.texi36
-rw-r--r--ld/ldlex.l1
2 files changed, 21 insertions, 16 deletions
diff --git a/ld/ld.texi b/ld/ld.texi
index aa8b1aa..5009f0e 100644
--- a/ld/ld.texi
+++ b/ld/ld.texi
@@ -6818,19 +6818,21 @@ the standard bindings and precedence levels:
@ifnottex
@c END TEXI2ROFF-KILL
@smallexample
-precedence associativity Operators Notes
+precedence associativity Operators Notes
(highest)
-1 left ! - ~ (1)
+1 left ! - ~ (1)
2 left * / %
3 left + -
4 left >> <<
-5 left == != > < <= >=
-6 left &
-7 left |
-8 left &&
-9 left ||
-10 right ? :
-11 right &= += -= *= /= (2)
+5 left > < <= >=
+6 left == !=
+7 left &
+8 left ^
+9 left |
+10 left &&
+11 left ||
+12 right ? :
+13 right += -= *= /= <<= >>= &= |= (2)
(lowest)
@end smallexample
Notes:
@@ -6856,13 +6858,15 @@ height2pt&\omit&&\omit&&\omit&\cr
&2&&left&&* / \%&\cr
&3&&left&&+ -&\cr
&4&&left&&>> <<&\cr
-&5&&left&&== != > < <= >=&\cr
-&6&&left&&\&&\cr
-&7&&left&&|&\cr
-&8&&left&&{\&\&}&\cr
-&9&&left&&||&\cr
-&10&&right&&? :&\cr
-&11&&right&&\qquad\&= += -= *= /=\qquad\ddag&\cr
+&5&&left&& > < <= >=&\cr
+&6&&left&&== !=&\cr
+&7&&left&&\&&\cr
+&8&&left&&^&\cr
+&9&&left&&|&\cr
+&10&&left&&{\&\&}&\cr
+&11&&left&&||&\cr
+&12&&right&&? :&\cr
+&13&&right&&\qquad += -= *= /= <<= >>= \&= |=\qquad\ddag&\cr
&lowest&&&&&\cr
height2pt&\omit&&\omit&&\omit&\cr}
\hrule}
diff --git a/ld/ldlex.l b/ld/ldlex.l
index 1a6be1b..9cb0024 100644
--- a/ld/ldlex.l
+++ b/ld/ldlex.l
@@ -247,6 +247,7 @@ V_IDENTIFIER [*?.$_a-zA-Z\[\]\-\!\^\\]([*?.$_a-zA-Z0-9\[\]\-\!\^\\]|::)*
<EXPRESSION,MRI>"/" { RTOKEN('/'); }
<EXPRESSION,MRI>"%" { RTOKEN('%'); }
<EXPRESSION,MRI>"<" { RTOKEN('<'); }
+<EXPRESSION,MRI>"^" { RTOKEN('^'); }
<SCRIPT,EXPRESSION,MRI,WILD>"=" { RTOKEN('='); }
<SCRIPT,EXPRESSION,MRI,WILD>"}" { RTOKEN('}'); }
<SCRIPT,EXPRESSION,MRI,WILD>"{" { RTOKEN('{'); }