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
This commit is contained in:
twanvl
2008-12-11 15:24:48 +00:00
parent fee35c2804
commit d4e9476759
+3 -2
View File
@@ -96,7 +96,7 @@ class TokenIterator {
String input;
size_t pos;
String filename;
Package* package;
Packaged* package;
};
stack<MoreInput> 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