Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset c9797067 in mainline


Ignore:
Timestamp:
2012-08-09T21:18:40Z (9 years ago)
Author:
Sean Bartell <wingedtachikoma@…>
Branches:
lfn, master
Children:
0153c87
Parents:
05f5fbf
Message:

Bithenge: initial FAT script, "in" outside expression transforms, and bugfixes

Location:
uspace
Files:
1 added
3 edited

Legend:

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

    r05f5fbf rc9797067  
    196196    bithenge_scope_t *scope, bithenge_node_t **out)
    197197{
    198         for (; scope && !bithenge_scope_is_barrier(scope);
    199             scope = bithenge_scope_outer(scope)) {
     198        for (; scope; scope = bithenge_scope_outer(scope)) {
    200199                *out = bithenge_scope_in_node(scope);
    201200                if (*out)
     
    618617{
    619618        subblob_expression_t *self = expression_as_subblob(base);
     619        bithenge_expression_dec_ref(self->blob);
    620620        bithenge_expression_dec_ref(self->start);
    621621        bithenge_expression_dec_ref(self->limit);
  • uspace/app/bithenge/script.c

    r05f5fbf rc9797067  
    485485                }
    486486
     487                next_token(state);
     488
    487489                bithenge_expression_t *expr;
    488490                rc = bithenge_param_expression(&expr, i);
     
    491493                        return NULL;
    492494                }
    493 
    494                 next_token(state);
    495 
    496495                return expr;
    497496        } else if (state->token == '.') {
  • uspace/app/bithenge/transform.c

    r05f5fbf rc9797067  
    4141#include "transform.h"
    4242
     43
     44
     45/***************** transform                                 *****************/
     46
    4347/** Initialize a new transform.
    4448 * @param[out] self Transform to initialize.
     
    165169}
    166170
     171
     172
     173/***************** scope                                     *****************/
     174
    167175/** Create a transform scope. It must be dereferenced with @a
    168176 * bithenge_scope_dec_ref after it is used. Takes ownership of nothing.
     
    318326}
    319327
     328
     329
     330/***************** barrier_transform                         *****************/
     331
    320332typedef struct {
    321333        bithenge_transform_t base;
     
    344356                return rc;
    345357        bithenge_scope_set_barrier(inner_scope);
    346         rc = bithenge_transform_apply(self->transform, scope, in, out);
     358        bithenge_scope_set_in_node(inner_scope, in);
     359        rc = bithenge_transform_apply(self->transform, inner_scope, in, out);
    347360        bithenge_scope_dec_ref(inner_scope);
    348361        return rc;
     
    358371                return rc;
    359372        bithenge_scope_set_barrier(inner_scope);
    360         rc = bithenge_transform_prefix_length(self->transform, scope, in, out);
     373        bithenge_scope_set_in_node(inner_scope, bithenge_blob_as_node(in));
     374        rc = bithenge_transform_prefix_length(self->transform, inner_scope, in,
     375            out);
    361376        bithenge_scope_dec_ref(inner_scope);
    362377        return rc;
     
    373388                return rc;
    374389        bithenge_scope_set_barrier(inner_scope);
    375         rc = bithenge_transform_prefix_apply(self->transform, scope, in,
     390        bithenge_scope_set_in_node(inner_scope, bithenge_blob_as_node(in));
     391        rc = bithenge_transform_prefix_apply(self->transform, inner_scope, in,
    376392            out_node, out_length);
    377393        bithenge_scope_dec_ref(inner_scope);
Note: See TracChangeset for help on using the changeset viewer.