parent
5060f884b5
commit
c58df87c27
|
|
@ -256,6 +256,7 @@ Tom Manner
|
||||||
Tomasz Gorochowik
|
Tomasz Gorochowik
|
||||||
Topa Topino
|
Topa Topino
|
||||||
Toru Niina
|
Toru Niina
|
||||||
|
Tracy Narine
|
||||||
Trung Nguyen
|
Trung Nguyen
|
||||||
Tudor Timi
|
Tudor Timi
|
||||||
Tymoteusz Blazejczyk
|
Tymoteusz Blazejczyk
|
||||||
|
|
|
||||||
10
src/flexfix
10
src/flexfix
|
|
@ -14,6 +14,7 @@
|
||||||
|
|
||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
|
import platform
|
||||||
|
|
||||||
for line in sys.stdin:
|
for line in sys.stdin:
|
||||||
# Fix flex 2.6.1 warning
|
# Fix flex 2.6.1 warning
|
||||||
|
|
@ -47,5 +48,14 @@ for line in sys.stdin:
|
||||||
line = re.sub(r'(#line \d+ ".*)_pretmp', r'\1', line)
|
line = re.sub(r'(#line \d+ ".*)_pretmp', r'\1', line)
|
||||||
# Fix 'register' storage class specifier is deprecated and incompatible with C++17
|
# Fix 'register' storage class specifier is deprecated and incompatible with C++17
|
||||||
line = re.sub(r'register ', '', line)
|
line = re.sub(r'register ', '', line)
|
||||||
|
# Change int to size_t on LexerInput/LexerOutput when using macOS Tahoe
|
||||||
|
if platform.system() == "Darwin":
|
||||||
|
try:
|
||||||
|
osv = platform.mac_ver()[0] # Example "26.2"
|
||||||
|
if len(osv) > 2 and osv[2] == "." and int(osv[:2]) >= 26:
|
||||||
|
if "::LexerInput(" in line or "::LexerOutput(" in line:
|
||||||
|
line = re.sub(r'int ', r'size_t ', line)
|
||||||
|
except IndexError as e:
|
||||||
|
print(f"Unexpected index error {e}")
|
||||||
|
|
||||||
print(line, end='')
|
print(line, end='')
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue