Skip to content

Add support for inline expressions in methods

Michael Aaron Murphy requested to merge huntergoldstein:inline_methods into master

Created by: huntergoldstein

Changes introduced by this pull request:

  • If the "variable" for a string or method looks like an expression (starts with @, $, etc.), it is expanded as if it were an expression, otherwise it is treated as a variable

Drawbacks: I feel like this PR has exacerbated some issues with how methods are parsed, for example:

$ let foo = bar
$ echo @len( @bytes(foo))
0
$ echo $len( foo)
<no output>

I'd like to make a sweep over how methods are parsed and do things like consolidating the logic for all the string methods, making it easier to pass in arbitrary values to methods, making StringMethods work exactly like ArrayMethods or vice-versa, etc. Also fixing the above.

Fixes: Closes #389 (closed)

State: Good to go aside from Drawbacks

Merge request reports