This isn't a sensible fhirpath expression that does something useful, however it does check the edges of a fhirpath parser. I've tried to check every single parsing rule, not every function avaialable.
(
(
(( -5.25 * 2 div 3 mod 2 + +3 - 1).toString() & ' units' ) /* polarity + multiplicative + additive + concatenation */
|
( {} | true | %resource | false | 'hello' | 42 | 123L | @2025-08-21
| @2025-08-21T12:34:56.789Z | @T08:00:00 | 5 'mg' | 3 days ) /* union of (null, booleans, string, number, long, date, datetime, time, qty(STRING), qty(keyword-unit) */
| %ext