SomMeri / less4j

Less language is an extension of css and less4j compiles it into regular css. Less adds several dynamic features into css: variables, expressions, nested rules, and so on. Less was designed to be compatible with css and any correct css file is also correct less file.
145 stars 47 forks source link

wro4j and bootstrap 2.1.1 fails #127

Closed opensource21 closed 11 years ago

opensource21 commented 11 years ago

I tried to compile twitter bootstrap 2.1.1 with wrof4j 1.6.3 which uses 0.0.14 and get the following errors. I'm using a preprocessor: cssImport 0 ERROR Less4jProcessor - Failed to compile less. Errors are: 7 ERROR Less4jProcessor - com.github.sommeri.less4j.core.parser.AntlrException@1a25b44[delegee=MismatchedTokenException(58!=64),source=com.github.sommeri.less4j.LessSource$StringSource@7ced90be,message=mismatched input ',' expecting ')' in abstract mixin or namespace (which started at 667:1)] 7 ERROR Less4jProcessor - com.github.sommeri.less4j.core.parser.AntlrException@16b4d4a[delegee=NoViableAltException(''@[1:1: Tokens : ( COMMENT | COMMENT_LITTLE | CDO | CDC | INCLUDES | DASHMATCH | PREFIXMATCH | SUFFIXMATCH | SUBSTRINGMATCH | TILDE | GREATER | GREATER_OR_EQUAL | LOWER | LOWER_OR_EQUAL | LBRACE | RBRACE | LBRACKET | RBRACKET | OPEQ | SEMI | COLON | PERCENT | SOLIDUS | MINUS | PLUS | STAR | LPAREN | RPAREN | COMMA | HASH_SYMBOL | DOT | DOT3 | APPENDER | STRING | VALUE_ESCAPE | IDENT | UNICODE_RANGE | HASH | IMPORT_SYM | IMPORT_ONCE_SYM | IMPORT_MULTIPLE_SYM | PAGE_SYM | MEDIA_SYM | FONT_FACE_SYM | CHARSET_SYM | AT_NAME | INDIRECT_VARIABLE | INTERPOLATED_VARIABLE | IMPORTANT_SYM | NUMBER | URI | WS | NEW_LINE );]),source=com.github.sommeri.less4j.LessSource$StringSource@7ced90be,message=no viable alternative at character ''] 7 ERROR Less4jProcessor - com.github.sommeri.less4j.core.parser.AntlrException@1848630[delegee=NoViableAltException(71@[700:7: ( ( (a+= unaryOperator )? (a+= value_term | ({...}? =>a+= function ) | a+= expr_in_parentheses | a+= variablereference ) ) | (a+= unsigned_value_term | a+= hexColor | a+= escapedValue | a+= specialfunction ) )]),source=com.github.sommeri.less4j.LessSource$StringSource@7ced90be,message=no viable alternative at input '~' in expression (which started at 669:11)] 7 ERROR Less4jProcessor - com.github.sommeri.less4j.core.parser.AntlrException@f535e1[delegee=NoViableAltException(71@[()* loopback of 689:26: (b+= mathOperatorLowPrior c+= mathExprLowPrior )]),source=com.github.sommeri.less4j.LessSource$StringSource@7ced90be,message=no viable alternative at input '~' in expression (which started at 669:11)] 7 ERROR Less4jProcessor - com.github.sommeri.less4j.core.parser.AntlrException@428d73[delegee=MismatchedTokenException(92!=61),source=com.github.sommeri.less4j.LessSource$StringSource@7ced90be,message=mismatched character '\' expecting '='] 7 ERROR Less4jProcessor - com.github.sommeri.less4j.core.parser.AntlrException@b499c6[delegee=NoViableAltException(82@[() loopback of 689:26: (b+= mathOperatorLowPrior c+= mathExprLowPrior )]),source=com.github.sommeri.less4j.LessSource$StringSource@7ced90be,message=no viable alternative at input '.' in expression (which started at 669:13)] 8 ERROR Less4jProcessor - com.github.sommeri.less4j.core.parser.AntlrException@1416ba6[delegee=MissingTokenException(inserted [@-1,0:0='',<54>,669:26] at .),source=com.github.sommeri.less4j.LessSource$StringSource@7ced90be,message=missing ';' at '.' in variable declaration (which started at 669:3)] 8 ERROR Less4jProcessor - com.github.sommeri.less4j.core.parser.AntlrException@e7d42e[delegee=NoViableAltException(82@[]),source=com.github.sommeri.less4j.LessSource$StringSource@7ced90be,message=no viable alternative at input '.' in ruleset (which started at 667:39)] 8 ERROR Less4jProcessor - com.github.sommeri.less4j.core.parser.AntlrException@269c40[delegee=MismatchedTokenException(105!=78),source=com.github.sommeri.less4j.LessSource$StringSource@7ced90be,message=mismatched input '/' expecting '~''' in selectors (which started at 669:28)] 8 ERROR Less4jProcessor - com.github.sommeri.less4j.core.parser.AntlrException@143df66[delegee=NoViableAltException(''@[1:1: Tokens : ( COMMENT | COMMENT_LITTLE | CDO | CDC | INCLUDES | DASHMATCH | PREFIXMATCH | SUFFIXMATCH | SUBSTRINGMATCH | TILDE | GREATER | GREATER_OR_EQUAL | LOWER | LOWER_OR_EQUAL | LBRACE | RBRACE | LBRACKET | RBRACKET | OPEQ | SEMI | COLON | PERCENT | SOLIDUS | MINUS | PLUS | STAR | LPAREN | RPAREN | COMMA | HASH_SYMBOL | DOT | DOT3 | APPENDER | STRING | VALUE_ESCAPE | IDENT | UNICODE_RANGE | HASH | IMPORT_SYM | IMPORT_ONCE_SYM | IMPORT_MULTIPLE_SYM | PAGE_SYM | MEDIA_SYM | FONT_FACE_SYM | CHARSET_SYM | AT_NAME | INDIRECT_VARIABLE | INTERPOLATED_VARIABLE | IMPORTANT_SYM | NUMBER | URI | WS | NEW_LINE );]),source=com.github.sommeri.less4j.LessSource$StringSource@7ced90be,message=no viable alternative at character ''] 8 ERROR Less4jProcessor - com.github.sommeri.less4j.core.parser.AntlrException@1d5d722[delegee=NoViableAltException(105@[()_ loopback of 455:25: ({...}? =>a+= elementSubsequent )*]),source=com.github.sommeri.less4j.LessSource$StringSource@7ced90be,message=no viable alternative at input '/' in selectors (which started at 669:46)] 8 ERROR Less4jProcessor - com.github.sommeri.less4j.core.parser.AntlrException@1651826[delegee=NoViableAltException(53@[441:7: ( ( combinator )=>a+= combinator | )]),source=com.github.sommeri.less4j.LessSource$StringSource@7ced90be,message=no viable alternative at input '''' in selectors (which started at 669:53)] 8 ERROR Less4jProcessor - com.github.sommeri.less4j.core.parser.AntlrException@bf7b80[delegee=MissingTokenException(inserted [@-1,0:0='',<76>,670:2] at -webkit-box-shadow),source=com.github.sommeri.less4j.LessSource$StringSource@7ced90be,message=missing '{' at '-webkit-box-shadow' in ruleset (which started at 669:28)] 9 ERROR ExceptionHandlingProcessorDecorator - Failed to process the resource: ro.isdc.wro.model.resource.Resource@1000c0f[CSS,bootstrap-ppi,true] using processor: ro.isdc.wro.extensions.processor.css.Less4jProcessor@113a2cc. Reason: null

alexo commented 11 years ago

Try updating less4j to latest version 1.0.0 and post the error logs here.

opensource21 commented 11 years ago

Any suggestions how to do this with wro4j? Niels

2013/3/24 Alex Objelean notifications@github.com

Try updating less4j to latest version 1.0.0 and post the error logs here.

— Reply to this email directly or view it on GitHubhttps://github.com/SomMeri/less4j/issues/127#issuecomment-15364537 .

alexo commented 11 years ago

The wro4j-1.6.3 uses transitively an older version of less4j. In order to upgrade, just add the less4j dependency explicitly in your pom.xml with version 1.0.0.

opensource21 commented 11 years ago

This doesn't seems to work. I hacked it directly in the pom-file of wro4j in my ~/.m2-rep. However I still get

6 ERROR Less4jProcessor - com.github.sommeri.less4j.core.parser.AntlrException@13abb73[delegee=MismatchedTokenException(60!=66),source=com.github.sommeri.less4j.LessSource$StringSource@4e9491be,message=mismatched input ',' expecting ')' in abstract mixin or namespace (which started at 667:1)] 7 ERROR Less4jProcessor - com.github.sommeri.less4j.core.parser.AntlrException@121275a[delegee=NoViableAltException(''@[1:1: Tokens : ( COMMENT | COMMENT_LITTLE | CDO | CDC | INCLUDES | DASHMATCH | PREFIXMATCH | SUFFIXMATCH | SUBSTRINGMATCH | TILDE | GREATER | GREATER_OR_EQUAL | LOWER | LOWER_OR_EQUAL | LBRACE | RBRACE | LBRACKET | RBRACKET | OPEQ | SEMI | COLON | PERCENT | SOLIDUS | MINUS | PLUS | STAR | LPAREN | RPAREN | COMMA | HASH_SYMBOL | DOT | DOT3 | APPENDER | STRING | VALUE_ESCAPE | IDENT | UNICODE_RANGE | HASH | IMPORT_SYM | IMPORT_ONCE_SYM | IMPORT_MULTIPLE_SYM | PAGE_SYM | MEDIA_SYM | FONT_FACE_SYM | CHARSET_SYM | AT_NAME | INDIRECT_VARIABLE | INTERPOLATED_VARIABLE | IMPORTANT_SYM | NUMBER | URI | URL_PREFIX | DOMAIN | WS | NEW_LINE );]),source=com.github.sommeri.less4j.LessSource$StringSource@4e9491be,message=no viable alternative at character ''] 7 ERROR Less4jProcessor - com.github.sommeri.less4j.core.parser.AntlrException@159808a[delegee=NoViableAltException(73@[713:7: ( ( (a+= unaryOperator )? (a+= value_term | ({...}? =>a+= function ) | a+= expr_in_parentheses | a+= variablereference ) ) | (a+= unsigned_value_term | a+= hexColor | a+= escapedValue | a+= specialfunction ) )]),source=com.github.sommeri.less4j.LessSource$StringSource@4e9491be,message=no viable alternative at input '~' in expression (which started at 669:11)] 7 ERROR Less4jProcessor - com.github.sommeri.less4j.core.parser.AntlrException@48d887[delegee=NoViableAltException(73@[()* loopback of 702:26: (b+= mathOperatorLowPrior c+= mathExprLowPrior )]),source=com.github.sommeri.less4j.LessSource$StringSource@4e9491be,message=no viable alternative at input '~' in expression (which started at 669:11)] 7 ERROR Less4jProcessor - com.github.sommeri.less4j.core.parser.AntlrException@1277b49[delegee=MismatchedTokenException(92!=61),source=com.github.sommeri.less4j.LessSource$StringSource@4e9491be,message=mismatched character '\' expecting '='] 7 ERROR Less4jProcessor - com.github.sommeri.less4j.core.parser.AntlrException@da8d32[delegee=NoViableAltException(84@[() loopback of 702:26: (b+= mathOperatorLowPrior c+= mathExprLowPrior )]),source=com.github.sommeri.less4j.LessSource$StringSource@4e9491be,message=no viable alternative at input '.' in expression (which started at 669:13)] 7 ERROR Less4jProcessor - com.github.sommeri.less4j.core.parser.AntlrException@e724eb[delegee=MissingTokenException(inserted [@-1,0:0='',<56>,669:26] at .),source=com.github.sommeri.less4j.LessSource$StringSource@4e9491be,message=missing ';' at '.' in variable declaration (which started at 669:3)] 7 ERROR Less4jProcessor - com.github.sommeri.less4j.core.parser.AntlrException@6bd255[delegee=NoViableAltException(84@[]),source=com.github.sommeri.less4j.LessSource$StringSource@4e9491be,message=no viable alternative at input '.' in ruleset (which started at 667:39)] 7 ERROR Less4jProcessor - com.github.sommeri.less4j.core.parser.AntlrException@1bcf3ec[delegee=MismatchedTokenException(107!=80),source=com.github.sommeri.less4j.LessSource$StringSource@4e9491be,message=mismatched input '/' expecting '~''' in selectors (which started at 669:28)] 7 ERROR Less4jProcessor - com.github.sommeri.less4j.core.parser.AntlrException@dcc89a[delegee=NoViableAltException(''@[1:1: Tokens : ( COMMENT | COMMENT_LITTLE | CDO | CDC | INCLUDES | DASHMATCH | PREFIXMATCH | SUFFIXMATCH | SUBSTRINGMATCH | TILDE | GREATER | GREATER_OR_EQUAL | LOWER | LOWER_OR_EQUAL | LBRACE | RBRACE | LBRACKET | RBRACKET | OPEQ | SEMI | COLON | PERCENT | SOLIDUS | MINUS | PLUS | STAR | LPAREN | RPAREN | COMMA | HASH_SYMBOL | DOT | DOT3 | APPENDER | STRING | VALUE_ESCAPE | IDENT | UNICODE_RANGE | HASH | IMPORT_SYM | IMPORT_ONCE_SYM | IMPORT_MULTIPLE_SYM | PAGE_SYM | MEDIA_SYM | FONT_FACE_SYM | CHARSET_SYM | AT_NAME | INDIRECT_VARIABLE | INTERPOLATED_VARIABLE | IMPORTANT_SYM | NUMBER | URI | URL_PREFIX | DOMAIN | WS | NEW_LINE );]),source=com.github.sommeri.less4j.LessSource$StringSource@4e9491be,message=no viable alternative at character ''] 7 ERROR Less4jProcessor - com.github.sommeri.less4j.core.parser.AntlrException@1322b41[delegee=NoViableAltException(107@[() loopback of 468:25: ({...}? =>a+= elementSubsequent )]),source=com.github.sommeri.less4j.LessSource$StringSource@4e9491be,message=no viable alternative at input '/' in selectors (which started at 669:46)] 7 ERROR Less4jProcessor - com.github.sommeri.less4j.core.parser.AntlrException@92b535[delegee=NoViableAltException(55@[454:7: ( ( combinator )=>a+= combinator | )]),source=com.github.sommeri.less4j.LessSource$StringSource@4e9491be,message=no viable alternative at input '''' in selectors (which started at 669:53)] 7 ERROR Less4jProcessor - com.github.sommeri.less4j.core.parser.AntlrException@dca1b0[delegee=MissingTokenException(inserted [@-1,0:0='',<78>,670:2] at -webkit-box-shadow),source=com.github.sommeri.less4j.LessSource$StringSource@4e9491be,message=missing '{' at '-webkit-box-shadow' in ruleset (which started at 669:28)] 7 ERROR Less4jProcessor - com.github.sommeri.less4j.core.parser.AntlrException@1e2a543[delegee=NoViableAltException(''@[1:1: Tokens : ( COMMENT | COMMENT_LITTLE | CDO | CDC | INCLUDES | DASHMATCH | PREFIXMATCH | SUFFIXMATCH | SUBSTRINGMATCH | TILDE | GREATER | GREATER_OR_EQUAL | LOWER | LOWER_OR_EQUAL | LBRACE | RBRACE | LBRACKET | RBRACKET | OPEQ | SEMI | COLON | PERCENT | SOLIDUS | MINUS | PLUS | STAR | LPAREN | RPAREN | COMMA | HASH_SYMBOL | DOT | DOT3 | APPENDER | STRING | VALUE_ESCAPE | IDENT | UNICODE_RANGE | HASH | IMPORT_SYM | IMPORT_ONCE_SYM | IMPORT_MULTIPLE_SYM | PAGE_SYM | MEDIA_SYM | FONT_FACE_SYM | CHARSET_SYM | AT_NAME | INDIRECT_VARIABLE | INTERPOLATED_VARIABLE | IMPORTANT_SYM | NUMBER | URI | URL_PREFIX | DOMAIN | WS | NEW_LINE );]),source=com.github.sommeri.less4j.LessSource$StringSource@4e9491be,message=no viable alternative at character ''] 7 ERROR Less4jProcessor - com.github.sommeri.less4j.core.parser.AntlrException@7b5bfe[delegee=MismatchedTokenException(92!=61),source=com.github.sommeri.less4j.LessSource$StringSource@4e9491be,message=mismatched character '\' expecting '='] 8 ERROR Less4jProcessor - com.github.sommeri.less4j.core.parser.AntlrException@18524a1[delegee=NoViableAltException(''@[1:1: Tokens : ( COMMENT | COMMENT_LITTLE | CDO | CDC | INCLUDES | DASHMATCH | PREFIXMATCH | SUFFIXMATCH | SUBSTRINGMATCH | TILDE | GREATER | GREATER_OR_EQUAL | LOWER | LOWER_OR_EQUAL | LBRACE | RBRACE | LBRACKET | RBRACKET | OPEQ | SEMI | COLON | PERCENT | SOLIDUS | MINUS | PLUS | STAR | LPAREN | RPAREN | COMMA | HASH_SYMBOL | DOT | DOT3 | APPENDER | STRING | VALUE_ESCAPE | IDENT | UNICODE_RANGE | HASH | IMPORT_SYM | IMPORT_ONCE_SYM | IMPORT_MULTIPLE_SYM | PAGE_SYM | MEDIA_SYM | FONT_FACE_SYM | CHARSET_SYM | AT_NAME | INDIRECT_VARIABLE | INTERPOLATED_VARIABLE | IMPORTANT_SYM | NUMBER | URI | URL_PREFIX | DOMAIN | WS | NEW_LINE );]),source=com.github.sommeri.less4j.LessSource$StringSource@4e9491be,message=no viable alternative at character ''] 8 ERROR Less4jProcessor - com.github.sommeri.less4j.core.parser.AntlrException@1cb45bb[delegee=MismatchedTokenException(60!=66),source=com.github.sommeri.less4j.LessSource$StringSource@4e9491be,message=mismatched input ',' expecting ')' in abstract mixin or namespace (which started at 5619:1)] 8 ERROR Less4jProcessor - com.github.sommeri.less4j.core.parser.AntlrException@587f23[delegee=NoViableAltException(73@[713:7: ( ( (a+= unaryOperator )? (a+= value_term | ({...}? =>a+= function ) | a+= expr_in_parentheses | a+= variablereference ) ) | (a+= unsigned_value_term | a+= hexColor | a+= escapedValue | a+= specialfunction ) )]),source=com.github.sommeri.less4j.LessSource$StringSource@4e9491be,message=no viable alternative at input '~' in expression (which started at 5621:11)] 8 ERROR Less4jProcessor - com.github.sommeri.less4j.core.parser.AntlrException@141e366[delegee=NoViableAltException(73@[() loopback of 702:26: (b+= mathOperatorLowPrior c+= mathExprLowPrior )]),source=com.github.sommeri.less4j.LessSource$StringSource@4e9491be,message=no viable alternative at input '~' in expression (which started at 5621:11)] 8 ERROR Less4jProcessor - com.github.sommeri.less4j.core.parser.AntlrException@1a96313[delegee=NoViableAltException(84@[() loopback of 702:26: (b+= mathOperatorLowPrior c+= mathExprLowPrior )]),source=com.github.sommeri.less4j.LessSource$StringSource@4e9491be,message=no viable alternative at input '.' in expression (which started at 5621:13)] 8 ERROR Less4jProcessor - com.github.sommeri.less4j.core.parser.AntlrException@153b9[delegee=MissingTokenException(inserted [@-1,0:0='',<56>,5621:26] at .),source=com.github.sommeri.less4j.LessSource$StringSource@4e9491be,message=missing ';' at '.' in variable declaration (which started at 5621:3)] 8 ERROR Less4jProcessor - com.github.sommeri.less4j.core.parser.AntlrException@1ea7e86[delegee=NoViableAltException(84@[]),source=com.github.sommeri.less4j.LessSource$StringSource@4e9491be,message=no viable alternative at input '.' in ruleset (which started at 5619:39)] 8 ERROR Less4jProcessor - com.github.sommeri.less4j.core.parser.AntlrException@78d426[delegee=MismatchedTokenException(107!=80),source=com.github.sommeri.less4j.LessSource$StringSource@4e9491be,message=mismatched input '/' expecting '~''' in selectors (which started at 5621:28)] 8 ERROR Less4jProcessor - com.github.sommeri.less4j.core.parser.AntlrException@10fbc7e[delegee=NoViableAltException(107@[() loopback of 468:25: ({...}? =>a+= elementSubsequent )*]),source=com.github.sommeri.less4j.LessSource$StringSource@4e9491be,message=no viable alternative at input '/' in selectors (which started at 5621:46)] 8 ERROR Less4jProcessor - com.github.sommeri.less4j.core.parser.AntlrException@c6c7bd[delegee=NoViableAltException(55@[454:7: ( ( combinator )=>a+= combinator | )]),source=com.github.sommeri.less4j.LessSource$StringSource@4e9491be,message=no viable alternative at input '''' in selectors (which started at 5621:53)] 8 ERROR Less4jProcessor - com.github.sommeri.less4j.core.parser.AntlrException@1bdf301[delegee=MissingTokenException(inserted [@-1,0:0='',<78>,5622:2] at -webkit-box-shadow),source=com.github.sommeri.less4j.LessSource$StringSource@4e9491be,message=missing '{' at '-webkit-box-shadow' in ruleset (which started at 5621:28)] 9 ERROR ExceptionHandlingProcessorDecorator - Failed to process the resource: ro.isdc.wro.model.resource.Resource@6434d2[CSS,bootstrap-ppi,true] using processor: ro.isdc.wro.extensions.processor.css.Less4jProcessor@a4efff. Reason: null

alexo commented 11 years ago

I didn't expect it to fix your problem. But, at least the reported error logs reflect the latest version of less4j. Could you try to isolate the problems and show the offending less code with associated error message?

SomMeri commented 11 years ago

I tried it with both command line less4j-1.0.0 and less4j-0.0.14 and I'm getting the same errors in both cases. It starts with this:

ERROR mixins.less 251:33 mismatched input ',' expecting ')' in abstract mixin or namespace (which started at 251:1)
ERROR mixins.less 253:12 no viable alternative at character '`'
ERROR mixins.less 253:11 no viable alternative at input '~' in expression (which started at 253:11)
ERROR mixins.less 253:44 mismatched character '\' expecting '='
ERROR mixins.less 253:27 no viable alternative at input '.' in expression (which started at 253:13)
...

It is probably the same thing as what you are getting from wro4j.

opensource21 commented 11 years ago

I tried it this morning again, with the original bootstrap-file (the other contains 2 extra-less files. Again I run into trouble. If I use as preprocessor cssImport I get the follwing errors: 0 ERROR Less4jProcessor - Failed to compile less. Errors are: 7 ERROR Less4jProcessor - com.github.sommeri.less4j.core.parser.AntlrException@c71701[delegee=MismatchedTokenException(60!=66),source=com.github.sommeri.less4j.LessSource$StringSource@7ced90be,message=mismatched input ',' expecting ')' in abstract mixin or namespace (which started at 667:1)] 7 ERROR Less4jProcessor - com.github.sommeri.less4j.core.parser.AntlrException@1118a2d[delegee=NoViableAltException(''@[1:1: Tokens : ( COMMENT | COMMENT_LITTLE | CDO | CDC | INCLUDES | DASHMATCH | PREFIXMATCH | SUFFIXMATCH | SUBSTRINGMATCH | TILDE | GREATER | GREATER_OR_EQUAL | LOWER | LOWER_OR_EQUAL | LBRACE | RBRACE | LBRACKET | RBRACKET | OPEQ | SEMI | COLON | PERCENT | SOLIDUS | MINUS | PLUS | STAR | LPAREN | RPAREN | COMMA | HASH_SYMBOL | DOT | DOT3 | APPENDER | STRING | VALUE_ESCAPE | IDENT | UNICODE_RANGE | HASH | IMPORT_SYM | IMPORT_ONCE_SYM | IMPORT_MULTIPLE_SYM | PAGE_SYM | MEDIA_SYM | FONT_FACE_SYM | CHARSET_SYM | AT_NAME | INDIRECT_VARIABLE | INTERPOLATED_VARIABLE | IMPORTANT_SYM | NUMBER | URI | URL_PREFIX | DOMAIN | WS | NEW_LINE );]),source=com.github.sommeri.less4j.LessSource$StringSource@7ced90be,message=no viable alternative at character ''] 7 ERROR Less4jProcessor - com.github.sommeri.less4j.core.parser.AntlrException@84aa43[delegee=NoViableAltException(73@[713:7: ( ( (a+= unaryOperator )? (a+= value_term | ({...}? =>a+= function ) | a+= expr_in_parentheses | a+= variablereference ) ) | (a+= unsigned_value_term | a+= hexColor | a+= escapedValue | a+= specialfunction ) )]),source=com.github.sommeri.less4j.LessSource$StringSource@7ced90be,message=no viable alternative at input '~' in expression (which started at 669:11)] 7 ERROR Less4jProcessor - com.github.sommeri.less4j.core.parser.AntlrException@472af8[delegee=NoViableAltException(73@[()* loopback of 702:26: (b+= mathOperatorLowPrior c+= mathExprLowPrior )]),source=com.github.sommeri.less4j.LessSource$StringSource@7ced90be,message=no viable alternative at input '~' in expression (which started at 669:11)] 7 ERROR Less4jProcessor - com.github.sommeri.less4j.core.parser.AntlrException@1ddd735[delegee=MismatchedTokenException(92!=61),source=com.github.sommeri.less4j.LessSource$StringSource@7ced90be,message=mismatched character '\' expecting '='] 7 ERROR Less4jProcessor - com.github.sommeri.less4j.core.parser.AntlrException@330c39[delegee=NoViableAltException(84@[() loopback of 702:26: (b+= mathOperatorLowPrior c+= mathExprLowPrior )]),source=com.github.sommeri.less4j.LessSource$StringSource@7ced90be,message=no viable alternative at input '.' in expression (which started at 669:13)] 7 ERROR Less4jProcessor - com.github.sommeri.less4j.core.parser.AntlrException@56c411[delegee=MissingTokenException(inserted [@-1,0:0='',<56>,669:26] at .),source=com.github.sommeri.less4j.LessSource$StringSource@7ced90be,message=missing ';' at '.' in variable declaration (which started at 669:3)] 7 ERROR Less4jProcessor - com.github.sommeri.less4j.core.parser.AntlrException@9e63a5[delegee=NoViableAltException(84@[]),source=com.github.sommeri.less4j.LessSource$StringSource@7ced90be,message=no viable alternative at input '.' in ruleset (which started at 667:39)] 7 ERROR Less4jProcessor - com.github.sommeri.less4j.core.parser.AntlrException@16015c5[delegee=MismatchedTokenException(107!=80),source=com.github.sommeri.less4j.LessSource$StringSource@7ced90be,message=mismatched input '/' expecting '~''' in selectors (which started at 669:28)] 7 ERROR Less4jProcessor - com.github.sommeri.less4j.core.parser.AntlrException@4cd423[delegee=NoViableAltException(''@[1:1: Tokens : ( COMMENT | COMMENT_LITTLE | CDO | CDC | INCLUDES | DASHMATCH | PREFIXMATCH | SUFFIXMATCH | SUBSTRINGMATCH | TILDE | GREATER | GREATER_OR_EQUAL | LOWER | LOWER_OR_EQUAL | LBRACE | RBRACE | LBRACKET | RBRACKET | OPEQ | SEMI | COLON | PERCENT | SOLIDUS | MINUS | PLUS | STAR | LPAREN | RPAREN | COMMA | HASH_SYMBOL | DOT | DOT3 | APPENDER | STRING | VALUE_ESCAPE | IDENT | UNICODE_RANGE | HASH | IMPORT_SYM | IMPORT_ONCE_SYM | IMPORT_MULTIPLE_SYM | PAGE_SYM | MEDIA_SYM | FONT_FACE_SYM | CHARSET_SYM | AT_NAME | INDIRECT_VARIABLE | INTERPOLATED_VARIABLE | IMPORTANT_SYM | NUMBER | URI | URL_PREFIX | DOMAIN | WS | NEW_LINE );]),source=com.github.sommeri.less4j.LessSource$StringSource@7ced90be,message=no viable alternative at character ''] 8 ERROR Less4jProcessor - com.github.sommeri.less4j.core.parser.AntlrException@15e9af2[delegee=NoViableAltException(107@[()_ loopback of 468:25: ({...}? =>a+= elementSubsequent )*]),source=com.github.sommeri.less4j.LessSource$StringSource@7ced90be,message=no viable alternative at input '/' in selectors (which started at 669:46)] 8 ERROR Less4jProcessor - com.github.sommeri.less4j.core.parser.AntlrException@464932[delegee=NoViableAltException(55@[454:7: ( ( combinator )=>a+= combinator | )]),source=com.github.sommeri.less4j.LessSource$StringSource@7ced90be,message=no viable alternative at input '''' in selectors (which started at 669:53)] 8 ERROR Less4jProcessor - com.github.sommeri.less4j.core.parser.AntlrException@1afdbb8[delegee=MissingTokenException(inserted [@-1,0:0='',<78>,670:2] at -webkit-box-shadow),source=com.github.sommeri.less4j.LessSource$StringSource@7ced90be,message=missing '{' at '-webkit-box-shadow' in ruleset (which started at 669:28)] 9 ERROR ExceptionHandlingProcessorDecorator - Failed to process the resource: ro.isdc.wro.model.resource.Resource@1f0e908[CSS,bootstrap-ppi,true] using processor: ro.isdc.wro.extensions.processor.css.Less4jProcessor@1317d48. Reason: null

Unfortunately this is nearly impossible to analyse because I don't know where the file is which is the result of the preprocessor. If I don't use the proprocessor I get a less file as a result. So less4j seems to do nothing.

I updated to bootstrap 2.3.1 and there it works fine as long as I use import-css.

I hope you have now all information you need. It's a nice project because it's impressive fast.

opensource21 commented 11 years ago

Just for other people who have trouble with the plugin an try to update the version. The dependency must be added to the plugin section

                 <dependencies>
                    <dependency>
                        <groupId>com.github.sommeri</groupId>
                        <artifactId>less4j</artifactId>
                        <version>1.0.0</version>
                        <exclusions>
                            <exclusion>
                                <groupId>com.beust</groupId>
                                <artifactId>jcommander</artifactId>
                            </exclusion>
                        </exclusions>
                    </dependency>
                </dependencies>
            </plugin>

then the correct version is used.

alexo commented 11 years ago

@SomMeri could you make jcommander dependency optional by default?

SomMeri commented 11 years ago

@alexo I think so, non-command line does not use it. I will do that for the next version.

SomMeri commented 11 years ago

@opensource21 Would it be possible to use Twitter Bootstrap v2.2.0 for you? It is one version up over v2.1.1 and was released two months after it. List of changes between those two versions is here: https://github.com/twitter/bootstrap/issues?milestone=5&state=closed . I do not know whether they are important or not.

Twitter Bootstrap v2.2.0 compiles with deprecated syntax warning only, but I did not tested it beyond compiling. The commit that made it work: https://github.com/twitter/bootstrap/commit/38303dd9975a8f1bca89b9f0f8ef06a26dd3f1e0

Alternative solution: the above commit removes both issues that are causing your problem. So, if you have to use v2.1.1, you can patch it with the above commit only.

SomMeri commented 11 years ago

Technical details: the problem is caused by mixin declared in mixins.less file, line 251:

.box-shadow(@shadowA, @shadowB:X, ...){
  // Multiple shadow solution from http://toekneestuck.com/blog/2012/05/15/less-css-arguments-variable/
  @props: ~`"@{arguments}".replace(/[\[\]]|\,\sX/g, '')`;
  -webkit-box-shadow: @props;
   -moz-box-shadow: @props;
   box-shadow: @props;
}
opensource21 commented 11 years ago

Switched to 2.3.1, so it's fine to me. How ever it's good that you work on all that issues. From my point of view you can close the issue.

SomMeri commented 11 years ago

Thank you for reporting the issue. Mixins arguments bug is fixed and jCommander dependency is now optional. I will try to release new fixed version 1.0.1 today.

JavaScript evaluation is still open. Less.js is trying to discourage JavaScript in .less files as much as possible, so it is not priority right now. It's priority will go up if someone votes for that issue. If you need it, let me know.

Closing the issue, since the only remaining problem is tracked elsewhere.