File tree 1 file changed +14
-13
lines changed
1 file changed +14
-13
lines changed Original file line number Diff line number Diff line change @@ -2351,7 +2351,16 @@ local function parseFunction(isLocal, isAction)
2351
2351
return func
2352
2352
end
2353
2353
2354
- local function pushErrorNeedParen (source )
2354
+ local function checkNeedParen (source )
2355
+ local token = Tokens [Index + 1 ]
2356
+ if token ~= ' .'
2357
+ and token ~= ' :' then
2358
+ return source
2359
+ end
2360
+ local exp = parseSimple (source , false )
2361
+ if exp == source then
2362
+ return exp
2363
+ end
2355
2364
pushError {
2356
2365
type = ' NEED_PAREN' ,
2357
2366
start = source .start ,
@@ -2370,6 +2379,7 @@ local function pushErrorNeedParen(source)
2370
2379
}
2371
2380
}
2372
2381
}
2382
+ return exp
2373
2383
end
2374
2384
2375
2385
local function parseExpUnit ()
@@ -2389,10 +2399,7 @@ local function parseExpUnit()
2389
2399
if not table then
2390
2400
return nil
2391
2401
end
2392
- local exp = parseSimple (table , false )
2393
- if exp ~= table then
2394
- pushErrorNeedParen (table )
2395
- end
2402
+ local exp = checkNeedParen (table )
2396
2403
return exp
2397
2404
end
2398
2405
@@ -2401,10 +2408,7 @@ local function parseExpUnit()
2401
2408
if not string then
2402
2409
return nil
2403
2410
end
2404
- local exp = parseSimple (string , false )
2405
- if exp ~= string then
2406
- pushErrorNeedParen (string )
2407
- end
2411
+ local exp = checkNeedParen (string )
2408
2412
return exp
2409
2413
end
2410
2414
@@ -2413,10 +2417,7 @@ local function parseExpUnit()
2413
2417
if not string then
2414
2418
return nil
2415
2419
end
2416
- local exp = parseSimple (string , false )
2417
- if exp ~= string then
2418
- pushErrorNeedParen (string )
2419
- end
2420
+ local exp = checkNeedParen (string )
2420
2421
return exp
2421
2422
end
2422
2423
You can’t perform that action at this time.
0 commit comments