summaryrefslogtreecommitdiff
path: root/internal
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2023-01-27 13:44:43 -0700
committerLuke Shumaker <lukeshu@lukeshu.com>2023-01-30 22:00:25 -0700
commit19f9c9c972c5cfc64de08ba581cc24d96426e73c (patch)
tree6221109bbdeabc08c63cd24e02cc94c22e0dfe13 /internal
parentd5b1b73eaaa060ef468f20d8b9eed029eb60ce45 (diff)
reencode: Rethink CompactIfUnder to have linear memory
Diffstat (limited to 'internal')
-rw-r--r--internal/parse.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/internal/parse.go b/internal/parse.go
index b11aae6..9db57fb 100644
--- a/internal/parse.go
+++ b/internal/parse.go
@@ -349,6 +349,10 @@ func (par *Parser) StackIsEmpty() bool {
return len(par.stack) == 0 || (len(par.stack) == 1 && par.stack[0] == runeTypeAny)
}
+func (par *Parser) StackSize() int {
+ return len(par.stack)
+}
+
// Reset all Parser state.
func (par *Parser) Reset() {
*par = Parser{