Spelling of canonical

This commit is contained in:
Twan van Laarhoven
2020-04-21 21:48:47 +02:00
parent 25345b86bd
commit a6cd6c2dd0
6 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -220,7 +220,7 @@ void TokenIterator::readToken() {
// name, or a number after a . token, as in array.0
size_t start = pos - 1;
while (pos < input.size() && isAlnum_(input.GetChar(pos))) ++pos;
addToken(TOK_NAME, canonical_name_form(input.substr(start, pos-start)), start); // convert name to cannocial form
addToken(TOK_NAME, canonical_name_form(input.substr(start, pos-start)), start); // convert name to canonical form
} else if (isDigit(c)) {
// number
size_t start = pos - 1;
+1 -1
View File
@@ -27,7 +27,7 @@ Variable string_to_variable(const String& s) {
if (it == variables.end()) {
#ifdef _DEBUG
variable_names.push_back(s);
assert(s == canonical_name_form(s)); // only use cannocial names
assert(s == canonical_name_form(s)); // only use canonical names
#endif
Variable v = (Variable)variables.size();
variables.insert(make_pair(s,v));
+1 -1
View File
@@ -86,7 +86,7 @@ class GetMember : private GetDefaultMember {
/// Handle an object: we are done if the name matches
template <typename T>
void handle(const Char* name, const T& object) {
if (!gdm.result() && cannocial_name_compare(target_name, name)) {
if (!gdm.result() && canonical_name_compare(target_name, name)) {
gdm.handle(object);
}
}
+1 -1
View File
@@ -96,7 +96,7 @@ bool Reader::enterAnyBlock() {
bool Reader::enterBlock(const Char* name) {
if (state == ENTERED) moveNext(); // on the key of the parent block, first move inside it
if (indent != expected_indent) return false; // not enough indentation
if (cannocial_name_compare(key, name)) {
if (canonical_name_compare(key, name)) {
state = ENTERED;
expected_indent += 1; // the indent inside the block must be at least this much
return true;
+1 -1
View File
@@ -391,7 +391,7 @@ bool is_substr_i(const String& str, size_t pos, const String& cmp) {
return is_substr_i(str, pos, static_cast<const Char*>(cmp.c_str()));
}
bool cannocial_name_compare(const String& as, const Char* b) {
bool canonical_name_compare(const String& as, const Char* b) {
const Char* a = as.c_str();
while (true) {
if (*a != *b && !(*a == _(' ') && *b == _('_'))) return false;
+1 -1
View File
@@ -210,7 +210,7 @@ bool is_substr_i(const String& str, size_t pos, const String& cmp);
size_t find_i(const String& heystack, const String& needle);
/// Compare two strings for equality, b may contain '_' where a contains ' '
bool cannocial_name_compare(const String& a, const Char* b);
bool canonical_name_compare(const String& a, const Char* b);
// ----------------------------------------------------------------------------- : Regular expressions