Question about kind of “short array synthax” for Fusion. We use a lots of RawArray to transport values in our Fusion prototype, but the current synthax with the RawArray is a bit to verbose, what about:
prototype(Your.Package:Foo) {
label = {
english = 'foo'
french = 'bar'
german = 'bla'
}
}
I know we can use EEL for this, but I think it should be a responsability of Fusion, to have support for things like bellow and better readability for multi level arrays:
I’m pretty sure this was discussed in the past, but can’t find any issue, PR, Slack message or Discourse post. Hm.
Whatever, the syntax using curly braces you propose leaves no distinction between “an array” and “some Fusion object”. I might be wrong, but I think that was one of the blockers for adding such syntax in the discussion I remember…
What would be the internal parsing result of your suggestion? A RawArray fusion-object that is implied by shorthand syntax? I would like that.
I fear that adjusting the FusionParser will not be easy. And with not easy i mean you will likely end up creating a new parser based on PEG like EEL and Fizzle. The existing fusion parser is a glorious bunch of regex expressions and is kind of due for a rewrite. The good thing is that the resulting fusion-ast is quite well defined so it is absolutely possible but far from easy.
With really good test coverage i would like this. I consider it important that we do nothing that makes refactoring the fusion parser harder at this time.
i just stubled by by accidently through the search - its a bit late - but you could alias a prototype with prototype(array) < prototype(Neos.Fusion:DataStructure)