[Mesa-dev] [PATCH] RFC: glsl/glcpp: Allow for '#' characters to appear in shader body
Erik Faye-Lund
kusmabite at gmail.com
Fri Aug 8 09:00:20 PDT 2014
On Fri, Aug 8, 2014 at 12:29 AM, Carl Worth <cworth at cworth.org> wrote:
> Erik Faye-Lund <kusmabite at gmail.com> writes:
>> Note that '$' is a bit different, as it's not a part of the
>> preprocessor's character set, so using it might be interpreted as
>> undefined behavior.
>
> Right. That could easily go either way. Is the phrase "each
> non-white-space character" restricted to characters of the original
> character set?
This is a bit unclear. Section 2.1 [lex.phases] has the following to say:
1. Physical source file characters are mapped, in an
implementation-defined manner, to the basic source character set
(introducing new-line characters for end-of-line indicators) if
necessary. Trigraph sequences are replaced by corresponding
single-character internal representations. Any source file character
not in the basic source character set is replaced by the
universal-character-name that designates that character. (An
implementation may use any internal encoding, so long as an actual
extended character encountered in the source file, and the same
extended character expressed in the source file as a
universal-character-name (i.e. using the \uXXXX notation), are handled
equivalently.)
<snip>
5. Each source character set member, escape sequence, or
universal-character-name in character literals and string literals is
converted to the corresponding member of the execution character set;
if there is no
corresponding member, it is converted to an implementation-defined
member other than the null (wide) character.
The "Any source file character not in the basic source character set
is replaced by the universal-character-name that designates that
character"-bit seems to be the interesting part, but I'm not quite
able to grok it. Appendix E lists universal-character-names, seemingly
from ISO/IEC PDTR 10176 (which seems to be some kind of guidelines for
programming language design).
It seems to me like this is there to support non-ASCII identifiers and
strings, but GLSL doesn't support either. I'm not able to come up with
a conclusion here.
More information about the mesa-dev
mailing list