/* Special handling for a character array initialized by a literal */
if (IsTypeChar (ElementType) &&
- (CurTok.Tok == TOK_SCONST ||
- (CurTok.Tok == TOK_LCURLY && NextTok.Tok == TOK_SCONST))) {
+ (CurTok.Tok == TOK_SCONST || CurTok.Tok == TOK_WCSCONST ||
+ (CurTok.Tok == TOK_LCURLY &&
+ (NextTok.Tok == TOK_SCONST || NextTok.Tok == TOK_WCSCONST)))) {
/* Char array initialized by string constant */
int NeedParen;
/* */
/* */
/* */
-/* (C) 1998-2008 Ullrich von Bassewitz */
-/* Roemerstrasse 52 */
-/* D-70794 Filderstadt */
-/* EMail: uz@cc65.org */
+/* (C) 1998-2009, Ullrich von Bassewitz */
+/* Roemerstrasse 52 */
+/* D-70794 Filderstadt */
+/* EMail: uz@cc65.org */
/* */
/* */
/* This software is provided 'as-is', without any expressed or implied */
NextTok.IVal = GetLiteralPoolOffs ();
NextTok.Tok = TOK_SCONST;
- /* Be sure to concatenate strings */
- while (CurC == '\"') {
+ /* Concatenate strings. If at least one of the concenated strings is a wide
+ * character literal, the whole string is a wide char literal, otherwise
+ * it's a normal string literal.
+ */
+ while (1) {
- /* Skip the quote char */
- NextChar ();
+ /* Check if this is a normal or a wide char string */
+ if (CurC == 'L' && NextC == '\"') {
+ /* Wide character literal */
+ NextTok.Tok = TOK_WCSCONST;
+ NextChar ();
+ NextChar ();
+ } else if (CurC == '\"') {
+ /* Skip the quote char */
+ NextChar ();
+ } else {
+ /* No string */
+ break;
+ }
- while (CurC != '\"') {
- if (CurC == '\0') {
- Error ("Unexpected newline");
- break;
- }
- AddLiteralChar (ParseChar ());
- }
+ /* Read until end of string */
+ while (CurC != '\"') {
+ if (CurC == '\0') {
+ Error ("Unexpected newline");
+ break;
+ }
+ AddLiteralChar (ParseChar ());
+ }
- /* Skip closing quote char if there was one */
+ /* Skip closing quote char if there was one */
NextChar ();
/* Skip white space, read new input */
return;
}
+ /* Check for wide character literals */
+ if (CurC == 'L' && NextC == '\"') {
+ StringConst ();
+ return;
+ }
+
+ /* Check for keywords and identifiers */
if (IsSym (token)) {
/* Check for a keyword */
/* */
/* */
/* */
-/* (C) 1998-2004 Ullrich von Bassewitz */
-/* Römerstrasse 52 */
-/* D-70794 Filderstadt */
-/* EMail: uz@cc65.org */
+/* (C) 1998-2009, Ullrich von Bassewitz */
+/* Roemerstrasse 52 */
+/* D-70794 Filderstadt */
+/* EMail: uz@cc65.org */
/* */
/* */
/* This software is provided 'as-is', without any expressed or implied */
TOK_ICONST,
TOK_CCONST,
TOK_FCONST,
+ TOK_WCSCONST,
TOK_ATTRIBUTE,
TOK_FAR,