Compiler error

269 views
Skip to first unread message

Nelson Reis

unread,
Mar 12, 2012, 7:07:35 AM3/12/12
to dot...@googlegroups.com
I'm using DotLess to compile Tw Bootstrap's .less files.
When compiling the following code an error is being generated:

.spanX (@index) when (@index > 0) {
      (~".span@{index}") { .span(@index); }
      .spanX(@index - 1);
    }

The error is this:

Expected '}' but found '~'


    .spanX (@index) when (@index > 0) {
      (~".span@{index}") { .span(@index); }
------^
      .spanX(@index - 1);[Done]

Can someone help me find the problem?
Thanks.

Luke Page

unread,
Mar 12, 2012, 7:14:35 AM3/12/12
to dot...@googlegroups.com
It uses a feature released in less.js 1.3 at the weekend

That feature isn't yet in dotless, though its a 1 line change so it
should be in there soon ( I can add it once I've finished media
bubbling)

Its a bit annoying that they have decided to start using a new feature
within days of it being committed and released in less.js

Nelson Reis

unread,
Mar 12, 2012, 7:30:22 AM3/12/12
to dot...@googlegroups.com
I was trying to make this work with other tools and also had the same problem, I was starting to think that the problem was the code itself.
Now it's understandable why that happened.

Thanks a lot for the quick response, Luke, saved me a few hours.

Nick Daniels

unread,
Mar 13, 2012, 1:54:33 PM3/13/12
to dot...@googlegroups.com
Interesting...
I grabbed Bootstrap 2.0.2 from github this morning and I get stopped here:

Expected '}' on line 396 in file 'mixins.less':
[395]: .reset-filter() {
[396]:   filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
       --^
[397]: }

If I comment out this mixin, I get stopped at .spanX.
This could be because a "~" appears in the opacity mixin.

Luke Page

unread,
Mar 13, 2012, 1:59:16 PM3/13/12
to dot...@googlegroups.com

the ability to parse microsoft progid values was added to less.J's and dot less recently.. are you using the latest release?

I'm nearly finished with selector variables and I'll have a go at compiling bootstrap after that.

Nick Daniels

unread,
Mar 13, 2012, 2:29:19 PM3/13/12
to dot...@googlegroups.com
Apparently not. Thanks. Now using 1.2.4, and it stops at .spanX.
Thanks for the prompt response!

(~"") {} is an interesting construct. Very strange. But I like it.

Nick Daniels

unread,
Mar 13, 2012, 3:47:21 PM3/13/12
to dot...@googlegroups.com
Luke's latest changes (from about half an hour ago, commit: 1ec1acf969fb07263a4a6f07347ead691216d2a4 ) will enable you to build Bootstrap.
Thanks Luke!

Luke Page

unread,
Mar 13, 2012, 3:49:01 PM3/13/12
to dot...@googlegroups.com
If you build dotless from the latest source bootstrap will compile
with dotless. I just pushed my introduction for selector variables.

It actually allows any entity, as long as it is parenthesised..so

(@variable) {
}

is also accepted.

~"" means escape the quotes and @{a} is for variables in strings.

previously cloudhead had just made escaped strings allowed in
selectors, but he changed it at the last minute before releasing 1.3.0
to parenthesis and an entity.

bigchimp

unread,
Mar 28, 2012, 12:39:48 AM3/28/12
to DotLess (Less Css for .NET)
Luke - I built dotless form the latest source and am still seeing this
error.

I've tried both installing via NuGet in VS2010 and manually
referencing the .dll and adding the web.config entries. Both result
in same error.

Any suggestions?

On Mar 13, 2:49 pm, Luke Page <luke.a.p...@gmail.com> wrote:
> If you build dotless from the latest source bootstrap will compile
> with dotless. I just pushed my introduction for selector variables.
>
> It actually allows any entity, as long as it is parenthesised..so
>
> (@variable) {
>
> }
>
> is also accepted.
>
> ~"" means escape the quotes and @{a} is for variables in strings.
>
> previously cloudhead had just made escaped strings allowed in
> selectors, but he changed it at the last minute before releasing 1.3.0
> to parenthesis and an entity.
>

Luke Page

unread,
Mar 28, 2012, 2:07:23 AM3/28/12
to dot...@googlegroups.com

Exactly which bootstrap less file are you trying to compile (the root less file) and which version of bootstrap? I'll see if I can reproduce.

Reply all
Reply to author
Forward
0 new messages