Skip to content

Commit 2ee3028

Browse files
committed
Allow comments in tag constraints
1 parent eab1947 commit 2ee3028

File tree

1 file changed

+25
-2
lines changed

1 file changed

+25
-2
lines changed

core/src/com/biglybt/core/tag/impl/TagPropertyConstraintHandler.java

+25-2
Original file line numberDiff line numberDiff line change
@@ -1585,13 +1585,36 @@ public void tagTypeAdded(TagManager manager, TagType tag_type){
15851585
return( depends_on_names_etc );
15861586
}
15871587

1588+
private String
1589+
removeComments(
1590+
String str )
1591+
{
1592+
String[] lines = str.trim().split( "\n" );
1593+
1594+
String result = "";
1595+
1596+
for ( String line: lines ){
1597+
1598+
line = line.trim();
1599+
1600+
if ( line.startsWith( "#" ) || line.startsWith( "//" )) {
1601+
1602+
}else{
1603+
1604+
result += line + "\n";
1605+
}
1606+
}
1607+
1608+
return( result.trim());
1609+
}
1610+
15881611
private ConstraintExpr
15891612
compileStart(
15901613
String str,
15911614
Map<String,ConstraintExpr> context )
15921615
{
1593-
str = str.trim();
1594-
1616+
str = removeComments( str );
1617+
15951618
if ( str.equalsIgnoreCase( "true" )){
15961619

15971620
return( new ConstraintExprTrue());

0 commit comments

Comments
 (0)