Skip to content

Commit

Permalink
compiler: rename op_not to op_bnot, to follow MilkDrop naming
Browse files Browse the repository at this point in the history
  • Loading branch information
wpwrak committed Jan 17, 2012
1 parent 57592ac commit eb2cb6b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/compiler/parser.y
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ static struct ast_node *constant(float n)
static struct ast_node *conditional(struct ast_node *a,
struct ast_node *b, struct ast_node *c)
{
if(a->op == op_not) {
if(a->op == op_bnot) {
struct ast_node *next = a->contents.branches.a;

parse_free_one(a);
Expand Down Expand Up @@ -364,7 +364,7 @@ equal_expr(N) ::= equal_expr(A) TOK_NE rel_expr(B). {
struct ast_node *tmp;

FOLD_BINARY(tmp, op_equal, A, B, a == b);
FOLD_UNARY(N, op_not, tmp, !a);
FOLD_UNARY(N, op_bnot, tmp, !a);
}

rel_expr(N) ::= add_expr(A). {
Expand All @@ -383,14 +383,14 @@ rel_expr(N) ::= rel_expr(A) TOK_LE add_expr(B). {
struct ast_node *tmp;

FOLD_BINARY(tmp, op_above, A, B, a > b);
FOLD_UNARY(N, op_not, tmp, !a);
FOLD_UNARY(N, op_bnot, tmp, !a);
}

rel_expr(N) ::= rel_expr(A) TOK_GE add_expr(B). {
struct ast_node *tmp;

FOLD_BINARY(tmp, op_below, A, B, a < b);
FOLD_UNARY(N, op_not, tmp, !a);
FOLD_UNARY(N, op_bnot, tmp, !a);
}

add_expr(N) ::= mult_expr(A). {
Expand Down Expand Up @@ -430,7 +430,7 @@ unary_expr(N) ::= TOK_MINUS unary_expr(A). {
}

unary_expr(N) ::= TOK_NOT unary_expr(A). {
FOLD_UNARY(N, op_not, A, !a);
FOLD_UNARY(N, op_bnot, A, !a);
}


Expand Down
2 changes: 1 addition & 1 deletion src/compiler/ptest/ptest.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ static void dump_ast(const struct ast_node *ast)
case op_int:
op("int", ast);
break;
case op_not:
case op_bnot:
op("!", ast);
break;
default:
Expand Down

0 comments on commit eb2cb6b

Please sign in to comment.