mirror of
https://github.com/ganelson/inform.git
synced 2024-07-01 06:24:58 +03:00
Further wchar_t puritanism
This commit is contained in:
parent
5aa0b6b9dd
commit
2b5772281a
|
@ -1,6 +1,6 @@
|
|||
# Inform 7
|
||||
|
||||
v10.1.0-alpha.1+6Q72 'Krypton' (10 July 2020)
|
||||
v10.1.0-alpha.1+6Q73 'Krypton' (13 July 2020)
|
||||
|
||||
## About Inform 7
|
||||
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
Prerelease: alpha.1
|
||||
Build Date: 10 July 2020
|
||||
Build Number: 6Q72
|
||||
Build Date: 13 July 2020
|
||||
Build Number: 6Q73
|
||||
|
|
|
@ -231,7 +231,7 @@ void Solution::undo_XML_escapes_in_string(text_stream *p) {
|
|||
@ Note that all other ampersand-escapes are passed through verbatim.
|
||||
|
||||
@<We have identified an XML escape@> =
|
||||
int c = 0;
|
||||
wchar_t c = 0;
|
||||
if (Str::eq_wide_string(xml_escape, L"<")) c = '<';
|
||||
if (Str::eq_wide_string(xml_escape, L">")) c = '>';
|
||||
if (Str::eq_wide_string(xml_escape, L"&")) c = '&';
|
||||
|
|
|
@ -513,9 +513,9 @@ void Properties::set_translation_S(property *prn, text_stream *t) {
|
|||
Properties::iname(prn);
|
||||
TEMPORARY_TEXT(T)
|
||||
LOOP_THROUGH_TEXT(pos, t) {
|
||||
int c = Str::get(pos);
|
||||
wchar_t c = Str::get(pos);
|
||||
if ((isalpha(c)) || (Characters::isdigit(c)) || (c == '_'))
|
||||
PUT_TO(T, c);
|
||||
PUT_TO(T, (int) c);
|
||||
else
|
||||
PUT_TO(T, '_');
|
||||
}
|
||||
|
|
|
@ -626,7 +626,7 @@ int Equations::equation_symbol_legal(wording W) {
|
|||
wchar_t *p = Lexer::word_raw_text(Wordings::first_wn(W));
|
||||
int j, letters = 0, digits = 0, name_legal = TRUE;
|
||||
for (j=0; p[j]; j++) {
|
||||
int c = p[j];
|
||||
wchar_t c = p[j];
|
||||
if (Characters::isdigit(c)) digits++;
|
||||
else if (Characters::isalpha(c)) { letters++; if (digits > 0) name_legal = FALSE; }
|
||||
else name_legal = FALSE;
|
||||
|
@ -772,7 +772,7 @@ equation_node *Equations::eqn_parse(equation *eqn) {
|
|||
@ Note that symbol names can't begin with a digit.
|
||||
|
||||
@<Break off a token from the current position@> =
|
||||
int c = p[i];
|
||||
wchar_t c = p[i];
|
||||
if (Characters::isalpha(c)) @<Break off a symbol name as a token@>
|
||||
else if (Characters::isdigit(c)) @<Break off a numeric constant as a token@>
|
||||
else @<Break off an operator or a piece of punctuation as a token@>;
|
||||
|
@ -881,7 +881,7 @@ capacity; and so is the number 0 itself.
|
|||
case ')': token = Equations::enode_new(CLOSE_BRACKET_EQN); bl--; break;
|
||||
default: {
|
||||
TEMPORARY_TEXT(symbol)
|
||||
PUT_TO(symbol, c);
|
||||
PUT_TO(symbol, (int) c);
|
||||
StandardProblems::equation_problem_S(_p_(PM_EquationOperatorUnrecognised), eqn, symbol,
|
||||
"the symbol '%3' is one that I don't recognise. I was "
|
||||
"expecting an arithmetic sign, '+', '-', '*','/', or '^', "
|
||||
|
|
|
@ -206,15 +206,15 @@ void CompiledText::from_stream(OUTPUT_STREAM, text_stream *p, int options) {
|
|||
}
|
||||
if (options & CT_RAW) {
|
||||
for (i=from; i<to; i++) {
|
||||
int c = Str::get_at(p, i);
|
||||
wchar_t c = Str::get_at(p, i);
|
||||
if ((i == from) && (options & CT_CAPITALISE))
|
||||
WRITE("%c", Characters::toupper(c));
|
||||
WRITE("%c", (int) Characters::toupper(c));
|
||||
else
|
||||
WRITE("%c", c);
|
||||
WRITE("%c", (int) c);
|
||||
}
|
||||
} else {
|
||||
for (i=from; i<to; i++) {
|
||||
int c = Str::get_at(p, i);
|
||||
wchar_t c = Str::get_at(p, i);
|
||||
switch(c) {
|
||||
case '\n':
|
||||
if (options & CT_BOX_QUOTATION) WRITE("\"\n\"");
|
||||
|
@ -229,31 +229,31 @@ void CompiledText::from_stream(OUTPUT_STREAM, text_stream *p, int options) {
|
|||
else WRITE("^"); break;
|
||||
case '"':
|
||||
if (options & CT_I6) WRITE("~");
|
||||
else WRITE("%c", c);
|
||||
else WRITE("%c", (int) c);
|
||||
break;
|
||||
case '@':
|
||||
if (options & CT_I6) {
|
||||
if (options & CT_FOR_ARRAY) WRITE("@{40}");
|
||||
else { WRITE("@@64"); esc_digit = TRUE; continue; }
|
||||
} else WRITE("%c", c);
|
||||
} else WRITE("%c", (int) c);
|
||||
break;
|
||||
case '^':
|
||||
if (options & CT_I6) {
|
||||
if (options & CT_BOX_QUOTATION) WRITE("\"\n\"");
|
||||
else if (options & CT_FOR_ARRAY) WRITE("@{5E}");
|
||||
else { WRITE("@@94"); esc_digit = TRUE; continue; }
|
||||
} else WRITE("%c", c);
|
||||
} else WRITE("%c", (int) c);
|
||||
break;
|
||||
case '~':
|
||||
if (options & CT_I6) {
|
||||
if (options & CT_FOR_ARRAY) WRITE("@{7E}");
|
||||
else { WRITE("@@126"); esc_digit = TRUE; continue; }
|
||||
} else WRITE("%c", c);
|
||||
} else WRITE("%c", (int) c);
|
||||
break;
|
||||
case '\\':
|
||||
if (options & CT_I6) {
|
||||
WRITE("@{5C}");
|
||||
} else WRITE("%c", c);
|
||||
} else WRITE("%c", (int) c);
|
||||
break;
|
||||
case '\'':
|
||||
if (options & CT_EXPAND_APOSTROPHES)
|
||||
|
@ -262,19 +262,20 @@ void CompiledText::from_stream(OUTPUT_STREAM, text_stream *p, int options) {
|
|||
break;
|
||||
case '[':
|
||||
if ((options & CT_RECOGNISE_APOSTROPHE_SUBSTITUTION) &&
|
||||
(Str::get_at(p, i+1) == '\'') && (Str::get_at(p, i+2) == ']')) { i += 2; WRITE("'"); }
|
||||
else if (options & CT_RECOGNISE_UNICODE_SUBSTITUTION) {
|
||||
(Str::get_at(p, i+1) == '\'') && (Str::get_at(p, i+2) == ']')) {
|
||||
i += 2; WRITE("'");
|
||||
} else if (options & CT_RECOGNISE_UNICODE_SUBSTITUTION) {
|
||||
int n = CompiledText::expand_unisub_S(OUT, p, i);
|
||||
if (n == -1) WRITE("["); else i = n;
|
||||
} else WRITE("[");
|
||||
break;
|
||||
default:
|
||||
if ((i==from) && (options & CT_CAPITALISE))
|
||||
WRITE("%c", Characters::toupper(c));
|
||||
WRITE("%c", (int) Characters::toupper(c));
|
||||
else if ((esc_digit) && (Characters::isdigit(c)))
|
||||
WRITE("@{%02x}", c);
|
||||
WRITE("@{%02x}", (int) c);
|
||||
else
|
||||
WRITE("%c", c);
|
||||
WRITE("%c", (int) c);
|
||||
break;
|
||||
}
|
||||
esc_digit = FALSE;
|
||||
|
|
|
@ -104,7 +104,7 @@ match those in the specification, so this notation does not match the text
|
|||
typedef struct literal_pattern_token {
|
||||
int new_word_at; /* does token start a new word? */
|
||||
int lpt_type; /* one of the three constants defined above */
|
||||
int token_char; /* |CHARACTER_LPT| only; the character to match */
|
||||
wchar_t token_char; /* |CHARACTER_LPT| only; the character to match */
|
||||
int token_wn; /* |WORD_LPT| only; word number in source text of the prototype */
|
||||
} literal_pattern_token;
|
||||
|
||||
|
@ -698,7 +698,7 @@ void LiteralPatterns::gpr(gpr_kit *gprk, literal_pattern *lp) {
|
|||
for (tc=0, ec=0; tc<lp->no_lp_tokens; tc++) {
|
||||
int lookahead = -1;
|
||||
if ((tc+1<lp->no_lp_tokens) && (lp->lp_tokens[tc+1].lpt_type == CHARACTER_LPT))
|
||||
lookahead = lp->lp_tokens[tc+1].token_char;
|
||||
lookahead = (int) (lp->lp_tokens[tc+1].token_char);
|
||||
Produce::inv_primitive(Emit::tree(), IF_BIP);
|
||||
Produce::down(Emit::tree());
|
||||
Produce::inv_primitive(Emit::tree(), EQ_BIP);
|
||||
|
@ -1900,7 +1900,7 @@ note that the following uses the raw text of the word.
|
|||
WRITE("%<N", lp->lp_tokens[tc].token_wn);
|
||||
|
||||
@<Index a character token within a literal pattern@> =
|
||||
HTML::put(OUT, lp->lp_tokens[tc].token_char);
|
||||
HTML::put(OUT, (int) lp->lp_tokens[tc].token_char);
|
||||
|
||||
@<Index an element token within a literal pattern@> =
|
||||
if (Kinds::FloatingPoint::uses_floating_point(lp->kind_specified)) {
|
||||
|
@ -2115,7 +2115,7 @@ the sorting measure.
|
|||
@<Compile I6 code to print a character token within a literal pattern@> =
|
||||
TEMPORARY_TEXT(T)
|
||||
TEMPORARY_TEXT(tiny_string)
|
||||
PUT_TO(tiny_string, lp->lp_tokens[tc].token_char);
|
||||
PUT_TO(tiny_string, (int) lp->lp_tokens[tc].token_char);
|
||||
CompiledText::from_stream(T, tiny_string, CT_RAW);
|
||||
DISCARD_TEXT(tiny_string)
|
||||
Produce::inv_primitive(Emit::tree(), PRINT_BIP);
|
||||
|
|
|
@ -29,7 +29,7 @@ text_stream *PL::Bibliographic::IFID::read_uuid(void) {
|
|||
int c;
|
||||
while (((c = fgetc(xf)) != EOF) /* the UUID file is plain text, not Unicode */
|
||||
&& (uuid_read++ < MAX_UUID_LENGTH-1))
|
||||
PUT_TO(uuid_text, Characters::toupper(c));
|
||||
PUT_TO(uuid_text, (int) Characters::toupper((wchar_t) c));
|
||||
fclose(xf);
|
||||
return uuid_text;
|
||||
}
|
||||
|
|
|
@ -1018,7 +1018,7 @@ optional, operand in |operand2|.
|
|||
|
||||
@<Look for a possible abbreviated command@> =
|
||||
int at = pos;
|
||||
int c = Str::get_at(from, ++at);
|
||||
wchar_t c = Str::get_at(from, ++at);
|
||||
int iss_bitmap = 0;
|
||||
switch (c) {
|
||||
case '!': iss_bitmap = iss_bitmap | PERMIT_LOCALS_IN_TEXT_CMODE_ISSBM; c = Str::get_at(from, ++at); break;
|
||||
|
@ -1041,7 +1041,7 @@ optional, operand in |operand2|.
|
|||
t->bracing = Str::duplicate(T);
|
||||
t->inline_command = substitute_ISINC;
|
||||
t->inline_modifiers = iss_bitmap;
|
||||
t->constant_number = c - '1';
|
||||
t->constant_number = (int) c - (int) '1';
|
||||
InterSchemas::add_token(sch, t);
|
||||
preceding_token = t;
|
||||
DISCARD_TEXT(T)
|
||||
|
|
Loading…
Reference in a new issue