diff --git a/scripts/dts/python-devicetree/src/devicetree/dtlib.py b/scripts/dts/python-devicetree/src/devicetree/dtlib.py index f5dd165aa8..dc337a671f 100644 --- a/scripts/dts/python-devicetree/src/devicetree/dtlib.py +++ b/scripts/dts/python-devicetree/src/devicetree/dtlib.py @@ -1962,9 +1962,9 @@ def _init_tokens(): # _Token.val is based on the captured string. token_spec = { _T.INCLUDE: r'(/include/\s*"(?:[^\\"]|\\.)*")', - # #line directive + # #line directive or GCC linemarker _T.LINE: - r'^#(?:line)?[ \t]+([0-9]+[ \t]+"(?:[^\\"]|\\.)*")(?:[ \t]+[0-9]+)?', + r'^#(?:line)?[ \t]+([0-9]+[ \t]+"(?:[^\\"]|\\.)*")(?:[ \t]+[0-9]+){0,4}', _T.STRING: r'"((?:[^\\"]|\\.)*)"', _T.DTS_V1: r"(/dts-v1/)",