Add support for comma-separated imports

This commit is contained in:
K. Lange 2021-01-21 11:09:20 +09:00
parent 7497994100
commit b872410b95

View File

@ -1551,6 +1551,7 @@ static size_t importModule(KrkToken * startOfName) {
} }
static void importStatement() { static void importStatement() {
do {
KrkToken firstName = parser.current; KrkToken firstName = parser.current;
KrkToken startOfName; KrkToken startOfName;
size_t ind = importModule(&startOfName); size_t ind = importModule(&startOfName);
@ -1572,6 +1573,7 @@ static void importStatement() {
} }
declareVariable(); declareVariable();
defineVariable(ind); defineVariable(ind);
} while (match(TOKEN_COMMA));
} }
static void fromImportStatement() { static void fromImportStatement() {