-
Notifications
You must be signed in to change notification settings - Fork 8
Operators
refractalize edited this page Nov 11, 2012
·
4 revisions
operators | precedence | associativity |
---|---|---|
/ * %
|
10 | left |
- +
|
9 | left |
<< >> >>>
|
8 | left |
> >= < <=
|
7 | left |
== !=
|
6 | left |
& |
5 | left |
^ |
4 | left |
| |
3 | left |
&& @and
|
2 | left |
|| @or
|
1 | left |
operator |
---|
! |
@not |
~ |
+ |
- |
-- |
++ |
You can write your own operators, in fact, operators are just function calls. For example:
set1 @union set2
Is the same as:
(set1) union (set2)
And unary operators are similar:
@succ n
Is the same as:
succ (n)
This even works for return
, new
, throw
:
@return @new Date
Or
@throw @new Error 'panic!'
According to the documentation, you can have Closure Compiler add the sourceMappingURL to the bottom of the script with something like this:
--output_wrapper "%output%
//# sourceMappingURL=output.js.map"
being added to your call. Not that you cannot use "\n" here, and you need a newline literal. On a Linux shell this works just fine (if you're inside of quotes when you press enter, the command doesn't get executed).