Skip to content

Commit

Permalink
imp: 嵌套结构性能优化
Browse files Browse the repository at this point in the history
  • Loading branch information
fy0 committed Jun 6, 2024
1 parent 536ad49 commit a7eb678
Show file tree
Hide file tree
Showing 2 changed files with 563 additions and 513 deletions.
5 changes: 4 additions & 1 deletion roll.peg
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,9 @@ stmtAssign <- &stmtAssignType1 stmtAssignType1
/ &stmtAssignType6 stmtAssignType6
/ &stmtAssignType7 stmtAssignType7

exprRoot <- exprSlice sp
// exprRoot <- exprSlice sp
nestedBoost <- &(subX sp [-+*/dDcCaA&]) exprSlice / &subX subX
exprRoot <- (nestedBoost / exprSlice) sp

_step <- (':' sp (exprRoot / sp { c.data.PushNull() }) / sp { c.data.PushNull() })
_sliceSuffix <- '[' sp (exprRoot / sp { c.data.PushNull() }) ':' sp (exprRoot / sp { c.data.PushNull() }) _step ']' sp
Expand Down Expand Up @@ -363,6 +365,7 @@ xidContinue <- [$\p{L}\p{Other_ID_Start}\p{Nl}\p{Mn}\p{Mc}\p{Nd}\p{Pc}\p{Other_I

// 括号
sub <- parenOpen exprRoot parenClose
subX <- sub item_get attr_get
parenOpen <- '(' sp
parenClose <- ')' sp

Expand Down
Loading

0 comments on commit a7eb678

Please sign in to comment.