Skip to content

Commit 7d4103e

Browse files
authored
Lua: comments.md incorrectly shows comment close as ]]-- (#5925)
* Lua: comments.md incorrectly shows comment close as ]]-- This is wrong, as in the case ```lua print(--[[ I am a comment ]]-- 123) ``` The way to close a multiline comment is to close the string with `]] ```lua print(--[[ I am a comment ]] 123) ``` * Update comments.md * Update comments.md * Update comments.md ---------
1 parent c0ca5e0 commit 7d4103e

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed
Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
---
2-
Title: 'Comments' # Required; the file name should be the same as the title, but lowercase, with dashes instead of spaces, and all punctuation removed
3-
Description: 'A comment is text within a program that is not being executed. It can provide additional information to support understanding the code.' # Required; ideally under 150 characters and starts with a noun (used in search engine results and content previews)
4-
Subjects: # Please only use Subjects in the subjects.md file (https://github.com/Codecademy/docs/blob/main/documentation/subjects.md). If that list feels insufficient, feel free to create a new Subject and add it to subjects.md in your PR!
2+
Title: 'Comments'
3+
Description: 'A comment is a text within a program that is not being executed. It can provide additional information to support understanding the code.'
4+
Subjects:
55
- 'Computer Science'
6-
Tags: # Please only use Tags in the tags.md file (https://github.com/Codecademy/docs/blob/main/documentation/tags.md). If that list feels insufficient, feel free to create a new Tag and add it to tags.md in your PR!
6+
Tags:
77
- 'Comments'
88
- 'Documentation'
9-
CatalogContent: # Please use course/path landing page slugs, rather than linking to individual content items. If listing multiple items, please put the most relevant one first
9+
CatalogContent:
1010
- 'learn-lua'
1111
- 'paths/computer-science'
1212
---
1313

14-
A **comment** is text within a program that is not being executed. It can provide additional information to support understanding the code.
14+
A **comment** is text within a program that is not being executed. It can provide additional information to help understand the code.
1515

1616
## Single-line Comments
1717

18-
In Lua, two consecutive dashes are used to create single line comments. The compiler does not read any text after `--` on the same line.
18+
In Lua, two consecutive dashes are used to create single-line comments. The compiler reads no text after `--` on the same line.
1919

2020
```lua
2121
function sum(number1, number2)
@@ -29,11 +29,12 @@ The comment does not affect the function.
2929

3030
## Multi-line Comments
3131

32-
In Lua, multi-line comments are created using the `--[[` syntax to start the comment, and `]]--` to end the comment. The compiler does not read any text in between.
32+
In Lua, multi-line comments are created using the `--[[` syntax to start the comment and `]]` to end the comment. The compiler does not read any text in between.
3333

3434
```lua
3535
--[[ this is a multi-line comment.
3636
The compiler
3737
will not run code
38-
written in between. ]]--
38+
written in between.
39+
]]
3940
```

0 commit comments

Comments
 (0)