-
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.
Merge branch 'prism-markdown-tcl' of https://github.com/PeterChaplin/…
…prism into gh-pages + add tests Conflicts: components.js
- Loading branch information
Showing
10 changed files
with
384 additions
and
0 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
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,41 @@ | ||
Prism.languages.tcl = { | ||
'comment': { | ||
pattern: /(^|[^\\])#.*/, | ||
lookbehind: true | ||
}, | ||
'string': /"(?:[^"\\\r\n]|\\(?:\r\n|[\s\S]))*"/, | ||
'variable': [ | ||
{ | ||
pattern: /(\$)(?:::)?(?:[a-zA-Z0-9]+::)*[a-zA-Z0-9_]+/, | ||
lookbehind: true | ||
}, | ||
{ | ||
pattern: /(\$){[^}]+}/, | ||
lookbehind: true | ||
}, | ||
{ | ||
pattern: /(^\s*set[ \t]+)(?:::)?(?:[a-zA-Z0-9]+::)*[a-zA-Z0-9_]+/m, | ||
lookbehind: true | ||
} | ||
], | ||
'function': { | ||
pattern: /(^\s*proc[ \t]+)[^\s]+/m, | ||
lookbehind: true | ||
}, | ||
'builtin': [ | ||
{ | ||
pattern: /(^\s*)(?:proc|return|class|error|eval|exit|for|foreach|if|switch|while|break|continue)\b/m, | ||
lookbehind: true | ||
}, | ||
/\b(elseif|else)\b/ | ||
], | ||
'scope': { | ||
pattern: /(^\s*)(global|upvar|variable)\b/m, | ||
lookbehind: true, | ||
alias: 'constant' | ||
}, | ||
'keyword': { | ||
pattern: /(^\s*|\[)(after|append|apply|array|auto_(?:execok|import|load|mkindex|qualify|reset)|automkindex_old|bgerror|binary|catch|cd|chan|clock|close|concat|dde|dict|encoding|eof|exec|expr|fblocked|fconfigure|fcopy|file(?:event|name)?|flush|gets|glob|history|http|incr|info|interp|join|lappend|lassign|lindex|linsert|list|llength|load|lrange|lrepeat|lreplace|lreverse|lsearch|lset|lsort|math(?:func|op)|memory|msgcat|namespace|open|package|parray|pid|pkg_mkIndex|platform|puts|pwd|re_syntax|read|refchan|regexp|registry|regsub|rename|Safe_Base|scan|seek|set|socket|source|split|string|subst|Tcl|tcl(?:_endOfWord|_findLibrary|startOf(?:Next|Previous)Word|wordBreak(?:After|Before)|test|vars)|tell|time|tm|trace|unknown|unload|unset|update|uplevel|vwait)\b/m, | ||
lookbehind: true | ||
} | ||
}; |
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,35 @@ | ||
proc | ||
return | ||
class | ||
error | ||
eval | ||
exit | ||
for | ||
foreach | ||
if elseif else | ||
switch | ||
while | ||
break | ||
continue | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["builtin", "proc"], | ||
["builtin", "return"], | ||
["builtin", "class"], | ||
["builtin", "error"], | ||
["builtin", "eval"], | ||
["builtin", "exit"], | ||
["builtin", "for"], | ||
["builtin", "foreach"], | ||
["builtin", "if"], ["builtin", "elseif"], ["builtin", "else"], | ||
["builtin", "switch"], | ||
["builtin", "while"], | ||
["builtin", "break"], | ||
["builtin", "continue"] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for builtins. |
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,13 @@ | ||
# | ||
# foobar | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["comment", "#"], | ||
["comment", "# foobar"] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for comments. |
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,15 @@ | ||
proc foo | ||
proc Foobar | ||
proc foo_bar_42 | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["builtin", "proc"], ["function", "foo"], | ||
["builtin", "proc"], ["function", "Foobar"], | ||
["builtin", "proc"], ["function", "foo_bar_42"] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for functions. |
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,213 @@ | ||
after | ||
append | ||
apply | ||
array | ||
auto_execok | ||
auto_import | ||
auto_load | ||
auto_mkindex | ||
auto_qualify | ||
auto_reset | ||
automkindex_old | ||
bgerror | ||
binary | ||
catch | ||
cd | ||
chan | ||
clock | ||
close | ||
concat | ||
dde | ||
dict | ||
encoding | ||
eof | ||
exec | ||
expr | ||
fblocked | ||
fconfigure | ||
fcopy | ||
file | ||
fileevent | ||
filename | ||
flush | ||
gets | ||
glob | ||
history | ||
http | ||
incr | ||
info | ||
interp | ||
join | ||
lappend | ||
lassign | ||
lindex | ||
linsert | ||
list | ||
llength | ||
load | ||
lrange | ||
lrepeat | ||
lreplace | ||
lreverse | ||
lsearch | ||
lset | ||
lsort | ||
mathfunc | ||
mathop | ||
memory | ||
msgcat | ||
namespace | ||
open | ||
package | ||
parray | ||
pid | ||
pkg_mkIndex | ||
platform | ||
puts | ||
pwd | ||
re_syntax | ||
read | ||
refchan | ||
regexp | ||
registry | ||
regsub | ||
rename | ||
Safe_Base | ||
scan | ||
seek | ||
set | ||
socket | ||
source | ||
split | ||
string | ||
subst | ||
Tcl | ||
tcl_endOfWord | ||
tcl_findLibrary | ||
tclstartOfNextWord | ||
tclstartOfPreviousWord | ||
tclwordBreakAfter | ||
tclwordBreakBefore | ||
tcltest | ||
tclvars | ||
tell | ||
time | ||
tm | ||
trace | ||
unknown | ||
unload | ||
unset | ||
update | ||
uplevel | ||
vwait | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["keyword", "after"], | ||
["keyword", "append"], | ||
["keyword", "apply"], | ||
["keyword", "array"], | ||
["keyword", "auto_execok"], | ||
["keyword", "auto_import"], | ||
["keyword", "auto_load"], | ||
["keyword", "auto_mkindex"], | ||
["keyword", "auto_qualify"], | ||
["keyword", "auto_reset"], | ||
["keyword", "automkindex_old"], | ||
["keyword", "bgerror"], | ||
["keyword", "binary"], | ||
["keyword", "catch"], | ||
["keyword", "cd"], | ||
["keyword", "chan"], | ||
["keyword", "clock"], | ||
["keyword", "close"], | ||
["keyword", "concat"], | ||
["keyword", "dde"], | ||
["keyword", "dict"], | ||
["keyword", "encoding"], | ||
["keyword", "eof"], | ||
["keyword", "exec"], | ||
["keyword", "expr"], | ||
["keyword", "fblocked"], | ||
["keyword", "fconfigure"], | ||
["keyword", "fcopy"], | ||
["keyword", "file"], | ||
["keyword", "fileevent"], | ||
["keyword", "filename"], | ||
["keyword", "flush"], | ||
["keyword", "gets"], | ||
["keyword", "glob"], | ||
["keyword", "history"], | ||
["keyword", "http"], | ||
["keyword", "incr"], | ||
["keyword", "info"], | ||
["keyword", "interp"], | ||
["keyword", "join"], | ||
["keyword", "lappend"], | ||
["keyword", "lassign"], | ||
["keyword", "lindex"], | ||
["keyword", "linsert"], | ||
["keyword", "list"], | ||
["keyword", "llength"], | ||
["keyword", "load"], | ||
["keyword", "lrange"], | ||
["keyword", "lrepeat"], | ||
["keyword", "lreplace"], | ||
["keyword", "lreverse"], | ||
["keyword", "lsearch"], | ||
["keyword", "lset"], | ||
["keyword", "lsort"], | ||
["keyword", "mathfunc"], | ||
["keyword", "mathop"], | ||
["keyword", "memory"], | ||
["keyword", "msgcat"], | ||
["keyword", "namespace"], | ||
["keyword", "open"], | ||
["keyword", "package"], | ||
["keyword", "parray"], | ||
["keyword", "pid"], | ||
["keyword", "pkg_mkIndex"], | ||
["keyword", "platform"], | ||
["keyword", "puts"], | ||
["keyword", "pwd"], | ||
["keyword", "re_syntax"], | ||
["keyword", "read"], | ||
["keyword", "refchan"], | ||
["keyword", "regexp"], | ||
["keyword", "registry"], | ||
["keyword", "regsub"], | ||
["keyword", "rename"], | ||
["keyword", "Safe_Base"], | ||
["keyword", "scan"], | ||
["keyword", "seek"], | ||
["keyword", "set"], | ||
["keyword", "socket"], | ||
["keyword", "source"], | ||
["keyword", "split"], | ||
["keyword", "string"], | ||
["keyword", "subst"], | ||
["keyword", "Tcl"], | ||
["keyword", "tcl_endOfWord"], | ||
["keyword", "tcl_findLibrary"], | ||
["keyword", "tclstartOfNextWord"], | ||
["keyword", "tclstartOfPreviousWord"], | ||
["keyword", "tclwordBreakAfter"], | ||
["keyword", "tclwordBreakBefore"], | ||
["keyword", "tcltest"], | ||
["keyword", "tclvars"], | ||
["keyword", "tell"], | ||
["keyword", "time"], | ||
["keyword", "tm"], | ||
["keyword", "trace"], | ||
["keyword", "unknown"], | ||
["keyword", "unload"], | ||
["keyword", "unset"], | ||
["keyword", "update"], | ||
["keyword", "uplevel"], | ||
["keyword", "vwait"] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for keywords. |
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,15 @@ | ||
global | ||
upvar | ||
variable | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["scope", "global"], | ||
["scope", "upvar"], | ||
["scope", "variable"] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for scopes. |
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,16 @@ | ||
"" | ||
"fo\"obar" | ||
"fo\"o\ | ||
bar" | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["string", "\"\""], | ||
["string", "\"fo\\\"obar\""], | ||
["string", "\"fo\\\"o\\\r\nbar\""] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for strings. |
Oops, something went wrong.