sourcepawn icon indicating copy to clipboard operation
sourcepawn copied to clipboard

[Feature Request] Python style triple quote multi line string literals

Open sapphonie opened this issue 3 years ago • 4 comments

Please. This is agonizing:

https://github.com/sapphonie/StAC-tf2/blob/master/scripting/stac/stac_stocks.sp#L762

<3

sapphonie avatar Apr 09 '22 00:04 sapphonie

This does seem like it would be a useful addition to have - I'd probably lean more on the side of a heredoc-style syntax with flexible indentation stripping similar to what PHP has in 7.3, as I think the Python style is a little annoying with the string content being on the same line as the identifiers and needing to be flush with the left edge (but triple quotes as the marker seems nice).

asherkin avatar Apr 09 '22 00:04 asherkin

id also like to see the implementation of raw strings. i think at some point they were removed?

JoinedSenses avatar Apr 09 '22 01:04 JoinedSenses

Agreed, Python triple-quote strings are very idiosyncratic, but some kind of block literal syntax would be great. And not difficult to implement.

dvander avatar Apr 09 '22 03:04 dvander

not to necro this but can i suggest Golang's ` backtick quotes for doing raw strings?

fmt.Printf(`this
is
a raw string`)

kevyonan avatar Jul 10 '22 02:07 kevyonan