[Tutor] why inline-only string literals?

spir denis.spir at free.fr
Sun Feb 7 13:24:30 CET 2010


Hello,

I recently wrote a parser for a (game scripting) language in which ordinary strings inside quotes can hold (literal) newlines:

s = "Hello,
how do you do?"

So, I wonder why most languages do not allow that from scratch; and some, like python, need a special syntax for multi-line strings. This is no parsing issue: instead, the pattern is simpler for it does need to refuse newlines!
Note: Like python, this languages takes end-of-line (outside quotes) as end-of-statement token.

Denis
________________________________

la vita e estrany

http://spir.wikidot.com/


More information about the Tutor mailing list