mirror of
https://github.com/Sei-Lisa/LSL-PyOptimizer
synced 2025-07-01 23:58:20 +00:00
Misc changes:
- Add comment on which one is the extended switch syntax. - Note that xclip may need to be installed. - Add missing <span> tags in a pre.
This commit is contained in:
parent
03cca23ff7
commit
804d784105
1 changed files with 5 additions and 5 deletions
10
index.html
10
index.html
|
@ -281,9 +281,9 @@ h1 { background: #2080C0; color: white; padding:25px 5% 8px; margin: 4% 7% 0px;
|
|||
|
||||
<p>As an extension, and for compatibility with Firestorm, if there is a block beginning right after a <code>case</code> or <code>default</code> statement, the colon is optional. For example, all these are valid:</p>
|
||||
|
||||
<pre><code><span> switch (x) { case 1: ; default: ; }</span>
|
||||
<span> switch (x) { case 1 {} default {} }</span>
|
||||
<pre><code><span> switch (x) { case 1: ; default: ; } // normal syntax</span>
|
||||
<span> switch (x) { case 1: {} default: {} }</span>
|
||||
<span> switch (x) { case 1 {} default {} } // extended syntax</span>
|
||||
</code></pre>
|
||||
|
||||
but this will cause an error:
|
||||
|
@ -439,15 +439,15 @@ but this will cause an error:
|
|||
|
||||
<p>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.</p>
|
||||
|
||||
<p>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 <code>python main.py</code>. 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 <em>X Window</em>, you can pipe the output directly to <code>xclip -quiet -selection clipboard</code> to copy it to the clipboard, rather than using a file, so you can paste it directly into the viewer. Examples:</p>
|
||||
<p>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 <code>python main.py</code>. 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 <em>X Window</em>, if you install the package <kbd><em>xclip</em></kbd>, you can pipe the output directly to <code>xclip -quiet -selection clipboard</code> to copy it to the clipboard, rather than using a file, so you can paste it directly into the viewer. Examples:</p>
|
||||
|
||||
<pre><code><span>python main.py myscript.lsl | xclip -quiet -selection clipboard</span>
|
||||
</code></pre>
|
||||
|
||||
<p>will, under <em>X Window</em>, read <code>myscript.lsl</code>, optimize it, and copy the optimized result to the clipboard, ready to be pasted into the viewer.</p>
|
||||
|
||||
<pre><code><span>python main.py myscript.lsl -o temp.opt
|
||||
notepad temp.opt</span>
|
||||
<pre><code><span>python main.py myscript.lsl -o temp.opt</span>
|
||||
<span>notepad temp.opt</span>
|
||||
</code></pre>
|
||||
|
||||
<p>will, under any system which has an editor called <code>notepad</code>, read <code>myscript.lsl</code>, optimize it, and write the optimized result to <code>temp.opt</code>, then open it in the editor, enabling you to copy it and paste it into the viewer. Under <em>Windows</em> version <em>Vista</em> and above, there's a command line application called <code>clip</code> that does the same as <code>xclip</code> does for <em>X Window</em>, enabling you to use this:</p>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue