Skip to content

Commit d03ac13

Browse files
committed
docs
1 parent b7c0baf commit d03ac13

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/main/java/org/perlonjava/parser/Parser.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,8 @@ private Node parseForStatement() {
447447
*/
448448
private Node parseSubroutineCall() {
449449
// Parse the subroutine name as a complex identifier
450+
// Alternately, this could be a v-string like v10.20.30 XXX TODO
451+
450452
String subName = parseSubroutineIdentifier();
451453
ctx.logDebug("SubroutineCall subName `" + subName + "` package " + ctx.symbolTable.getCurrentPackage());
452454
if (subName == null) {
@@ -527,6 +529,10 @@ private Node parseIfStatement() {
527529
* Parses an expression based on operator precedence.
528530
* <p>
529531
* Higher precedence means tighter: `*` has higher precedence than `+`
532+
* <p>
533+
* Explanation of the <a href="https://en.wikipedia.org/wiki/Operator-precedence_parser">precedence climbing method</a>
534+
* can be found in Wikipedia.
535+
* </p>
530536
*
531537
* @param precedence The precedence level of the current expression.
532538
* @return The root node of the parsed expression.
@@ -656,7 +662,7 @@ private Node parsePrimary() {
656662
}
657663
return new OperatorNode("eval", operand, tokenIndex);
658664
case "do":
659-
// Handle 'do' keyword which can be followed by a block
665+
// Handle 'do' keyword which can be followed by a block or filename
660666
token = peek();
661667
if (token.type == LexerTokenType.OPERATOR && token.text.equals("{")) {
662668
consume(LexerTokenType.OPERATOR, "{");
@@ -679,7 +685,7 @@ private Node parsePrimary() {
679685
// Handle special-quoted domain-specific arguments
680686
return parseRawString(token.text);
681687
default:
682-
// Handle any other identifier as an identifier node
688+
// Handle any other identifier as a subroutine call or identifier node
683689
tokenIndex = startIndex; // re-parse
684690
return parseSubroutineCall();
685691
}

0 commit comments

Comments
 (0)