X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=yy%2Fmp.y;h=06d76101daf42550ea192d1c963c32d5da6635d2;hb=6663ff04ae902bdea92b35b3b8dbdccd459d9099;hp=82ef51402fd5da80b523a8d395cea709fb8ffbd8;hpb=3d3a2f50a05501cf27f1155629799953f952bd4b;p=paraslash.git diff --git a/yy/mp.y b/yy/mp.y index 82ef5140..06d76101 100644 --- a/yy/mp.y +++ b/yy/mp.y @@ -1,8 +1,4 @@ -/* - * Copyright (C) 2017 Andre Noll - * - * Licensed under the GPL v2. For licencing details see COPYING. - */ +/* Copyright (C) 2017 Andre Noll , see file COPYING. */ /* * Provide more verbose and specific error messages instead of just "syntax @@ -214,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; @@ -331,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 */ @@ -381,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);}