I'm still struggling with the ambiguous Qt qmake grammar.
Now I can’t find a way to describe function arguments that may contain brackets (for example, regex):
functionName(arg1, "arg2", ^(arg3)+$)
I tried to describe the function call as follows:
FunctionCall = Identifier space* "(" space* FunctionArgumentList? space* ")" space* eol*
FunctionArgumentList = FunctionArgumentString ((space* "," space* FunctionArgumentString)* / (blank* FunctionArgumentString)*)
FunctionArgumentString = ReplaceFunctionCall / TestFunctionCall / EnquotedString / RegularFunctionArgumentString
RegularFunctionArgumentString = RegularFunctionArgumentStringChar+
RegularFunctionArgumentStringChar = !(")" / blank / "," / quote / doublequote) SourceCharacter
SourceCharacter <- [\u0000-\uFFFC]
How to add support for inline parentheses without quotes / double quotes in such a grammar? How to distinguish round arguments inside a function and a close function of one?
Example of a valid function call:
contains(CMAKE_INSTALL_LIBS_DIR, ^(/usr)?/lib(64)?.*)
source
share