mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-12 05:36:59 -04:00
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:
@@ -96,7 +96,7 @@ class TokenIterator {
|
|||||||
String input;
|
String input;
|
||||||
size_t pos;
|
size_t pos;
|
||||||
String filename;
|
String filename;
|
||||||
Package* package;
|
Packaged* package;
|
||||||
};
|
};
|
||||||
stack<MoreInput> more; ///< Read tokens from here when we are done with the current input
|
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;
|
input = more.top().input;
|
||||||
pos = more.top().pos;
|
pos = more.top().pos;
|
||||||
filename = more.top().filename;
|
filename = more.top().filename;
|
||||||
|
package = more.top().package;
|
||||||
more.pop();
|
more.pop();
|
||||||
} else {
|
} else {
|
||||||
// EOF
|
// EOF
|
||||||
@@ -205,7 +206,7 @@ void TokenIterator::readToken() {
|
|||||||
InputStreamP is = package_manager.openFileFromPackage(package, include_file);
|
InputStreamP is = package_manager.openFileFromPackage(package, include_file);
|
||||||
input = read_utf8_line(*is, true, true);
|
input = read_utf8_line(*is, true, true);
|
||||||
} else if (isAlpha(c) || c == _('_') || (isDigit(c) && !buffer.empty() && buffer.back() == _("."))) {
|
} 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;
|
size_t start = pos - 1;
|
||||||
while (pos < input.size() && isAlnum_(input.GetChar(pos))) ++pos;
|
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
|
addToken(TOK_NAME, cannocial_name_form(input.substr(start, pos-start)), start); // convert name to cannocial form
|
||||||
|
|||||||
Reference in New Issue
Block a user