made a start with script functions

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@62 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2006-10-31 12:17:36 +00:00
parent 0caaf01a78
commit 1ffaa5bd58
20 changed files with 372 additions and 29 deletions
+1 -1
View File
@@ -65,7 +65,7 @@ void Reader::showWarnings() {
bool Reader::enterBlock(const Char* name) {
if (just_opened) moveNext(); // on the key of the parent block, first move inside it
if (indent != expected_indent) return false; // not enough indentation
if (name == key) {
if (cannocial_name_compare(key, name)) {
just_opened = true;
expected_indent += 1; // the indent inside the block must be at least this much
return true;
+1 -1
View File
@@ -134,7 +134,7 @@ class Reader {
/** Maybe the key is "include file" */
template <typename T>
void unknownKey(T& v) {
if (key == _("include_file")) {
if (key == _("include file")) {
Reader reader(value);
reader.handle(v);
moveNext();
+1 -3
View File
@@ -35,7 +35,7 @@ void Writer::enterBlock(const Char* name) {
}
// don't write the key yet
indentation += 1;
opened_key = name;
opened_key = cannocial_name_form(name);
just_opened = true;
}
@@ -47,8 +47,6 @@ void Writer::exitBlock() {
void Writer::writeKey() {
writeIndentation();
// Use ' ' instead of '_' because it is more human readable
FOR_EACH(c, opened_key) if (c == _('_')) c = _(' ');
writeUTF8(stream, opened_key);
}
void Writer::writeIndentation() {