From d4e9476759175873b9530242e5d03ec5ccd6e50f Mon Sep 17 00:00:00 2001 From: twanvl Date: Thu, 11 Dec 2008 15:24:48 +0000 Subject: [PATCH] fixed: "include file" did not reset the parent package, so this didn't work: script: include file: /other-package/stuff include file: something-from-this-package git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1242 0fc631ac-6414-0410-93d0-97cfa31319b6 --- src/script/parser.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/script/parser.cpp b/src/script/parser.cpp index 598e5d13..4da35d9f 100644 --- a/src/script/parser.cpp +++ b/src/script/parser.cpp @@ -96,7 +96,7 @@ class TokenIterator { String input; size_t pos; String filename; - Package* package; + Packaged* package; }; stack more; ///< Read tokens from here when we are done with the current input @@ -175,6 +175,7 @@ void TokenIterator::readToken() { input = more.top().input; pos = more.top().pos; filename = more.top().filename; + package = more.top().package; more.pop(); } else { // EOF @@ -205,7 +206,7 @@ void TokenIterator::readToken() { InputStreamP is = package_manager.openFileFromPackage(package, include_file); input = read_utf8_line(*is, true, true); } else if (isAlpha(c) || c == _('_') || (isDigit(c) && !buffer.empty() && buffer.back() == _("."))) { - // name + // 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, cannocial_name_form(input.substr(start, pos-start)), start); // convert name to cannocial form