Skip to content

Commit

Permalink
Add more comments to help understand the BNF
Browse files Browse the repository at this point in the history
  • Loading branch information
xsawyerx committed May 30, 2022
1 parent 5f48f18 commit 79bd3c0
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions lib/Guacamole.pm
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,23 @@ ConditionForeachPostfixExpr ::= ConditionForeach Expression
Label ::= IdentComp Colon
# this is based on the order of ops in `perldoc perlop`
# U can be LHS of shift and up
# 0 can be LHS of assignment and up
# L can be LHS of comma and up
# R can be LHS of anything
# U can be LHS of shift and up (value) << >>
# 0 can be LHS of assignment and up (value or unary) = += -= *=
# L can be LHS of comma and up (value, assign, unary) , =>
# R can be LHS of anything (value, list, assign, unary) (anything)
# There are four types of keywords:
# * Nullary (This is "OpNullaryKeywordExpr" -> Value")
# * Unary (This is "OpUnaryKeywordExpr")
# * Assign (This is "OpAssignKeywordExpr")
# * List (This is "OpListKeywordExpr")
# Hence, there are four types of expressions:
# ExprValueU: Those that are just values
# ExprValue0: Those that are values, and unary keywords
# ExprValueL: Those that are values, assignment keywords (+ goto,last,next,redo,dump), or unary keywords
# ExprValueR: Those that are values, list, assigment, or unary
ExprValueU ::= Value
ExprValue0 ::= Value | OpUnaryKeywordExpr
ExprValueL ::= Value | OpAssignKeywordExpr | OpUnaryKeywordExpr
Expand Down

0 comments on commit 79bd3c0

Please sign in to comment.