diff: s/character/char
Tyson Richard DOWD
trd at hydra.cs.mu.oz.au
Wed May 28 17:22:21 AEST 1997
Hi.
Estimated hours taken: 0.05
compiler/llds_out.m:
compiler/mercury_to_goedel.m:
compiler/options.m:
library/lexer.m:
library/string.m:
library/term_io.m:
Remove references to `character' since use of it is discouraged.
Use `char' instead.
Index: compiler/llds_out.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/compiler/llds_out.m,v
retrieving revision 1.47
diff -u -r1.47 llds_out.m
--- llds_out.m 1997/05/27 03:06:29 1.47
+++ llds_out.m 1997/05/28 07:09:30
@@ -2740,7 +2740,7 @@
[]
).
-:- pred quote_c_char(character, character).
+:- pred quote_c_char(char, char).
:- mode quote_c_char(in, out) is semidet.
quote_c_char('"', '"').
Index: compiler/mercury_to_goedel.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/compiler/mercury_to_goedel.m,v
retrieving revision 1.57
diff -u -r1.57 mercury_to_goedel.m
--- mercury_to_goedel.m 1997/05/21 02:13:35 1.57
+++ mercury_to_goedel.m 1997/05/28 07:09:15
@@ -854,7 +854,7 @@
[]
).
-:- pred goedel_quote_char(character, character).
+:- pred goedel_quote_char(char, char).
:- mode goedel_quote_char(in, out) is semidet.
goedel_quote_char('"', '"').
Index: compiler/options.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/compiler/options.m,v
retrieving revision 1.197
diff -u -r1.197 options.m
--- options.m 1997/05/21 02:13:43 1.197
+++ options.m 1997/05/28 07:09:45
@@ -20,7 +20,7 @@
:- interface.
:- import_module io, getopt.
-:- pred short_option(character::in, option::out) is semidet.
+:- pred short_option(char::in, option::out) is semidet.
:- pred long_option(string::in, option::out) is semidet.
:- pred option_defaults(option::out, option_data::out) is nondet.
:- pred special_handler(option::in, special_data::in, option_table::in,
Index: library/lexer.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/library/lexer.m,v
retrieving revision 1.24
diff -u -r1.24 lexer.m
--- lexer.m 1997/05/23 01:21:10 1.24
+++ lexer.m 1997/05/28 04:30:15
@@ -35,7 +35,7 @@
; ht_sep % '|'
; comma % ','
; end % '.'
- ; junk(character) % junk character in the input stream
+ ; junk(char) % junk character in the input stream
; error(string) % some other invalid token
; io_error(io__error) % error reading from the input stream
; eof. % end-of-file
@@ -65,7 +65,7 @@
% lexer__graphic_token_char(Char): true iff `Char'
% is "graphic token char" (ISO Prolog 6.4.2).
% This is exported for use by term_io__quote_atom.
-:- pred lexer__graphic_token_char(character).
+:- pred lexer__graphic_token_char(char).
:- mode lexer__graphic_token_char(in) is semidet.
%-----------------------------------------------------------------------------%
@@ -229,7 +229,7 @@
%-----------------------------------------------------------------------------%
-:- pred lexer__special_token(character, token).
+:- pred lexer__special_token(char, token).
:- mode lexer__special_token(in, out) is semidet.
lexer__special_token('(', open). % May get converted to open_ct
@@ -284,7 +284,7 @@
)
).
-:- pred lexer__whitespace_after_dot(character).
+:- pred lexer__whitespace_after_dot(char).
:- mode lexer__whitespace_after_dot(in) is semidet.
lexer__whitespace_after_dot(' ').
@@ -373,7 +373,7 @@
% quoted names and quoted strings
-:- pred lexer__get_quoted_name(character, list(character), token,
+:- pred lexer__get_quoted_name(char, list(char), token,
io__state, io__state).
:- mode lexer__get_quoted_name(in, in, out, di, uo) is det.
@@ -393,7 +393,7 @@
)
).
-:- pred lexer__get_quoted_name_quote(character, list(character), token,
+:- pred lexer__get_quoted_name_quote(char, list(char), token,
io__state, io__state).
:- mode lexer__get_quoted_name_quote(in, in, out, di, uo) is det.
@@ -412,7 +412,7 @@
)
).
-:- pred lexer__finish_quoted_name(character, list(character), token).
+:- pred lexer__finish_quoted_name(char, list(char), token).
:- mode lexer__finish_quoted_name(in, in, out) is det.
lexer__finish_quoted_name(QuoteChar, Chars, Token) :-
@@ -425,7 +425,7 @@
error("lexer.m: unknown quote character")
).
-:- pred lexer__get_quoted_name_escape(character, list(character), token,
+:- pred lexer__get_quoted_name_escape(char, list(char), token,
io__state, io__state).
:- mode lexer__get_quoted_name_escape(in, in, out, di, uo) is det.
@@ -451,7 +451,7 @@
)
).
-:- pred lexer__escape_char(character, character).
+:- pred lexer__escape_char(char, char).
:- mode lexer__escape_char(in, out) is semidet.
lexer__escape_char('a', '\a').
@@ -466,7 +466,7 @@
lexer__escape_char('"', '"').
lexer__escape_char('`', '`').
-:- pred lexer__get_hex_escape(character, list(character), list(character),
+:- pred lexer__get_hex_escape(char, list(char), list(char),
token, io__state, io__state).
:- mode lexer__get_hex_escape(in, in, in, out, di, uo) is det.
@@ -488,7 +488,7 @@
)
).
-:- pred lexer__finish_hex_escape(character, list(character), list(character),
+:- pred lexer__finish_hex_escape(char, list(char), list(char),
token, io__state, io__state).
:- mode lexer__finish_hex_escape(in, in, in, out, di, uo) is det.
@@ -507,7 +507,7 @@
)
).
-:- pred lexer__get_octal_escape(character, list(character), list(character),
+:- pred lexer__get_octal_escape(char, list(char), list(char),
token, io__state, io__state).
:- mode lexer__get_octal_escape(in, in, in, out, di, uo) is det.
@@ -537,7 +537,7 @@
)
).
-:- pred lexer__finish_octal_escape(character, list(character), list(character),
+:- pred lexer__finish_octal_escape(char, list(char), list(char),
token, io__state, io__state).
:- mode lexer__finish_octal_escape(in, in, in, out, di, uo) is det.
@@ -560,7 +560,7 @@
% names and variables
-:- pred lexer__get_name(list(character), token, io__state, io__state).
+:- pred lexer__get_name(list(char), token, io__state, io__state).
:- mode lexer__get_name(in, out, di, uo) is det.
lexer__get_name(Chars, Token) -->
@@ -629,7 +629,7 @@
)
).
-:- pred lexer__get_graphic(list(character), token, io__state, io__state).
+:- pred lexer__get_graphic(list(char), token, io__state, io__state).
:- mode lexer__get_graphic(in, out, di, uo) is det.
lexer__get_graphic(Chars, Token) -->
@@ -649,7 +649,7 @@
)
).
-:- pred lexer__get_variable(list(character), token, io__state, io__state).
+:- pred lexer__get_variable(list(char), token, io__state, io__state).
:- mode lexer__get_variable(in, out, di, uo) is det.
lexer__get_variable(Chars, Token) -->
@@ -735,7 +735,7 @@
)
).
-:- pred lexer__get_binary_2(list(character), token, io__state, io__state).
+:- pred lexer__get_binary_2(list(char), token, io__state, io__state).
:- mode lexer__get_binary_2(in, out, di, uo) is det.
lexer__get_binary_2(Chars, Token) -->
@@ -771,7 +771,7 @@
)
).
-:- pred lexer__get_octal_2(list(character), token, io__state, io__state).
+:- pred lexer__get_octal_2(list(char), token, io__state, io__state).
:- mode lexer__get_octal_2(in, out, di, uo) is det.
lexer__get_octal_2(Chars, Token) -->
@@ -807,7 +807,7 @@
)
).
-:- pred lexer__get_hex_2(list(character), token, io__state, io__state).
+:- pred lexer__get_hex_2(list(char), token, io__state, io__state).
:- mode lexer__get_hex_2(in, out, di, uo) is det.
lexer__get_hex_2(Chars, Token) -->
@@ -825,7 +825,7 @@
)
).
-:- pred lexer__get_number(list(character), token, io__state, io__state).
+:- pred lexer__get_number(list(char), token, io__state, io__state).
:- mode lexer__get_number(in, out, di, uo) is det.
lexer__get_number(Chars, Token) -->
@@ -849,7 +849,7 @@
% XXX the float literal syntax doesn't match ISO Prolog
-:- pred lexer__get_int_dot(list(character), token, io__state, io__state).
+:- pred lexer__get_int_dot(list(char), token, io__state, io__state).
:- mode lexer__get_int_dot(in, out, di, uo) is det.
lexer__get_int_dot(Chars, Token) -->
@@ -869,7 +869,7 @@
)
).
-:- pred lexer__get_float_decimals(list(character), token, io__state, io__state).
+:- pred lexer__get_float_decimals(list(char), token, io__state, io__state).
:- mode lexer__get_float_decimals(in, out, di, uo) is det.
% we've read past the decimal point, so now get the decimals
@@ -891,7 +891,7 @@
)
).
-:- pred lexer__get_float_exponent(list(character), token, io__state, io__state).
+:- pred lexer__get_float_exponent(list(char), token, io__state, io__state).
:- mode lexer__get_float_exponent(in, out, di, uo) is det.
lexer__get_float_exponent(Chars, Token) -->
@@ -912,7 +912,7 @@
)
).
-:- pred lexer__get_float_exponent_2(list(character), token,
+:- pred lexer__get_float_exponent_2(list(char), token,
io__state, io__state).
:- mode lexer__get_float_exponent_2(in, out, di, uo) is det.
@@ -936,7 +936,7 @@
)
).
-:- pred lexer__get_float_exponent_3(list(character), token,
+:- pred lexer__get_float_exponent_3(list(char), token,
io__state, io__state).
:- mode lexer__get_float_exponent_3(in, out, di, uo) is det.
@@ -962,7 +962,7 @@
% Utility routines
-:- pred lexer__rev_char_list_to_int(list(character), int, token).
+:- pred lexer__rev_char_list_to_int(list(char), int, token).
:- mode lexer__rev_char_list_to_int(in, in, out) is det.
lexer__rev_char_list_to_int(RevChars, Base, Token) :-
@@ -973,7 +973,7 @@
Token = error("invalid integer token")
).
-:- pred lexer__rev_char_list_to_float(list(character), token).
+:- pred lexer__rev_char_list_to_float(list(char), token).
:- mode lexer__rev_char_list_to_float(in, out) is det.
lexer__rev_char_list_to_float(RevChars, Token) :-
@@ -984,7 +984,7 @@
Token = error("invalid float token")
).
-:- pred lexer__rev_char_list_to_string(list(character), string).
+:- pred lexer__rev_char_list_to_string(list(char), string).
:- mode lexer__rev_char_list_to_string(in, out) is det.
lexer__rev_char_list_to_string(RevChars, String) :-
Index: library/string.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/library/string.m,v
retrieving revision 1.90
diff -u -r1.90 string.m
--- string.m 1997/05/23 01:21:08 1.90
+++ string.m 1997/05/28 02:49:48
@@ -49,7 +49,7 @@
% string__prefix(String, Prefix) is true iff Prefix is a
% prefix of String. Same as string__append(Prefix, _, String).
-:- pred string__char_to_string(character, string).
+:- pred string__char_to_string(char, string).
:- mode string__char_to_string(in, out) is det.
:- mode string__char_to_string(out, in) is semidet.
% string__char_to_string(Char, String).
@@ -69,7 +69,7 @@
:- mode string__float_to_string(in, out) is det.
% Convert an float to a string.
-:- pred string__first_char(string, character, string).
+:- pred string__first_char(string, char, string).
:- mode string__first_char(in, in, in) is semidet. % implied
:- mode string__first_char(in, out, in) is semidet. % implied
:- mode string__first_char(in, in, out) is semidet. % implied
@@ -108,16 +108,16 @@
:- mode string__uncapitalize_first(in, out) is det.
% Convert the first character (if any) of a string to lowercase.
-:- pred string__to_char_list(string, list(character)).
+:- pred string__to_char_list(string, list(char)).
:- mode string__to_char_list(in, out) is det.
-:- pred string__from_char_list(list(character), string).
+:- pred string__from_char_list(list(char), string).
:- mode string__from_char_list(in, out) is det.
:- mode string__from_char_list(out, in) is semidet.
% XXX second mode should be det too
% (but this turns out to be tricky to implement)
-:- pred string__from_rev_char_list(list(character), string).
+:- pred string__from_rev_char_list(list(char), string).
:- mode string__from_rev_char_list(in, out) is det.
% Same as string__from_char_list, except that it reverses the order
% of the characters.
@@ -153,37 +153,37 @@
:- mode string__is_alnum_or_underscore(in) is semidet.
% True if string contains only letters, digits, and underscores.
-:- pred string__pad_left(string, character, int, string).
+:- pred string__pad_left(string, char, int, string).
:- mode string__pad_left(in, in, in, out) is det.
% string__pad_left(String0, PadChar, Width, String):
% insert `PadChar's at the left of `String0' until it is at least
% as long as `Width', giving `String'.
-:- pred string__pad_right(string, character, int, string).
+:- pred string__pad_right(string, char, int, string).
:- mode string__pad_right(in, in, in, out) is det.
% string__pad_right(String0, PadChar, Width, String):
% insert `PadChar's at the right of `String0' until it is at least
% as long as `Width', giving `String'.
-:- pred string__duplicate_char(character, int, string).
+:- pred string__duplicate_char(char, int, string).
:- mode string__duplicate_char(in, in, out) is det.
% string__duplicate_char(Char, Count, String):
% construct a string consisting of `Count' occurrences of `Char'
% in sequence.
-:- pred string__contains_char(string, character).
+:- pred string__contains_char(string, char).
:- mode string__contains_char(in, in) is semidet.
% string__contains_char(String, Char):
% succeed if `Char' occurs in `String'.
-:- pred string__index(string, int, character).
+:- pred string__index(string, int, char).
:- mode string__index(in, in, out) is semidet.
% string__index(String, Index, Char):
% `Char' is the (`Index' + 1)-th character of `String'.
% Fails if `Index' is out of range (negative, or greater than or
% equal to the length of `String').
-:- pred string__index_det(string, int, character).
+:- pred string__index_det(string, int, char).
:- mode string__index_det(in, in, out) is det.
% string__index_det(String, Index, Char):
% `Char' is the (`Index' + 1)-th character of `String'.
@@ -331,8 +331,7 @@
% find_all_sub_charlist replaces any occurences of the second list of
% characters (in order) in the first list of characters with the second
% list of characters.
-:- pred find_all_sub_charlist(list(character), list(character), list(character),
- list(character)).
+:- pred find_all_sub_charlist(list(char), list(char), list(char), list(char)).
:- mode find_all_sub_charlist(in, in, in, out) is det.
find_all_sub_charlist(CharList, SubCharList0, SubCharList1, CharList0) :-
@@ -360,8 +359,7 @@
% find_sub_charlist(List, SubList, Before, After) is true iff SubList
% is a sublist of List, and Before is the list of characters before
% SubList in List, and After is the list after it.
-:- pred find_sub_charlist(list(character), list(character), list(character),
- list(character)).
+:- pred find_sub_charlist(list(char), list(char), list(char), list(char)).
:- mode find_sub_charlist(in, in, out, out) is semidet.
find_sub_charlist(CharList, [], [], CharList).
@@ -389,8 +387,7 @@
% find_rest_of_sub_charlist(List, SubList, After) is true iff List
% begins with all the characters in SubList in order, and end with
% After.
-:- pred find_rest_of_sub_charlist(list(character), list(character),
- list(character)).
+:- pred find_rest_of_sub_charlist(list(char), list(char), list(char)).
:- mode find_rest_of_sub_charlist(in, in, out) is semidet.
find_rest_of_sub_charlist(CharList, SubCharList, After) :-
@@ -559,7 +556,7 @@
}
}").
-:- pred string__int_list_to_char_list(list(int), list(character)).
+:- pred string__int_list_to_char_list(list(int), list(char)).
:- mode string__int_list_to_char_list(in, out) is det.
string__int_list_to_char_list([], []).
@@ -571,7 +568,7 @@
),
string__int_list_to_char_list(Codes, Chars).
-:- pred string__char_list_to_int_list(list(character), list(int)).
+:- pred string__char_list_to_int_list(list(char), list(int)).
:- mode string__char_list_to_int_list(in, out) is det.
:- mode string__char_list_to_int_list(out, in) is semidet.
@@ -1571,7 +1568,7 @@
/*-----------------------------------------------------------------------*/
/*
-:- pred string__contains_char(string, character).
+:- pred string__contains_char(string, char).
:- mode string__contains_char(in, in) is semidet.
*/
:- pragma(c_code, string__contains_char(Str::in, Ch::in), "
@@ -1581,7 +1578,7 @@
/*-----------------------------------------------------------------------*/
/*
-:- pred string__index(string, int, character).
+:- pred string__index(string, int, char).
:- mode string__index(in, in, out) is semidet.
*/
:- pragma(c_code, string__index(Str::in, Index::in, Ch::out), "
@@ -1773,7 +1770,7 @@
/*-----------------------------------------------------------------------*/
/*
-:- pred string__first_char(string, character, string).
+:- pred string__first_char(string, char, string).
:- mode string__first_char(in, in, in) is semidet. % implied
:- mode string__first_char(in, out, in) is semidet. % implied
:- mode string__first_char(in, in, out) is semidet. % implied
Index: library/term_io.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/library/term_io.m,v
retrieving revision 1.46
diff -u -r1.46 term_io.m
--- term_io.m 1997/05/21 02:16:29 1.46
+++ term_io.m 1997/05/28 04:28:29
@@ -71,12 +71,12 @@
% Given an atom-name A, write A, enclosed in single-quotes if necessary,
% with characters escaped if necessary, to stdout.
-:- pred term_io__quote_char(character, io__state, io__state).
+:- pred term_io__quote_char(char, io__state, io__state).
:- mode term_io__quote_char(in, di, uo) is det.
% Given a character C, write C in single-quotes,
% escaped if necessary, to stdout.
-:- pred term_io__write_escaped_char(character, io__state, io__state).
+:- pred term_io__write_escaped_char(char, io__state, io__state).
:- mode term_io__write_escaped_char(in, di, uo) is det.
% Given a character C, write C, escaped if necessary, to stdout.
% The character is not enclosed in quotes.
@@ -90,7 +90,7 @@
% `term_io__quote_single_char' is the old (misleading) name for
% `term_io__write_escaped_char'. Use the latter instead.
:- pragma obsolete(term_io__quote_single_char/3).
-:- pred term_io__quote_single_char(character, io__state, io__state).
+:- pred term_io__quote_single_char(char, io__state, io__state).
:- mode term_io__quote_single_char(in, di, uo) is det.
%-----------------------------------------------------------------------------%
@@ -429,7 +429,7 @@
io__write_string(String)
).
-:- pred mercury_escape_char(character, string).
+:- pred mercury_escape_char(char, string).
:- mode mercury_escape_char(in, out) is det.
% Convert a character to the corresponding octal escape code.
@@ -447,7 +447,7 @@
string__pad_left(OctalString0, '0', 3, OctalString),
string__first_char(EscapeCode, '\\', OctalString).
-:- pred is_mercury_source_char(character).
+:- pred is_mercury_source_char(char).
:- mode is_mercury_source_char(in) is semidet.
% Succeed if Char is a character which is allowed in
@@ -465,7 +465,7 @@
% Currently we only allow the following characters.
% XXX should we just use is_printable(Char) instead?
-:- pred is_mercury_punctuation_char(character).
+:- pred is_mercury_punctuation_char(char).
:- mode is_mercury_punctuation_char(in) is semidet.
is_mercury_punctuation_char(' ').
@@ -509,7 +509,7 @@
% backslash-escape character EscapeChar that can be used
% after a backslash in string literals or atoms to represent Char.
-:- pred mercury_escape_special_char(character, character).
+:- pred mercury_escape_special_char(char, char).
:- mode mercury_escape_special_char(in, out) is semidet.
mercury_escape_special_char('''', '''').
--
Tyson Dowd #
# Surreal humour isn't eveyone's cup of
trd at cs.mu.oz.au # fur.
http://www.cs.mu.oz.au/~trd #
More information about the developers
mailing list