Skip to content

Commit adfc914

Browse files
committed
feat(analyzer): support analysis of return a,b,c
1 parent 7182a9b commit adfc914

6 files changed

Lines changed: 151 additions & 117 deletions

File tree

.idea/encodings.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/commonMain/kotlin/io/github/dingyi222666/luaparser/parser/LuaParser.kt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,8 @@ class LuaParser(
569569

570570
// funcname ::= Name {‘.’ Name} [‘:’ Name]
571571
while (true) {
572-
nameExp = when (peek()) {
572+
val next = peek()
573+
nameExp = when (next) {
573574
// '.' NAME
574575
// ':' NAME
575576
LuaTokenTypes.DOT, LuaTokenTypes.COLON -> {
@@ -579,6 +580,11 @@ class LuaParser(
579580
else -> break
580581
}
581582
parentNode = finishNode(nameExp)
583+
584+
// [':' Name]
585+
if (next === LuaTokenTypes.COLON) {
586+
break
587+
}
582588
}
583589

584590
result.identifier = nameExp

src/commonMain/kotlin/io/github/dingyi222666/luaparser/parser/ast/node/expressionNode.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,6 @@ class UnaryExpression : ExpressionNode, ASTNode() {
265265
}
266266

267267
class BinaryExpression : ExpressionNode, ASTNode() {
268-
269268
var left /*by Delegates.notNull<*/: ExpressionNode? = null
270269
var right: ExpressionNode? = null
271270
lateinit var operator: ExpressionOperator/*? = null*/

0 commit comments

Comments
 (0)