home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!psinntp!heimdall!thor!scjones
- From: scjones@thor.sdrc.com (Larry Jones)
- Newsgroups: comp.lang.c
- Subject: Re: Questions about token merging and trigraphs
- Message-ID: <266@heimdall.sdrc.com>
- Date: 1 Jan 93 20:46:29 GMT
- References: <mcdonald.625@aries.scs.uiuc.edu> <yoF4VB1w165w@quest.UUCP> <16297@goanna.cs.rmit.oz.au>
- Sender: news@heimdall.sdrc.com
- Lines: 25
-
- In article <16297@goanna.cs.rmit.oz.au>, ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe) writes:
- > It is so easy to check for unintended digraphs and so easy to fix them
- > that I don't actually worry about this. I do find it amusing, though,
- > that the easy fix (changing ?? to ?\?) involves one of the very characters
- > that has a trigraph (??/ => \). Suppose we decide to use the trigraph for
- > backslash, and instead of writing ?\? write ???/?. Unfortunately, that
- > won't be parsed correctly, because ??? is not one of the recognised
- > trigraphs, it will be left untouched. You _must_ use ?\? or string
- > pasting to break up the question marks. And if you _can_ use ?\?, you
- > didn't need trigraphs.
-
- Not so. ANSI 2.2.1.1 Trigraph Sequences says (in part):
-
- No other trigraph sequences exist. Each ? that does not
- begin one of the trigraphs listed above is not changed.
-
- Note that it says each ? that does not begin a valid trigraph is left
- alone, not each sequence. Thus, ???/? is parsed correctly: ??? is not
- a valid trigraph, so the first ? is left unchanged, ??/ is a valid
- trigraph and so is replaced by \, and the final ? is also left alone
- resulting in ?\?.
- ----
- Larry Jones, SDRC, 2000 Eastman Dr., Milford, OH 45150-2789 513-576-2070
- larry.jones@sdrc.com or ...uunet!sdrc!larry.jones
- I hope Mom and Dad didn't rent out my room. -- Calvin
-