Let '^' through the lexer
authorMichael Matz <matz@suse.de>
Wed, 12 Jul 2023 13:10:10 +0000 (15:10 +0200)
committerMichael Matz <matz@suse.de>
Thu, 13 Jul 2023 15:21:06 +0000 (17:21 +0200)
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.

ld/ld.texi
ld/ldlex.l

index aa8b1aa86eb386358bc18662f1f0b2fce4996763..5009f0e5a6c0d99e239d24fae53fa4009a8a1d0d 100644 (file)
@@ -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}
index 1a6be1b6af23e4cff6fbfd906bfc2c393f2fc6f5..9cb002452d8a94abf2f48d0485bc4376602c280c 100644 (file)
@@ -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('{'); }