Rename to_upper to upper and to_lower to lower
This commit is contained in:
@@ -105,8 +105,8 @@ extend_var_list_([V|Vs], N, VarList, NewVarList, VarType) :-
|
|||||||
% - `symbolic_control`
|
% - `symbolic_control`
|
||||||
% - `symbolic_hexadecimal`
|
% - `symbolic_hexadecimal`
|
||||||
% - `upper`
|
% - `upper`
|
||||||
% - `to_lower(Lower)`
|
% - `lower(Lower)`
|
||||||
% - `to_upper(Upper)`
|
% - `upper(Upper)`
|
||||||
% - `whitespace`
|
% - `whitespace`
|
||||||
%
|
%
|
||||||
% An example:
|
% An example:
|
||||||
@@ -124,8 +124,8 @@ extend_var_list_([V|Vs], N, VarList, NewVarList, VarType) :-
|
|||||||
% ; Type = octet
|
% ; Type = octet
|
||||||
% ; Type = prolog
|
% ; Type = prolog
|
||||||
% ; Type = symbolic_control
|
% ; Type = symbolic_control
|
||||||
% ; Type = to_lower("a")
|
% ; Type = lower("a")
|
||||||
% ; Type = to_upper("A")
|
% ; Type = upper("A")
|
||||||
% ; false.
|
% ; false.
|
||||||
% ```
|
% ```
|
||||||
%
|
%
|
||||||
@@ -168,8 +168,8 @@ ctype(sign).
|
|||||||
ctype(solo).
|
ctype(solo).
|
||||||
ctype(symbolic_control).
|
ctype(symbolic_control).
|
||||||
ctype(symbolic_hexadecimal).
|
ctype(symbolic_hexadecimal).
|
||||||
ctype(to_lower(_)).
|
ctype(lower(_)).
|
||||||
ctype(to_upper(_)).
|
ctype(upper(_)).
|
||||||
ctype(upper).
|
ctype(upper).
|
||||||
ctype(whitespace).
|
ctype(whitespace).
|
||||||
|
|
||||||
|
|||||||
@@ -2997,13 +2997,13 @@ impl Machine {
|
|||||||
.get_name_and_arity();
|
.get_name_and_arity();
|
||||||
|
|
||||||
match (name, arity) {
|
match (name, arity) {
|
||||||
(atom!("to_upper"), 1) => {
|
(atom!("upper"), 1) => {
|
||||||
let reg = self.machine_st.deref(self.machine_st.heap[s+1]);
|
let reg = self.machine_st.deref(self.machine_st.heap[s+1]);
|
||||||
let atom = AtomTable::build_with(&self.machine_st.atom_tbl, &c.to_uppercase().to_string());
|
let atom = AtomTable::build_with(&self.machine_st.atom_tbl, &c.to_uppercase().to_string());
|
||||||
let upper_str = string_as_cstr_cell!(atom);
|
let upper_str = string_as_cstr_cell!(atom);
|
||||||
unify!(self.machine_st, reg, upper_str);
|
unify!(self.machine_st, reg, upper_str);
|
||||||
}
|
}
|
||||||
(atom!("to_lower"), 1) => {
|
(atom!("lower"), 1) => {
|
||||||
let reg = self.machine_st.deref(self.machine_st.heap[s+1]);
|
let reg = self.machine_st.deref(self.machine_st.heap[s+1]);
|
||||||
let atom = AtomTable::build_with(&self.machine_st.atom_tbl, &c.to_lowercase().to_string());
|
let atom = AtomTable::build_with(&self.machine_st.atom_tbl, &c.to_lowercase().to_string());
|
||||||
let lower_str = string_as_cstr_cell!(atom);
|
let lower_str = string_as_cstr_cell!(atom);
|
||||||
|
|||||||
Reference in New Issue
Block a user