Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,5 @@
---
category:
- Initialization
from: http://rosettacode.org/wiki/Comments
note: Basic language learning

15
Task/Comments/00-TASK.txt Normal file
View file

@ -0,0 +1,15 @@
;Task:
Show all ways to include text in a language source file
that's completely ignored by the compiler or interpreter.
;Related tasks:
*   [[Documentation]]
*   [[Here_document]]
;See also:
*   [https://en.wikipedia.org/wiki/Comment_(computer_programming) Wikipedia]
* &nbsp; [http://xkcd.com/156 xkcd] (Humor: hand gesture denoting <code>//</code> for "commenting out" people.)
<br><br>

View file

@ -0,0 +1,15 @@
// Single line comment
\\ Also single line comment (continuation of the comment in previous line)
\[ This is
a multi line
comment ]
\{ And
this }
\( And
this )
\ And
this

View file

@ -0,0 +1,6 @@
* An asterisk in column one denotes a comment line
* Comments may also follow any syntactically complete instruction:
LA 1,0 Comment
NOP Comment (after a NOP instruction)
* Comments after instructions with omitted operands require a comma ","
END , Comment (without comma, "Comment" assumed an operand of "END")

View file

@ -0,0 +1,2 @@
`Comments in 4th Dimension begin with the accent character and extend to the end of the line (until 4D version 2004).
// This is a comment starting from 4D v11 and newer. Accent character is replaced by //

View file

@ -0,0 +1 @@
nop ; comments begin with a semicolon

View file

@ -0,0 +1 @@
MOVEM.L D0-D7/A0-A6,-(SP) ;push all registers onto the stack

View file

@ -0,0 +1,2 @@
MOV AX, 4C00h ; go back to DOS
INT 21h ; BIOS interrupt 21 base 16

View file

@ -0,0 +1,7 @@
/* ARM assembly AARCH64 Raspberry PI 3B */
/* comments multi lines
end comments
*/
// comment end of ligne

View file

@ -0,0 +1,3 @@
; Single line comment
#| Multi-line
comment |#

View file

@ -0,0 +1,4 @@
'COMMENT' this is a first comment;
'COMMENT'
****** this is a second comment ******
;

View file

@ -0,0 +1,11 @@
begin
comment - This form is borrowed from ALGOL 60;
% And this is borrowed from ALGOL W %
% ALGOL-M will not compile an "empty" program, so we have %
% to include at least one code-generating statement! %
write("This is only an exercise");
end

View file

@ -0,0 +1,8 @@
begin
comment a comment;
% another comment
;
% and
another
%
end this_word_is_also_a_comment.

View file

@ -0,0 +1 @@
2 + 2 /This is a comment

View file

@ -0,0 +1 @@
⍝ This is a comment

View file

@ -0,0 +1,7 @@
/* ARM assembly Raspberry PI comment one line */
/* comment line 1
comment line 2
*/
mov r0,#0 @ this comment on end of line
mov r1,#0 // authorized comment

View file

@ -0,0 +1,3 @@
BEGIN { # this code does something
# do something
}

View file

@ -0,0 +1,4 @@
;This is a comment
PROC Main() ;This is a comment as well
RETURN

View file

@ -0,0 +1 @@
-- All Ada comments begin with "--" and extend to the end of the line

View file

@ -0,0 +1,9 @@
# single line comment
#/ multi-line comment
- ends with the "/ followed by #" terminator on the next line
/#
/* multi-line comment - C-style
- ends with the "* followed by /" terminator on the next line
*/

View file

@ -0,0 +1,3 @@
/* multiline comment
are like C ... */
-> this is a end of line comment

View file

@ -0,0 +1 @@
// This is a comment

View file

@ -0,0 +1,4 @@
System.debug ('I will execute'); // This comment is ignored.
/*
I am a large comment, completely ignored as well.
*/

View file

@ -0,0 +1,12 @@
--This is a single line comment
display dialog "ok" --it can go at the end of a line
# Hash style comments are also supported
(* This is a multi
line comment*)
(* This is a comment. --comments can be nested
(* Nested block comment *)
*)

View file

@ -0,0 +1 @@
display dialog "ok" #Starting in version 2.0, end-line comments can begin with a hash

View file

@ -0,0 +1 @@
REM COMMENT AFTER THE REM KEYWORD

View file

@ -0,0 +1 @@
0 REMLEAVE THE SPACE OUT AFTER THE REM WHEN TYPING OR PASTING

View file

@ -0,0 +1 @@
10 PRINT "THIS IS CODE" : REM : PRINT "THIS IS CODE"

View file

@ -0,0 +1 @@
20 GOSUB 110COMMENT: PRINT "THIS IS CODE"

View file

@ -0,0 +1 @@
30 GOTO 40"COMMENT: THIS IS A COMMENT

View file

@ -0,0 +1,8 @@
::::::::::::::::::::::::::::::::::::::
40 REM
50 :
60 REM<ctrl>+J
70 FOR I = 1 to 10
80 ::::PRINT I;MID$("THIS IS A COMMENT",1,0)
90 NEXT

View file

@ -0,0 +1 @@
100 END : THISISACOMMENT

View file

@ -0,0 +1 @@
110 RETURN : "COMMENT FOR AND AT THE END

View file

@ -0,0 +1,6 @@
; This is a simple single-line comment
a: 10 ; another single-line comment
; Now, this is a
; multi-line comment

View file

@ -0,0 +1 @@
// double slash to newline

View file

@ -0,0 +1,5 @@
Msgbox, comments demo ; end of line comment
/*
multiline comment1
multiline comment2
*/

View file

@ -0,0 +1,5 @@
#cs
Everything between the cs and and the ce is commented.
Commented code is not used by the computer.
#ce
;individual lines after a semicolon are commented.

View file

@ -0,0 +1 @@
.This is a single-line comment

View file

@ -0,0 +1,3 @@
...
This is a multi-line comment
...

View file

@ -0,0 +1,3 @@
...If 0
This is a comment only if the condition evaluates to zero
...

View file

@ -0,0 +1,3 @@
...!If 1
This is a comment only if the condition evaluates to nonzero
...

View file

@ -0,0 +1,3 @@
...Else
This is a comment only if the previous conditional comment was executed (and vice versa)
...

View file

@ -0,0 +1,2 @@
100 REM Standard BASIC comments begin with "REM" (remark) and extend to the end of the line
110 PRINT "this is code": REM comment after statement

View file

@ -0,0 +1,2 @@
'this is a comment
PRINT "this is code" 'comment after statement

View file

@ -0,0 +1,3 @@
rem this is a comment
# and this is too
print "this is code" #comment after statement

View file

@ -0,0 +1,2 @@
REM This is a comment which is ignored by the compiler
*| This is a comment which is compiled but ignored at run time

View file

@ -0,0 +1 @@
# This is a comment

View file

@ -0,0 +1,7 @@
-- This is a line-comment
#
This is a block-comment
It goes until de-dent
dedent: 0x42 -- The comment block above is now closed

View file

@ -0,0 +1 @@
rem Single-line comment.

View file

@ -0,0 +1,2 @@
:: Another option, though undocumented and known
:: to fail in some cases. Best avoided.

View file

@ -0,0 +1 @@
% this works as long as you have no variable named exactly like this sentence. %

View file

@ -0,0 +1,11 @@
/* This is a comment. */
2 + /* Comment between tokens. */ 3
"This is a string, /* NOT a comment */."
/*
* A comment can have multiple lines. These asterisks in the middle
* of the comment are only for style. You must not nest a comment
* inside another comment; the first asterisk-slash ends the comment.
*/

View file

@ -0,0 +1,11 @@
#!/usr/bin/bc
# This form of comment is an extension, not part of standard bc.
# Your program must not have a #! shebang line
# unless your bc supports this form of comment.
2 + 3 # It can be after a statement.
a = 1 # The newline is not part of the comment.
b = 2 # So this line is a different statement.

View file

@ -0,0 +1,8 @@
//This is a comment.
//This is another comment.
/* This is also a comment. */
/* This is a
multi-line
comment */

View file

@ -0,0 +1,25 @@
static
{
/// Must be placed directly above the method, including attributes.
/// Using multiple lines like this is also fine. Both will be recognized.
[Optimize]
public static void DoAThing() {}
/// Documentation also works for types.
struct SomeStruct
{
/**
* Multiline comment with two ** at the start works in the same way.
*/
void PrivateMethod() {}
}
/**
* If you have a really long explainer here, you may not actually want to show that in autcompletion prompts.
* @brief Allows you to select only this line to be shown.
*
* @param a This is shown when writing a call to this function and placing parameter "a".
* @param b For the second argument, the documentation for b (this!) will show up instead.
*/
public static void DoAnotherThing(int a, int b) {}
}

View file

@ -0,0 +1,2 @@
& read a number 2+ add two .@ display result and exit
^- inline comments -^ <-^- other comments

View file

@ -0,0 +1,6 @@
&;read a number;2+;add two;.@;display result and exit;
^- inline comments -^ <-^- other comments
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;completely isolated comment block for the paranoid;
;(almost - you can still skip into it.) ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

View file

@ -0,0 +1 @@
# A hash symbol at the beginning of a line marks the line as a comment

View file

@ -0,0 +1 @@
This is a comment

View file

@ -0,0 +1,5 @@
# Single line comment
#* Multi
Line
Comment *#

View file

@ -0,0 +1,2 @@
# Comments in mget scripts are prefixed with a hash symbol
ls # comments may appear at the end of a line

View file

@ -0,0 +1 @@
"I'm sort of a comment"vv

View file

@ -0,0 +1,3 @@
"I'm a
very long comment spanning
over several lines"vv

View file

@ -0,0 +1 @@
// This is a comment

View file

@ -0,0 +1 @@
// This is a valid comment // with a "nested" comment

View file

@ -0,0 +1,3 @@
#define FOO \
(macro text) // comment
(no more macro text)

View file

@ -0,0 +1,6 @@
#!/bin/csh -f
# C Shell has a similar comment syntax, but only allows comments in a
# script file, not in terminal input.
echo Hello#With C Shell, the hash can also be in the middle of a word.

View file

@ -0,0 +1,8 @@
//This is a comment.
//This is other comment.
/* This is a comment too. */
/* This is a
multi-line
comment */

View file

@ -0,0 +1,4 @@
/* This is a comment. */
/* So is this
multiline comment.
*/

View file

@ -0,0 +1,2 @@
struct charisma {};
void f(char/* comment */isma) {}

View file

@ -0,0 +1 @@
/* some comment /* trying to nest some other comment */ inside */

View file

@ -0,0 +1,3 @@
#if 0
While technically not a comment, this is also ignored by the compiler
#endif

View file

@ -0,0 +1,7 @@
#ifdef UNDEFINED
This is not compiled.
#if 0
Nor is this.
#endif
And this still is not compiled.
#endif

View file

@ -0,0 +1,3 @@
#if 0
This isn't valid.
#endif

View file

@ -0,0 +1 @@
// C++ single-line comments were adopted in the C99 standard.

View file

@ -0,0 +1 @@
* an asterisk in 7th column comments the line out

View file

@ -0,0 +1 @@
D DISPLAY "Debug"

View file

@ -0,0 +1 @@
*> This comment syntax was defined (with free format code) in COBOL 2002.

View file

@ -0,0 +1 @@
>>D DISPLAY "Debug"

View file

@ -0,0 +1,3 @@
NOTE this paragraph is
commented out and ignored
.

View file

@ -0,0 +1,11 @@
IDENTIFICATION DIVISION.
PROGRAM-ID. program.
AUTHOR. Rest of line ignored.
REMARKS. Rest of line ignored.
REMARKS. More remarks.
SECURITY. line ignored.
INSTALLATION. line ignored.
DATE-WRITTEN. same, human readable dates are allowed for instance
DATE-COMPILED. same.
DATE-MODIFIED. this one is handy when auto-stamped by an editor.

View file

@ -0,0 +1,4 @@
// single line
/* multi
line */

View file

@ -0,0 +1,16 @@
Comment Stew.
This is a comment.
The other comment is a loop, but you can name it anything (single word only).
You can also name ingredients as comments
This is pseudocode.
Ingredients.
Ingredient list
Method.
Methods.
SingleWordCommentOne the Ingredient.
Methods.
SingleWordCommentTwo until SingleWordCommentOned.
Methods.

View file

@ -0,0 +1,4 @@
10 rem this is a comment
20 ' and this is too
30 print "this is code" : 'comment after statement
40 print "and more code" : rem comment after statement

View file

@ -0,0 +1,2 @@
<-- Not common
// Usual comment

View file

@ -0,0 +1,2 @@
Start = /* This is a multi-
line comment */ 17 // This is a single-line comment

View file

@ -0,0 +1 @@
Start = /* This is a comment /* Nested comment */ still a comment */ 17

View file

@ -0,0 +1,3 @@
;; This is a comment
(defn foo []
123) ; also a comment

View file

@ -0,0 +1 @@
(comment (println (foo)) "bar" :baz 123 (System/exit 0)) ;; does nothing, returns nil

View file

@ -0,0 +1,2 @@
(+ 1 (comment "foo") 3) ;; Throws an exception, because it tries to add nil to an integer
(+ 1 #_"foo" 3) ;; Returns 4

View file

@ -0,0 +1,5 @@
# one line comment
### multi
line
comment ###

View file

@ -0,0 +1,5 @@
As ColdFusion's grammar is based around HTML syntax, commenting is similar to HTML.
<!--- This is a comment. Nothing in this tag can be seen by the end user.
Note the three-or-greater dashes to open and close the tag. --->
<!-- This is an HTML comment. Any HTML between the opening and closing of the tag will be ignored, but any ColdFusion code will still run.
Note that in the popular FuseBox framework for ColdFusion, the circuit.xml files require that you use this style of comment. -->

View file

@ -0,0 +1,2 @@
/* This is a comment */
// This is also a comment

View file

@ -0,0 +1,12 @@
;;;; This code implements the foo and bar functions
;;; The foo function calls bar on the first argument and multiplies the result by the second.
;;; The arguments are two integers
(defun foo (a b)
;; Call bar and multiply
(* (bar a) ; Calling bar
b))
;;; The bar function simply adds 3 to the argument
(defun bar (n)
(+ n 3))

View file

@ -0,0 +1,7 @@
(defun bar (n)
"Add 3 to the argument."
(+ n 3))
(defclass button (widget)
(label action)
(:documentation "This is a push-button widget."))

View file

@ -0,0 +1,3 @@
(* Comments (* can nest *)
and they can span multiple lines.
*)

View file

@ -0,0 +1,6 @@
# currently, Crystal only supports single-line comments
# This is a doc comment. Any line *directly* above (no blank lines) a module, class, or method is considered a doc comment
# Doc comments are used to generate documentation with `crystal docs`
class Foo
end

View file

@ -0,0 +1,22 @@
void main() {
// A single line comment.
/* This is a simple C-style comment that can't be nested.
Comments mostly work similar to C, newlines are irrelevant.
*/
/+ This is a nestable comment
/+ See?
+/
+/
/// Documentation single line comment.
/**
Simple C-style documentation comment.
*/
/++
Nestable documenttion comment.
+/
}

View file

@ -0,0 +1,10 @@
(* This is a comment.
It may extend across multiple lines. *)
{ Alternatively curly braces
can be used. }
/* C-style multi-line comments
are supported */
// and single-line C++ style comments too

View file

@ -0,0 +1,12 @@
// This is a single line comment, which lasts until the end of the line. The Dart linter prefers this one.
/* This is also a valid single line comment. Unlike the first one, this one terminates after one of these -> */
/*
You can use the syntax above to make multi line comments as well.
Like this!
*/
/// These are doc comments. You can use dartdoc to generate doc pages for your classes with these.
///
/// Formatting [variable] and [function] names like so allows dartdoc to link to the documentation for those entities.

Some files were not shown because too many files have changed in this diff Show more