I mean when writing a D lexer, you necessarly reach the moment
when you think:
Oh no! is this feature just here to suck ?
of the things I *like* about D, in fact. Nobody
wants to manually parenthesize every quoted line with '...\n' when the
program need to incorporate several pages of built-in help text, for
example.
Delimited strings are useful when writing code/text generators when you
need to be able to use
On Mon, Aug 11, 2014 at 10:09 PM, H. S. Teoh via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
On Mon, Aug 11, 2014 at 07:47:44PM +, Klaus via Digitalmars-d-learn wrote:
I mean when writing a D lexer, you necessarly reach the moment when
you think:
Oh no! is this feature
On Mon, Aug 11, 2014 at 10:50:34PM +0200, Philippe Sigaud via
Digitalmars-d-learn wrote:
On Mon, Aug 11, 2014 at 10:09 PM, H. S. Teoh via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
On Mon, Aug 11, 2014 at 07:47:44PM +, Klaus via Digitalmars-d-learn
wrote:
I mean
heredocs every now and then when I need to embed long
strings in
my program. It's one of the things I *like* about D, in fact.
Nobody
wants to manually parenthesize every quoted line with '...\n'
when the
program need to incorporate several pages of built-in help
text, for
example.
Delimited
On Mon, Aug 11, 2014 at 10:58 PM, H. S. Teoh via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
In Flex, one way you can implement heredocs is to have a separate mode
where the lexer is scanning for the ending string. So basically you
have a sub-lexer that treats the heredoc as
On Monday, 11 August 2014 at 19:47:46 UTC, Klaus wrote:
I mean when writing a D lexer, you necessarly reach the moment
when you think:
Oh no! is this feature just here to suck ?
They are and they do.
On Monday, 11 August 2014 at 22:20:54 UTC, Brian Schott wrote:
On Monday, 11 August 2014 at 19:47:46 UTC, Klaus wrote:
I mean when writing a D lexer, you necessarly reach the moment
when you think:
Oh no! is this feature just here to suck ?
They are and they do.
Also, use this:
On Monday, 11 August 2014 at 22:24:28 UTC, Brian Schott wrote:
On Monday, 11 August 2014 at 22:20:54 UTC, Brian Schott wrote:
On Monday, 11 August 2014 at 19:47:46 UTC, Klaus wrote:
I mean when writing a D lexer, you necessarly reach the
moment when you think:
Oh no! is this feature just
On Monday, 11 August 2014 at 22:56:27 UTC, Klaus wrote:
On Monday, 11 August 2014 at 22:24:28 UTC, Brian Schott wrote:
On Monday, 11 August 2014 at 22:20:54 UTC, Brian Schott wrote:
On Monday, 11 August 2014 at 19:47:46 UTC, Klaus wrote:
I mean when writing a D lexer, you necessarly reach the
I've finally got my lexer to the point where it can successfully
tokenize /usr/include/d2/4.3.2/std/*.d. Yay! :-) Now I'm going back to
fill in the gaps that still haven't been implemented yet. Among which
are delimited strings.
According to the online specs, delimited strings start with q
On 02/15/2012 01:38 AM, H. S. Teoh wrote:
I've finally got my lexer to the point where it can successfully
tokenize /usr/include/d2/4.3.2/std/*.d. Yay! :-) Now I'm going back to
fill in the gaps that still haven't been implemented yet. Among which
are delimited strings.
According to the online
On Wed, Feb 15, 2012 at 01:46:51AM +0100, Timon Gehr wrote:
[...]
No, qabca is illegal. The pattern is
qidentifier
string
identifier
(The terminating new line is kept, so the string in this case is
string\n)
I see. The online specs need to be clarified, then.
[...]
So does this mean
On 02/15/2012 02:03 AM, H. S. Teoh wrote:
On Wed, Feb 15, 2012 at 01:46:51AM +0100, Timon Gehr wrote:
[...]
No, qabca is illegal. The pattern is
qidentifier
string
identifier
(The terminating new line is kept, so the string in this case is
string\n)
I see. The online specs need to be
On 10/04/2011 21:51, Jonathan M Davis wrote:
snip
If that had been `something instead of 'something, _then_ the delimited string
becomes useful, but given how rarely backticks are needed, it does seem rather
odd to have delimited strings just for that. So, I definitely have to wonder
why
Ref http://digitalmars.com/d/2.0/lex.html
What are some possible use cases for delimited strings?
What is solved by having this in the language?
Ref http://digitalmars.com/d/2.0/lex.html
What are some possible use cases for delimited strings?
What is solved by having this in the language?
It's probably so that you can still use characters that require escaping in
the string without having to escape everywhere. WYSIWYGS don't allow
On 10/04/2011 17:51, Jonathan M Davis wrote:
Ref http://digitalmars.com/d/2.0/lex.html
What are some possible use cases for delimited strings?
What is solved by having this in the language?
It's probably so that you can still use characters that require escaping in
the string without having
On 10/04/2011 17:51, Jonathan M Davis wrote:
Ref http://digitalmars.com/d/2.0/lex.html
What are some possible use cases for delimited strings?
What is solved by having this in the language?
It's probably so that you can still use characters that require escaping
in the string
Are we forgetting the fact that using delimited strings allows us to
have syntax highlighting in editors?
E.g.:
void stringParser(string str)()
{
mixin(str);
}
void main()
{
stringParser!(q{
int x = 1;
int y = 2;
writefln(%s %s, x, y);
});
}
This is a huge
On 10.04.2011 21:17, Andrej Mitrovic wrote:
Are we forgetting the fact that using delimited strings allows us to
have syntax highlighting in editors?
E.g.:
void stringParser(string str)()
{
mixin(str);
}
void main()
{
stringParser!(q{
int x = 1;
int y = 2
Hmm..
Well then, those I've never seen used before. :)
On 4/10/11 11:03 AM, simendsjo wrote:
Ref http://digitalmars.com/d/2.0/lex.html
What are some possible use cases for delimited strings?
What is solved by having this in the language?
Readability.
auto s = This is 'something' that \could\ have been made easier to read;
auto t = q
On 4/10/11 11:03 AM, simendsjo wrote:
Ref http://digitalmars.com/d/2.0/lex.html
What are some possible use cases for delimited strings?
What is solved by having this in the language?
Readability.
auto s = This is 'something' that \could\ have been made easier to
read;
auto t
On 4/10/11 5:51 PM, Jonathan M Davis wrote:
On 4/10/11 11:03 AM, simendsjo wrote:
Ref http://digitalmars.com/d/2.0/lex.html
What are some possible use cases for delimited strings?
What is solved by having this in the language?
Readability.
auto s = This is 'something' that \could\ have been
25 matches
Mail list logo