diff --git a/src/script/parser.cpp b/src/script/parser.cpp index 2e9be580..e5c1696d 100644 --- a/src/script/parser.cpp +++ b/src/script/parser.cpp @@ -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; diff --git a/src/script/script.cpp b/src/script/script.cpp index 3072e264..907800c7 100644 --- a/src/script/script.cpp +++ b/src/script/script.cpp @@ -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)); diff --git a/src/util/io/get_member.hpp b/src/util/io/get_member.hpp index 1f94814b..5bda2f2e 100644 --- a/src/util/io/get_member.hpp +++ b/src/util/io/get_member.hpp @@ -86,7 +86,7 @@ class GetMember : private GetDefaultMember { /// Handle an object: we are done if the name matches template 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); } } diff --git a/src/util/io/reader.cpp b/src/util/io/reader.cpp index 04fbd9d3..745e0023 100644 --- a/src/util/io/reader.cpp +++ b/src/util/io/reader.cpp @@ -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; diff --git a/src/util/string.cpp b/src/util/string.cpp index a7e17015..cc6694c9 100644 --- a/src/util/string.cpp +++ b/src/util/string.cpp @@ -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(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; diff --git a/src/util/string.hpp b/src/util/string.hpp index 771f87a3..039f044b 100644 --- a/src/util/string.hpp +++ b/src/util/string.hpp @@ -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