diff --git a/src/SMARTPL.g b/src/SMARTPL.g index d5e4fc21..35ec51e5 100644 --- a/src/SMARTPL.g +++ b/src/SMARTPL.g @@ -37,6 +37,7 @@ ordertag : STRTAG | INTTAG | DATETAG | ENUMTAG + | RANDOMTAG | (XXX)? NeverUsedRule ; @@ -117,6 +118,9 @@ GROUPTAG : 'track_count' | 'album_count' ; +RANDOMTAG : 'random' + ; + INCLUDES : 'includes' ; diff --git a/src/SMARTPL2SQL.g b/src/SMARTPL2SQL.g index b2c151b1..b6f66815 100644 --- a/src/SMARTPL2SQL.g +++ b/src/SMARTPL2SQL.g @@ -345,6 +345,11 @@ ordertag returns [ pANTLR3_STRING result ] $result->append8($result, "f."); $result->appendS($result, $ENUMTAG.text->toUTF8($ENUMTAG.text)); } + | RANDOMTAG + { + $result = $RANDOMTAG.text->factory->newRaw($RANDOMTAG.text->factory); + $result->append8($result, "random()"); + } ; dateval returns [ pANTLR3_STRING result ]