Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #148151

Re: curiosity about compiler phases

From Ben Bacarisse <ben.usenet@bsb.me.uk>
Newsgroups comp.lang.c
Subject Re: curiosity about compiler phases
Date 2019-11-24 16:49 +0000
Organization A noiseless patient Spider
Message-ID <871rtx5ie5.fsf@bsb.me.uk> (permalink)
References (3 earlier) <dK_BF.12$LP4.8@fx40.am4> <87imnb5poj.fsf@bsb.me.uk> <zI0CF.183551$oT5.82048@fx47.iad> <87d0di550h.fsf@bsb.me.uk> <EQtCF.31543$ku.7788@fx04.am4>

Show all headers | View raw


Bart <bc@freeuk.com> writes:

> On 24/11/2019 03:26, Ben Bacarisse wrote:
>> Richard Damon <Richard@Damon-Family.org> writes:
>
>>> It would be more complicated to prevent this from happening, it would
>>> require tokenizing before line splicing, but also you would then need
>>> something more complicated to describe how to tokenize, as strings
>>> tokens now might include a line break that has been escaped by the
>>> backslash.
>>
>> I don't think the string case is complicated.  Strings need to have
>> escape sequences mapped anyway.
>
> It's more complicated because you have to deal with this:
>
>   ABC\\*\*nDEF
>
> where * represents an actual newline (eg. lf or cr, lf). So nested
> escapes.

No, as a string ("ABC\\
\
nDEF") is not valid in K&R C.

> (Although it's possible that that wasn't supported; maybe you couldn't
> have a line break in the middle of an escape sequence.)

Quite.  It wasn't.  A \ before a newline in a string continues the
string, but the \\ in your example gives an actual \ in the resulting
string.  To continue it, you'd need to write "ABC\\\
\
nDEF" and you'd end up with a string that could have been written as
"ABC\\nDEF".  It really was simple to process and a special case
designed for strings.

-- 
Ben.

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

curiosity about compiler phases Thiago Adams <thiago.adams@gmail.com> - 2019-11-07 05:28 -0800
  Re: curiosity about compiler phases Nick Bowler <nbowler@draconx.ca> - 2019-11-22 19:25 +0000
  Re: curiosity about compiler phases "A. K." <minforth@arcor.de> - 2019-11-22 12:19 -0800
  Re: curiosity about compiler phases Bart <bc@freeuk.com> - 2019-11-22 22:22 +0000
    Typo? (Was: curiosity about compiler phases) gazelle@shell.xmission.com (Kenny McCormack) - 2019-11-22 22:34 +0000
      Re: Typo? (Was: curiosity about compiler phases) Bart <bc@freeuk.com> - 2019-11-22 23:49 +0000
        Re: Typo? Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2019-11-22 19:26 -0700
    Re: curiosity about compiler phases scott@slp53.sl.home (Scott Lurndal) - 2019-11-22 23:12 +0000
      Re: curiosity about compiler phases Bart <bc@freeuk.com> - 2019-11-23 00:06 +0000
        Re: curiosity about compiler phases Richard Damon <Richard@Damon-Family.org> - 2019-11-22 20:34 -0500
        Re: curiosity about compiler phases Ben Bacarisse <ben.usenet@bsb.me.uk> - 2019-11-23 01:47 +0000
          Re: curiosity about compiler phases Richard Damon <Richard@Damon-Family.org> - 2019-11-22 21:21 -0500
            Re: curiosity about compiler phases Ben Bacarisse <ben.usenet@bsb.me.uk> - 2019-11-24 03:26 +0000
              Re: curiosity about compiler phases Bart <bc@freeuk.com> - 2019-11-24 11:29 +0000
                Re: curiosity about compiler phases Ben Bacarisse <ben.usenet@bsb.me.uk> - 2019-11-24 16:49 +0000
          Re: curiosity about compiler phases Bart <bc@freeuk.com> - 2019-11-23 12:21 +0000
            Re: curiosity about compiler phases Richard Damon <Richard@Damon-Family.org> - 2019-11-23 10:08 -0500
            Re: curiosity about compiler phases scott@slp53.sl.home (Scott Lurndal) - 2019-11-23 15:49 +0000
              Re: curiosity about compiler phases Bart <bc@freeuk.com> - 2019-11-23 16:21 +0000
                Re: curiosity about compiler phases Ben Bacarisse <ben.usenet@bsb.me.uk> - 2019-11-24 03:37 +0000
                Re: curiosity about compiler phases Bart <bc@freeuk.com> - 2019-11-24 11:25 +0000
                Re: curiosity about compiler phases Bart <bc@freeuk.com> - 2019-11-25 14:06 +0000
    Re: curiosity about compiler phases Keith Thompson <kst-u@mib.org> - 2019-11-22 21:25 -0800
      Beyond our pay grade (Was: curiosity about compiler phases) gazelle@shell.xmission.com (Kenny McCormack) - 2019-11-23 07:43 +0000
    Re: curiosity about compiler phases Thiago Adams <thiago.adams@gmail.com> - 2019-11-23 06:28 -0800
      Re: curiosity about compiler phases Thiago Adams <thiago.adams@gmail.com> - 2019-11-23 06:39 -0800
      Re: curiosity about compiler phases Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2019-11-23 09:46 -0500
        Re: curiosity about compiler phases Richard Damon <Richard@Damon-Family.org> - 2019-11-23 10:16 -0500
      Re: curiosity about compiler phases Bart <bc@freeuk.com> - 2019-11-23 16:13 +0000
        Re: curiosity about compiler phases Thiago Adams <thiago.adams@gmail.com> - 2019-11-25 03:24 -0800
  Re: curiosity about compiler phases Bonita Montero <Bonita.Montero@gmail.com> - 2019-11-23 08:43 +0100

csiph-web