From 987f8647e8d6206cebc613e5c162ff8b4d014d40 Mon Sep 17 00:00:00 2001 From: Shahab Vahedi Date: Sun, 27 Nov 2022 18:38:24 +0100 Subject: scripts: Add "|" operator support to glibcpp's parsing From the tests point of view, this is a necessary step for another patch [1] and allows parsing macros such as "#define A | B". Without it, a few tests [2] choke when the other patch [1] is applied: /src/glibc/scripts/../elf/elf.h:4167: error: uninterpretable macro token sequence: ( EF_ARC_MACH_MSK | EF_ARC_OSABI_MSK ) Traceback (most recent call last): File "/src/glibc/elf/tst-glibcelf.py", line 23, in import glibcelf File "/src/glibc/scripts/glibcelf.py", line 226, in _elf_h = _parse_elf_h() ^^^^^^^^^^^^^^ File "/src/glibc/scripts/glibcelf.py", line 223, in _parse_elf_h raise IOError('parse error in elf.h') OSError: parse error in elf.h [1] ARC: update definitions in elf/elf.h https://sourceware.org/pipermail/libc-alpha/2022-November/143503.html [2] tst-glibcelf, tst-relro-ldso, and tst-relro-libc Reviewed-by: Florian Weimer Signed-off-by: Shahab Vahedi --- scripts/glibcpp.py | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/glibcpp.py b/scripts/glibcpp.py index 455459a609..2f39979894 100644 --- a/scripts/glibcpp.py +++ b/scripts/glibcpp.py @@ -346,6 +346,7 @@ RE_SPLIT_INTEGER_SUFFIX = re.compile(r'([^ullULL]+)([ullULL]*)') BINARY_OPERATORS = { '+': operator.add, '<<': operator.lshift, + '|': operator.or_, } # Use the general-purpose dict type if it is order-preserving. -- cgit 1.4.1