Implement multiline string support
This should be possible:
foo = Text foo.value = " The text starts at this line ... and ends a few lines later. "
[~TASK] TypoScript (Parser): Removed usage of Object Factory and the old Object Manager API
[~TASK] TypoScript (Parser): Wrote fixture and test case for multiline string support - however, the actual support for it is still missing. Relates to #7552
#3 Updated by Tobias Liebig over 9 years ago
i've created a patch to implement multiline strings in typoscript.
If the parser detects the beginning of a multiline string value, it will step forward till it finds the matching closing quote char (" or ').
Due to that i needed to change how the parser iterates through the lines of TypoScript.
If i'm right
$this->currentSourceCodeLines was meant for that, but not used till now.
#4 Updated by Sebastian Kurfuerst over 9 years ago
I just had a quick look through your patch, and these are my comments:
- It'd be great if you could format the Regexps like that it is done in Fluid, as it makes it a lot more readable: https://svn.typo3.org/FLOW3/Packages/Fluid/trunk/Classes/Core/Parser/TemplateParser.php
- I'd suggest to use named parameters in the Regex (see above link), as then it gets a lot more readable than the index shuffling - so lines like
isset($matches) ? $matches : $matches;is a lot nicer to read then :)
That's it from my side :) Didn't test the patch, but they are just some cosmetical remarks I had.
Greets, and thanks for your nice work!
#6 Updated by Robert Lemke over 9 years ago
I had problems applying the patch but generally it looks good.
Generally we use inline comments very sparingly, so I think that "increase the pointer" is unnecessary in this case. If you feel like adding an inline comment that usually is a sign to extract the behavior into its own method and use a meaningful method name for a better explanation. Anyway, I think in this case the code is obvious enough.
Please commit your patch (after naming the regex parameters - see Sebastians comment) and then I'll try it out again.