private Expression parseExpression(boolean acceptLists) {
        Expression expression = acceptLists ? parseAtomList() : parseAtom();
        while (tokenizer.more()) {
            if (tokenizer.current().isSymbol("+", "-")) {
                expression = new Operation(tokenizer.consume().getTrigger(), expression, parseAtom());
            } else if (tokenizer.current().isSymbol("*", "/", "%")) {
                String operation = tokenizer.consume().getTrigger();
                Expression next = parseAtom();
                expression = joinOperations(expression, operation, next);
            } else {
                if (tokenizer.current().isSymbol() && !tokenizer.current().isSymbol("!")) {
                    break;
                }
                ValueList list = new ValueList(false);
                list.add(expression);
                list.add(acceptLists ? parseAtomList() : parseAtom());
                expression = list;
            }
        }
        return expression;
    }
private Expression parseExpression ( boolean acceptLists ) { Expression expression = acceptLists ? parseAtomList ( ) : parseAtom ( ) ; while ( tokenizer . more ( ) ) { if ( tokenizer . current ( ) . isSymbol ( "+" , "-" ) ) { expression = new Operation ( tokenizer . consume ( ) . getTrigger ( ) , expression , parseAtom ( ) ) ; } else if ( tokenizer . current ( ) . isSymbol ( "*" , "/" , "%" ) ) { String operation = tokenizer . consume ( ) . getTrigger ( ) ; Expression next = parseAtom ( ) ; expression = joinOperations ( expression , operation , next ) ; } else { if ( tokenizer . current ( ) . isSymbol ( ) && ! tokenizer . current ( ) . isSymbol ( "!" ) ) { break ; } ValueList list = new ValueList ( false ) ; list . add ( expression ) ; list . add ( acceptLists ? parseAtomList ( ) : parseAtom ( ) ) ; expression = list ; } } return expression ; }
/*
Parses an expression which can be the value of an attribute or media query. Basic numeric operations
like +,-,*,/,% are supported. Also " " separated lists will be parsed as ValueList