Skip to content

Commit

Permalink
remove excess ss = save()
Browse files Browse the repository at this point in the history
  • Loading branch information
funny-falcon committed Aug 13, 2023
1 parent b7cc198 commit 43f8d84
Show file tree
Hide file tree
Showing 7 changed files with 238 additions and 240 deletions.
16 changes: 8 additions & 8 deletions examples/calculator/calculator.kpeg.rb
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ def _term

begin # choice

_save1 = self.pos
_save = self.pos
begin # sequence
_tmp = apply(:_term)
t1 = @result
Expand All @@ -478,12 +478,12 @@ def _term
_tmp = true
end while false
unless _tmp
self.pos = _save1
self.pos = _save
end # end sequence

break if _tmp

_save2 = self.pos
_save1 = self.pos
begin # sequence
_tmp = apply(:_term)
t1 = @result
Expand All @@ -501,7 +501,7 @@ def _term
_tmp = true
end while false
unless _tmp
self.pos = _save2
self.pos = _save1
end # end sequence

break if _tmp
Expand All @@ -517,7 +517,7 @@ def _fact

begin # choice

_save1 = self.pos
_save = self.pos
begin # sequence
_tmp = apply(:_fact)
f1 = @result
Expand All @@ -535,12 +535,12 @@ def _fact
_tmp = true
end while false
unless _tmp
self.pos = _save1
self.pos = _save
end # end sequence

break if _tmp

_save2 = self.pos
_save1 = self.pos
begin # sequence
_tmp = apply(:_fact)
f1 = @result
Expand All @@ -558,7 +558,7 @@ def _fact
_tmp = true
end while false
unless _tmp
self.pos = _save2
self.pos = _save1
end # end sequence

break if _tmp
Expand Down
8 changes: 4 additions & 4 deletions examples/phone_number/phone_number.kpeg.rb
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ def _root

begin # choice

_save1 = self.pos
_save = self.pos
begin # sequence
_tmp = apply(:_phone_number)
pn = @result
Expand All @@ -646,12 +646,12 @@ def _root
_tmp = true
end while false
unless _tmp
self.pos = _save1
self.pos = _save
end # end sequence

break if _tmp

_save2 = self.pos
_save1 = self.pos
begin # sequence
_tmp = apply(:_country_code)
c = @result
Expand All @@ -669,7 +669,7 @@ def _root
_tmp = true
end while false
unless _tmp
self.pos = _save2
self.pos = _save1
end # end sequence

end while false # end choice
Expand Down

0 comments on commit 43f8d84

Please sign in to comment.