Squirrel Comments: Difference between revisions

From SigMod
Jump to navigation Jump to search
(Created page with "A comment is a human readable note which was inserted by a programmer to denote the what, how, or why behind code. Comments are ignored by the compiler and only serve to make the code easier to understand or use for programmers. Comments come in two flavors: single line and multi line comments. Single line comments go until they hit a new line character (\n). Multi line comments have a start and end token, anything between them is commented out. To insert a single line...")
 
No edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
<div style="width:33.333%; z-index: 1; top: 0px; position: sticky; height: 30px; display: inline-block; text-align: center; line-height: 30px; background-color:#BBBBBB;">[https://sigwiki.potato.tf/index.php/Squirrel_Variables BACK]</div><div style="width:33.333%; z-index: 1; top: 0px; position: sticky; height: 30px; display: inline-block; text-align:center; line-height: 30px; background-color:#BBBBBB;">[https://sigwiki.potato.tf/index.php/An_Introduction_to_Squirrel HOME]</div><div style="width:33.333%; z-index: 1; top: 0px; position: sticky; height: 30px; display: inline-block; text-align:center; line-height: 30px; background-color:#BBBBBB;">[https://sigwiki.potato.tf/index.php/Squirrel_Data_Types NEXT]</div>
A comment is a human readable note which was inserted by a programmer to denote the what, how, or why behind code. Comments are ignored by the compiler and only serve to make the code easier to understand or use for programmers. Comments come in two flavors: single line and multi line comments. Single line comments go until they hit a new line character (\n). Multi line comments have a start and end token, anything between them is commented out.
A comment is a human readable note which was inserted by a programmer to denote the what, how, or why behind code. Comments are ignored by the compiler and only serve to make the code easier to understand or use for programmers. Comments come in two flavors: single line and multi line comments. Single line comments go until they hit a new line character (\n). Multi line comments have a start and end token, anything between them is commented out.



Latest revision as of 03:46, 27 October 2023

BACK
HOME
NEXT

A comment is a human readable note which was inserted by a programmer to denote the what, how, or why behind code. Comments are ignored by the compiler and only serve to make the code easier to understand or use for programmers. Comments come in two flavors: single line and multi line comments. Single line comments go until they hit a new line character (\n). Multi line comments have a start and end token, anything between them is commented out.


To insert a single line comment, prefix it with // or #.

// I'm a comment that takes the whole line
local darth_variable = 404 # I'm an inline comment

To insert a multi line comment, use /* to start and */ to end.

/*I
      am
          a
      multi
  line
comment
*/
local foo = 2;

You can "nest" single line comments, but you can't do this with multi line comments

//////////////////////// okay
/* // okay */
/* /* not okay */ */

The compiler will end the multi line comment at the first end token (*/) it sees, so the second one is outside of any comments and results in a compile error.