Changeset d8bd2ec in mainline for uspace/app/bithenge/script.c


Ignore:
Timestamp:
2012-08-08T04:13:53Z (12 years ago)
Author:
Sean Bartell <wingedtachikoma@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0b60d2d, 20e95be
Parents:
a66ea217
Message:

Bithenge: add syntax for inputless transforms

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/bithenge/script.c

    ra66ea217 rd8bd2ec  
    119119        /** The number of parameters. */
    120120        int num_params;
     121        /** @a parse_expression sets this when TOKEN_IN is used. */
     122        bool in_node_used;
    121123} state_t;
    122124
     
    440442        } else if (state->token == TOKEN_IN) {
    441443                next_token(state);
     444                state->in_node_used = true;
    442445                bithenge_expression_t *expr;
    443446                rc = bithenge_in_node_expression(&expr);
     
    882885        if (state->token == '(') {
    883886                next_token(state);
     887                state->in_node_used = false;
    884888                bithenge_expression_t *expr = parse_expression(state);
    885889                expect(state, ')');
     
    890894
    891895                bithenge_transform_t *xform;
    892                 int rc = bithenge_expression_transform(&xform, expr);
     896                int rc;
     897                if (state->in_node_used)
     898                        rc = bithenge_expression_transform(&xform, expr);
     899                else
     900                        rc = bithenge_inputless_transform(&xform, expr);
    893901                if (rc != EOK) {
    894902                        error_errno(state, rc);
Note: See TracChangeset for help on using the changeset viewer.