aboutsummaryrefslogtreecommitdiff
path: root/example/math_expression
diff options
context:
space:
mode:
authorAlexander Kiryukhin <a.kiryukhin@mail.ru>2022-02-02 21:19:32 +0300
committerAlexander Kiryukhin <a.kiryukhin@mail.ru>2022-02-02 21:19:32 +0300
commitd8d462d3f91e85323ebe478b01fc4bdaae17afe9 (patch)
treed686759807430a31f78f2b4d614eba32218066c6 /example/math_expression
parentff198abd8fc9e2019c2f3ef9b7e74206ecdb99b7 (diff)
Return true on AcceptWhile and AcceptWhileNot functionsv0.0.3
Diffstat (limited to 'example/math_expression')
-rw-r--r--example/math_expression/stack.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/example/math_expression/stack.go b/example/math_expression/stack.go
index b6c37b9..eebd476 100644
--- a/example/math_expression/stack.go
+++ b/example/math_expression/stack.go
@@ -1,3 +1,4 @@
+//go:build example
// +build example
package main
@@ -10,7 +11,7 @@ type lexemStack []unilex.Lexem
func (ls *lexemStack) Head() (l unilex.Lexem) {
if len(*ls) == 0 {
- return unilex.Lexem{Type: unilex.LEOF}
+ return unilex.Lexem{Type: unilex.LexEOF}
}
return (*ls)[len(*ls)-1]
}
@@ -21,7 +22,7 @@ func (ls *lexemStack) Push(l unilex.Lexem) {
func (ls *lexemStack) Pop() (l unilex.Lexem) {
if len(*ls) == 0 {
- return unilex.Lexem{Type: unilex.LEOF}
+ return unilex.Lexem{Type: unilex.LexEOF}
}
*ls, l = (*ls)[:len(*ls)-1], (*ls)[len(*ls)-1]
return l