Putting quotes in wysiwyg strings

renox renaud.hebert at free.fr
Thu Nov 23 12:31:44 PST 2006


== Quote from Hasan Aljudy (hasan.aljudy at gmail.com)'s article
> renox wrote:
> > Bah, I feel that putting any fixed delimitor for string is bond to create a
> > problem for some user whether it is simple, double quotes..
> >
> > Why not reuse a good idea from the shell: <<FOO .... FOO
> > putting a customisable end-of-text word can avoid many problem.
> >
> > Sure this makes the parser a bit more complex, but not that much..
> > So for D it would be something like:
> > r <word>" ... "<word> where word is some text without space
> > or r(<word>)" .... "<word>  or the same thing but with a keyword "raw" instead
of r.
> >
> > Comments?

> Walter likes to keep the lexer independent of the parser.
> I don't understand your suggestion very well, but it seems to me that it
> will make the lexer dependent on the parser, and maybe even on the
> semantic analyzer. Well, depending on how do you define these "words".

Do you know 'here strings' in shell/Perl?

My suggestion is that D could provide the same thing (with a syntax more D-like of
course) instead of trying to find the "mythical delimiter" for wysiwyg strings
which would please everyone as it doesn't exist..

I'm not sure if 'here strings' makes the lexer dependant on the parser or not, I
must admit that I'm not very good at grokking compilers.

renoX





More information about the Digitalmars-d mailing list