Skip to content

Commit c6345a8

Browse files
committed
Added postfix ! and !! operators
1 parent a8ee639 commit c6345a8

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

Changelog.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
Version 6.6.0
22
- Added pc_key and pc_mouse to -gbrk
3+
- Added missing !! and ! postfix operators for Spin2
34
- Implemented proper boolean type for C
45
- Fixed -- operator for floats
56
- Made the BASIC boolean type a distinct type

frontends/spin/spin.y

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1618,6 +1618,16 @@ expr:
16181618
{ $$ = NewAST(AST_POSTSET, $1, AstInteger(0)); }
16191619
| lhs SP_DOUBLETILDE
16201620
{ $$ = NewAST(AST_POSTSET, $1, AstInteger(-1)); }
1621+
| lhs SP_NOT
1622+
{
1623+
AST *lhs = $1;
1624+
$$ = NewAST(AST_POSTSET, lhs, AstOperator(K_BOOL_NOT, NULL, DupAST(lhs)));
1625+
}
1626+
| lhs '!'
1627+
{
1628+
AST *lhs = $1;
1629+
$$ = NewAST(AST_POSTSET, lhs, AstOperator(K_BIT_NOT, NULL, DupAST(lhs)));
1630+
}
16211631
| '~' lhs
16221632
{ AST *shf;
16231633
AST *val = $2;

0 commit comments

Comments
 (0)