-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tcl: Add operators and punctuation + add examples
- Loading branch information
Showing
4 changed files
with
88 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<h1>Tcl</h1> | ||
<p>To use this language, use the class "language-tcl".</p> | ||
|
||
<h2>Comments</h2> | ||
<pre><code># This is a comment</code></pre> | ||
|
||
<h2>Strings</h2> | ||
<pre><code>"foo \"bar\" baz" | ||
"foo\ | ||
bar\ | ||
baz"</code></pre> | ||
|
||
<h2>Variables</h2> | ||
<pre><code>$foo | ||
$foo::bar_42 | ||
$::baz | ||
${foobar} | ||
set foo::bar "baz"</code></pre> | ||
|
||
<h2>Functions</h2> | ||
<pre><code>proc foobar {baz} { | ||
puts $baz | ||
} | ||
|
||
proc RESTORE/post/:post_id/comment/:comment_id {post_id comment_id} { | ||
#| Restore a comment handler | ||
comment_restore $comment_id | ||
qc::actions redirect [url "/post/$post_id" show_deleted_comment_ids $comment_id] | ||
}</code></pre> | ||
|
||
<h2>Known failures</h2> | ||
<p>There are certain edge cases where Prism will fail. | ||
There are always such cases in every regex-based syntax highlighter. | ||
However, Prism dares to be open and honest about them. | ||
If a failure is listed here, it doesn’t mean it will never be fixed. This is more of a “known bugs” list, just with a certain type of bug. | ||
</p> | ||
|
||
<h3>Comment-like substrings</h3> | ||
<pre><code>"This string is #broken"</code></pre> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
+ | ||
- | ||
~ | ||
! != | ||
* ** | ||
/ | ||
% | ||
< <= << | ||
> >= >> | ||
== | ||
& && | ||
| || | ||
? | ||
^ | ||
eq | ||
ne | ||
in | ||
ni | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["operator", "+"], | ||
["operator", "-"], | ||
["operator", "~"], | ||
["operator", "!"], ["operator", "!="], | ||
["operator", "*"], ["operator", "**"], | ||
["operator", "/"], | ||
["operator", "%"], | ||
["operator", "<"], ["operator", "<="], ["operator", "<<"], | ||
["operator", ">"], ["operator", ">="], ["operator", ">>"], | ||
["operator", "=="], | ||
["operator", "&"], ["operator", "&&"], | ||
["operator", "|"], ["operator", "||"], | ||
["operator", "?"], | ||
["operator", "^"], | ||
["operator", "eq"], | ||
["operator", "ne"], | ||
["operator", "in"], | ||
["operator", "ni"] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for all operators. |