File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed
Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,21 @@ homepage are located at <http://moonscript.org>.
1818
1919# The Language
2020
21+ ## Whitespace
22+
23+ MoonScript is a whitespace sensitive language. This means that
24+ instead of using ` do ` and ` end ` (or ` { ` and ` } ` ) to delimit sections of code we
25+ use line-breaks and indentation.
26+
27+ This means that how you indent you code is important. Luckily MoonScript
28+ doesn't care how you do it but it's important to be consistent.
29+
30+ An indent must be at least 1 space or 1 tab, but you can use as many as you
31+ like. All the code snippets on this page will use two spaces.
32+
33+ > Should you happen to mix tabs and spaces, a tab is equivalent to 4 spaces. I
34+ > shouldn't be telling you this though because you should never do it.
35+
2136## Assignment
2237
2338Assigning to an undeclared name will cause it to be declared as a new local
@@ -598,7 +613,7 @@ A `continue` statement can be used to skip the current iteration in a loop.
598613``` moon
599614i = 0
600615while i < 10
601- continue if i % 2 ==0
616+ continue if i % 2 == 0
602617 print i
603618```
604619` continue ` can also be used with loop expressions to prevent that iteration
@@ -1689,7 +1704,7 @@ A full list of flags can be seen by passing the `-h` or `--help` flag.
16891704
16901705# License (MIT)
16911706
1692- Copyright (C) 2011 by Leaf Corcoran
1707+ Copyright (C) 2013 by Leaf Corcoran
16931708
16941709 Permission is hereby granted, free of charge, to any person obtaining a copy
16951710 of this software and associated documentation files (the "Software"), to deal
You can’t perform that action at this time.
0 commit comments