Ambiguities
Shane Brinkman-Davis Delamore edited this page Mar 29, 2018
·
3 revisions
The nature of a minimal-syntax language like CaffeineScript is there will be more ambiguities. I've attempted to keep them to a minimum. When there were ambiguities, I had to choose which one was going to be the 'correct' interpretation. Often there was only one option that made sense.
Unary operators which are also legal binary operators, e.g. -a
, must NOT have a space between them and the value they are applying to. If there is a space, they will be interpreted as a binary operator:
foo =
a
- b
# foo = a - b;
foo =
a
-b
# foo = [a, -b];
if foo
bar
baz
# if (foo(bar)) {baz;}
foo
bar
baz
# foo(bar(baz));
foo
bar
baz
# foo(bar)(baz);
# ...But I don't recommend using CaffeineScript this way.
- Home
- Get Started
- Benefits
- Highlights
- Productivity by Design
- CaffeineScript Design
- What is CaffeineScript Good For?
- Get the most out of JavaScript
- Language Comparison
- CHANGELOG
- Blocks Instead of Brackets
- Binary Line-Starts
- Everything Returns a Value
- Streamlined Modules
- Scopes and Variables
- Optional Commas
- Semantics
- Ambiguities