changeset 1092:a26fbde7ee28

documentation
author Franklin Schmidt <fschmidt@gmail.com>
date Sun, 08 Jan 2017 17:23:06 -0700
parents 20d5968e65cc
children a656fa45e315
files website/src/diff.html.luan website/src/manual.html.luan
diffstat 2 files changed, 13 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/website/src/diff.html.luan	Mon Jan 02 21:28:30 2017 -0700
+++ b/website/src/diff.html.luan	Sun Jan 08 17:23:06 2017 -0700
@@ -132,6 +132,8 @@
 
 <h3 heading><a name="stmt">Statements</a></h3>
 
+<p>Luan adds the block terminators <b>end_do</b>, <b>end_for</b>, <b>end_function</b>, <b>end_if</b>, and <b>end_while</b>.  These can be used to end the appropriate block type, but <b>end</b> can also be used to end any block.</p>
+
 <p>Most statements in Luan are the same as Lua.  Only those statements that differ will be listed here.</p>
 
 <h4 heading><a name="control">Control Structures</a></h4>
--- a/website/src/manual.html.luan	Mon Jan 02 21:28:30 2017 -0700
+++ b/website/src/manual.html.luan	Sun Jan 08 17:23:06 2017 -0700
@@ -534,6 +534,7 @@
 
 <pre>
      and       break     do        else      elseif    end
+     end_do    end_for   end_function        end_if    end_while
      false     for       function  goto      if        in
      local     nil       not       or        repeat    return
      then      true      until     while
@@ -785,7 +786,8 @@
 A block can be explicitly delimited to produce a single statement:
 
 <pre>
-	stat ::= <b>do</b> block <b>end</b>
+	stat ::= <b>do</b> block end_do
+	end_do ::= <b>end_do</b> | <b>end</b>
 </pre>
 
 <p>
@@ -921,9 +923,11 @@
 familiar syntax:
 
 <pre>
-	stat ::= <b>while</b> exp <b>do</b> block <b>end</b>
+	stat ::= <b>while</b> exp <b>do</b> block end_while
 	stat ::= <b>repeat</b> block <b>until</b> exp
-	stat ::= <b>if</b> exp <b>then</b> block {<b>elseif</b> exp <b>then</b> block} [<b>else</b> block] <b>end</b>
+	stat ::= <b>if</b> exp <b>then</b> block {<b>elseif</b> exp <b>then</b> block} [<b>else</b> block] end_if
+	end_while ::= <b>end_while</b> | <b>end</b>
+	end_if ::= <b>end_if</b> | <b>end</b>
 </pre>
 
 <p>
@@ -984,8 +988,9 @@
 The <b>for</b> loop has the following syntax:
 
 <pre>
-	stat ::= <b>for</b> namelist <b>in</b> exp <b>do</b> block <b>end</b>
+	stat ::= <b>for</b> namelist <b>in</b> exp <b>do</b> block end_for
 	namelist ::= Name {&lsquo;<b>,</b>&rsquo; Name}
+	end_for ::= <b>end_for</b> | <b>end</b>
 </pre>
 
 <p>
@@ -1519,7 +1524,8 @@
 
 <pre>
 	functiondef ::= <b>function</b> funcbody
-	funcbody ::= &lsquo;<b>(</b>&rsquo; [parlist] &lsquo;<b>)</b>&rsquo; block <b>end</b>
+	funcbody ::= &lsquo;<b>(</b>&rsquo; [parlist] &lsquo;<b>)</b>&rsquo; block end_function
+	end_function ::= <b>end_function</b> | <b>end</b>
 </pre>
 
 <p>