Skip to content

Commit

Permalink
Remove postfix ++ and --
Browse files Browse the repository at this point in the history
  • Loading branch information
joeri committed Aug 16, 2009
1 parent 25e0547 commit b7a16cf
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 25 deletions.
18 changes: 0 additions & 18 deletions src/builtins/op.pir
Original file line number Diff line number Diff line change
Expand Up @@ -102,24 +102,6 @@ src/builtins/op.pir - Cardinal ops
.return ($P0)
.end


## autoincrement
.sub 'postfix:++' :multi(_)
.param pmc a
$P0 = clone a
inc a
.return ($P0)
#.return (a)
.end

.sub 'postfix:--' :multi(_)
.param pmc a
$P0 = clone a
dec a
.return ($P0)
.end


=back

=cut
Expand Down
5 changes: 3 additions & 2 deletions src/classes/Range.pir
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,8 @@ Generate the next element at the front of the CardinalRange.
.local pmc from, fromexc, value
from = getattribute self, '$!from'
fromexc = getattribute self, '$!from_exclusive'
value = 'postfix:++'(from)
value = clone from
inc from
unless fromexc goto have_value
value = clone from
have_value:
Expand All @@ -353,7 +354,7 @@ Return true if there are any more values to iterate over.
fromexc = getattribute self, '$!from_exclusive'
unless fromexc goto have_value
from = clone from
'postfix:++'(from)
inc from
have_value:
$I0 = self.'!to_test'(from)
.return ($I0)
Expand Down
5 changes: 0 additions & 5 deletions src/parser/grammar.pg
Original file line number Diff line number Diff line change
Expand Up @@ -551,11 +551,6 @@ proto 'infix:/' is equiv('infix:*') { ... }
proto 'infix:%' is equiv('infix:*')
is pirop('mod') { ... }

proto 'postfix:++' is tighter('infix:*')
is pirop('n_add') { ... }

proto 'postfix:--' is tighter('infix:*')
is pirop('n_sub') { ... }
#
#proto 'prefix:+' is tighter('infix:*') { ... }
#proto 'prefix:-' is equiv('prefix:+') { ... }
Expand Down

0 comments on commit b7a16cf

Please sign in to comment.