Commit Graph

5 Commits

Author SHA1 Message Date
Olly Betts 3f4ed82945 Improve parsing of expressions related to functions calls
For example, the following no longer give parse errors:  `g().d()`,
`g().D`, `(f(1) < g(2))`, `sizeof f(a,b)`

Partly addresses #3197
2025-06-17 14:59:54 +12:00
Olly Betts 6dbf867d23 Fix handling of corner cases by previous change
Don't collapse runs of whitespace to a single space, instead replace
each whitespace with one space.

Leave the expression as-is if it contains one or more double quotes
as we don't want to change the value of string literals, and any
expression containing double quotes won't currently work in the context
where we need to replace newlines anyway.

Fixes #3127 better
2025-03-03 11:22:37 +13:00
Olly Betts 7a8c9fdfa8 Straighten out handling of char and string constants
Fixes #904
Fixes #1907
Fixes #2579
Fixes #2990
2024-08-17 16:12:45 +12:00
Olly Betts 57ed628035 Improve parsing of sizeof(X)
Support parsing `sizeof(X)` for any expression or type X by skipping
balanced parentheses.  We don't need to actually parse X since the type
of sizeof is always size_t.

Fixes #2919
2024-06-06 10:36:12 +12:00
Olly Betts ed30a80d7f [php] Add runme for testcase constant_expr 2024-02-26 12:45:45 +13:00