Skip to content

Commit

Permalink
Adding Tcl support, closes #92
Browse files Browse the repository at this point in the history
  • Loading branch information
aaron-bond committed Sep 3, 2018
1 parent f003c29 commit 52e6d35
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## [1.2.8] (2018-09-03)
### Features
* Added support for Tcl ([]()), closes [#92](https://github.com/aaron-bond/better-comments/issues/92)

## [1.2.7] (2018-09-02)
### Features
* Adding support for Flax ([71f6326](https://github.com/aaron-bond/better-comments/commit/71f6326)), merges [#76](https://github.com/aaron-bond/better-comments/issues/76)
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ The default 5 can be modifed to change the colors, and more can be added.
* SQL
* STATA
* Swift
* Tcl
* Terraform
* TypeScript
* TypeScript React
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
"onLanguage:sql",
"onLanguage:stata",
"onLanguage:swift",
"onLanguage:tcl",
"onLanguage:terraform",
"onLanguage:typescript",
"onLanguage:typescriptreact",
Expand Down
1 change: 1 addition & 0 deletions src/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ export class Parser {
break;

case "python":
case "tcl":
this.delimiter = "#";
this.ignoreFirstLine = true;
break;
Expand Down
35 changes: 35 additions & 0 deletions src/test/samples/tcl.tcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/usr/bin/tclsh

# ! switch_cmd.tcl

set domain x
switch $domain {

x { puts "x" }
y { puts "y" }
z { puts "z" }
default { puts "unknown" }
}

proc power {base p} {
set result 1
while {$p > 0} {
set result [expr $result * $base]
set p [expr $p - 1]
}
return $result
}

set a 10
set b 20

if {$a == 10} {

# ? if expression_1 is true then it will go to expression_2
if {$b == 20} {
# * if expression_2 is true then it will print the below string
puts "value of a is 10 and b is 20"
}
}

o/p: value of a is 10 and b is 20

0 comments on commit 52e6d35

Please sign in to comment.