parsing bug fix
This commit is contained in:
+12
-3
@@ -906,13 +906,16 @@ static Node *parse_map_primary_expression(Context *ctx)
|
|||||||
|
|
||||||
if(done(ctx))
|
if(done(ctx))
|
||||||
{
|
{
|
||||||
Error_Report(ctx->error, 0, "Source ended where a map literal was expected");
|
Error_Report(ctx->error, 0,
|
||||||
|
"Source ended where a map literal was expected");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(current(ctx) != '{')
|
if(current(ctx) != '{')
|
||||||
{
|
{
|
||||||
Error_Report(ctx->error, 0, "Got token \"%.*s\" where a map literal was expected", ctx->token->length, ctx->src + ctx->token->offset);
|
Error_Report(ctx->error, 0,
|
||||||
|
"Got token \"%.*s\" where a map literal was expected",
|
||||||
|
ctx->token->length, ctx->src + ctx->token->offset);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -922,7 +925,13 @@ static Node *parse_map_primary_expression(Context *ctx)
|
|||||||
Node *items = NULL;
|
Node *items = NULL;
|
||||||
int itemc = 0;
|
int itemc = 0;
|
||||||
|
|
||||||
next(ctx); // Skip the '['.
|
next(ctx); // Skip the '{'.
|
||||||
|
|
||||||
|
if(done(ctx))
|
||||||
|
{
|
||||||
|
Error_Report(ctx->error, 0, "Source ended where a map child item's key was expected");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if(current(ctx) != '}')
|
if(current(ctx) != '}')
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user