]> git.tue.mpg.de Git - paraslash.git/commitdiff
mp.y: Fix some trivialities. master
authorAndre Noll <maan@tuebingen.mpg.de>
Wed, 19 Mar 2025 23:17:40 +0000 (00:17 +0100)
committerAndre Noll <maan@tuebingen.mpg.de>
Sat, 22 Mar 2025 17:59:30 +0000 (18:59 +0100)
Some lines were indented with spaces rather than tabs, and the file
contained a few stray semicolons with no effect.

yy/mp.y

diff --git a/yy/mp.y b/yy/mp.y
index 8df4f20ea04ebd2ea23b77ad77451e23e0022dbc..dc04488f7145dbbc48079cb7c7ba35ad4bf995d3 100644 (file)
--- a/yy/mp.y
+++ b/yy/mp.y
@@ -353,9 +353,9 @@ bool mp_eval_ast(struct mp_ast_node *root, struct mp_context *ctx)
 %%
 
 program:
-        /* empty */ {*ast = NULL; return 0;}
-        | string {*ast = $1; return 0;}
-        | exp {*ast = $1; return 0;}
+       /* empty */ {*ast = NULL; return 0;}
+       | string {*ast = $1; return 0;}
+       | exp {*ast = $1; return 0;}
        | boolexp {*ast = $1; return 0;}
 
 string: STRING_LITERAL {$$ = $1;}
@@ -364,15 +364,14 @@ string: STRING_LITERAL {$$ = $1;}
        | TITLE {$$ = mp_new_ast_leaf_node(TITLE);}
        | ALBUM {$$ = mp_new_ast_leaf_node(ALBUM);}
        | COMMENT {$$ = mp_new_ast_leaf_node(COMMENT);}
-;
 
 exp: NUM {$$ = $1;}
-        | exp '+' exp {$$ = ast_node_new_binary('+', $1, $3);}
-        | exp '-' exp {$$ = ast_node_new_binary('-', $1, $3);}
-        | exp '*' exp {$$ = ast_node_new_binary('*', $1, $3);}
-        | exp '/' exp {$$ = ast_node_new_binary('/', $1, $3);}
-        | '-' exp %prec NEG {$$ = ast_node_new_unary(NEG, $2);}
-        | '(' exp ')' {$$ = $2;}
+       | exp '+' exp {$$ = ast_node_new_binary('+', $1, $3);}
+       | exp '-' exp {$$ = ast_node_new_binary('-', $1, $3);}
+       | exp '*' exp {$$ = ast_node_new_binary('*', $1, $3);}
+       | exp '/' exp {$$ = ast_node_new_binary('/', $1, $3);}
+       | '-' exp %prec NEG {$$ = ast_node_new_unary(NEG, $2);}
+       | '(' exp ')' {$$ = $2;}
        | YEAR {$$ = mp_new_ast_leaf_node(YEAR);}
        | NUM_ATTRIBUTES_SET {$$ = mp_new_ast_leaf_node(NUM_ATTRIBUTES_SET);}
        | NUM_PLAYED {$$ = mp_new_ast_leaf_node(NUM_PLAYED);}
@@ -382,7 +381,6 @@ exp: NUM {$$ = $1;}
        | 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);}
        | TRUE {$$ = mp_new_ast_leaf_node(TRUE);}
@@ -409,7 +407,6 @@ boolexp: IS_SET '(' STRING_LITERAL ')' {$$ = ast_node_new_unary(IS_SET, $3);}
        }
        | string EQUAL string {$$ = ast_node_new_binary(EQUAL, $1, $3);}
        | string NOT_EQUAL string {$$ = ast_node_new_binary(NOT_EQUAL, $1, $3);}
-;
 %%
 
 /* Called by yyparse() on error */