X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=yy%2Fmp.y;h=06d76101daf42550ea192d1c963c32d5da6635d2;hp=0f2c9cb8b256a82eeb2fac78114f6026902a24f2;hb=8d36eb43da27bef1e7bc3d626f46cb4c92ca2a41;hpb=e5de57de1b8bf1df96c152fc92f5a49f75d6d96c diff --git a/yy/mp.y b/yy/mp.y index 0f2c9cb8..06d76101 100644 --- a/yy/mp.y +++ b/yy/mp.y @@ -210,6 +210,9 @@ static int eval_node(struct mp_ast_node *node, struct mp_context *ctx, case CHANNELS: result->intval= mp_channels(ctx); return ST_INTVAL; + case DURATION: + result->intval= mp_duration(ctx); + return ST_INTVAL; /* bools */ case IS_SET: arg = node->children[0]->sv.strval; @@ -327,6 +330,7 @@ bool mp_eval_ast(struct mp_ast_node *root, struct mp_context *ctx) %token BITRATE %token FREQUENCY %token CHANNELS +%token DURATION %token FALSE TRUE /* keywords without semantic value */ @@ -377,6 +381,7 @@ exp: NUM {$$ = $1;} | BITRATE {$$ = mp_new_ast_leaf_node(BITRATE);} | FREQUENCY {$$ = mp_new_ast_leaf_node(FREQUENCY);} | CHANNELS {$$ = mp_new_ast_leaf_node(CHANNELS);} + | DURATION {$$ = mp_new_ast_leaf_node(DURATION);} ; boolexp: IS_SET '(' STRING_LITERAL ')' {$$ = ast_node_new_unary(IS_SET, $3);}