From 804d7841059c251020442f036b285c4bba0d378a Mon Sep 17 00:00:00 2001 From: Sei Lisa Date: Tue, 3 Jan 2017 17:12:17 +0100 Subject: [PATCH] Misc changes: - Add comment on which one is the extended switch syntax. - Note that xclip may need to be installed. - Add missing tags in a pre. --- index.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/index.html b/index.html index 13bbcf7..52510db 100644 --- a/index.html +++ b/index.html @@ -281,9 +281,9 @@ h1 { background: #2080C0; color: white; padding:25px 5% 8px; margin: 4% 7% 0px;

As an extension, and for compatibility with Firestorm, if there is a block beginning right after a case or default statement, the colon is optional. For example, all these are valid:

-
    switch (x) { case 1: ;  default: ;  }
-    switch (x) { case 1  {} default  {} }
+
    switch (x) { case 1: ;  default: ;  } // normal syntax
     switch (x) { case 1: {} default: {} }
+    switch (x) { case 1  {} default  {} } // extended syntax
 
but this will cause an error: @@ -439,15 +439,15 @@ but this will cause an error:

This program is designed to work as a filter. It can read from standard input if the file name argument is "-", and it can (and does by default) output the result to standard output. Any errors and warnings go to standard error always, to not interfere with the script being output.

-

Running it by hand to optimize your scripts can be cumbersome. The intention is for it to act as a filter that is transparent to the user; however, as of this writing there's no support for any viewer or IDE, as it has just been released. Run it without parameters to see the invocation help, for example with python main.py. Redirect the output to a file if you want to store the result, possibly to open it with an editor and copy it to the clipboard. Or under X Window, you can pipe the output directly to xclip -quiet -selection clipboard to copy it to the clipboard, rather than using a file, so you can paste it directly into the viewer. Examples:

+

Running it by hand to optimize your scripts can be cumbersome. The intention is for it to act as a filter that is transparent to the user; however, as of this writing there's no support for any viewer or IDE, as it has just been released. Run it without parameters to see the invocation help, for example with python main.py. Redirect the output to a file if you want to store the result, possibly to open it with an editor and copy it to the clipboard. Or under X Window, if you install the package xclip, you can pipe the output directly to xclip -quiet -selection clipboard to copy it to the clipboard, rather than using a file, so you can paste it directly into the viewer. Examples:

python main.py myscript.lsl | xclip -quiet -selection clipboard
 

will, under X Window, read myscript.lsl, optimize it, and copy the optimized result to the clipboard, ready to be pasted into the viewer.

-
python main.py myscript.lsl -o temp.opt
-notepad temp.opt
+
python main.py myscript.lsl -o temp.opt
+notepad temp.opt
 

will, under any system which has an editor called notepad, read myscript.lsl, optimize it, and write the optimized result to temp.opt, then open it in the editor, enabling you to copy it and paste it into the viewer. Under Windows version Vista and above, there's a command line application called clip that does the same as xclip does for X Window, enabling you to use this: