Description
The Problem
The current expression parser has a notable limitation: it's not possible to directly access properties or methods on literal values. An expression like [1, 2, 3].length
, which developers would intuitively expect to work, currently fails during parsing.
Why This Should Be Improved
In most modern programming languages (like Dart, JavaScript, etc.), it's standard practice to allow chaining methods or accessing properties directly on literals. The current behavior forces a less readable and cumbersome workaround: wrapping the literal in parentheses.
For example, a user has to write ([1, 2, 3]).length
instead of [1, 2, 3].length
.
This inconsistency can be a point of friction for developers using the library, as it goes against familiar coding patterns. Making the parser handle this syntax would make the expression language feel more natural and robust.
Desired Behavior
The parser should be enhanced to allow member access on all literal types (lists, strings, maps, etc.) without requiring them to be enclosed in parentheses.
This is resolved in #36.