-
Notifications
You must be signed in to change notification settings - Fork 624
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2629 from masatake/tcl-var-recognition
Tcl: strict the way to recognize variable expansions
- Loading branch information
Showing
5 changed files
with
43 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
proc1 input.tcl /^proc proc1 {} {$/;" p | ||
proc2 input.tcl /^proc proc2 {} {}$/;" p | ||
proc3 input.tcl /^proc proc3 {} {$/;" p | ||
proc4 input.tcl /^proc proc4 {} {}$/;" p |
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,17 @@ | ||
# Taken from #2627 submitted by @surmish | ||
proc proc1 {} { | ||
if {[regexp {[0-9]$} ""]} { | ||
echo "matched" | ||
} | ||
} | ||
|
||
proc proc2 {} {} | ||
|
||
proc proc3 {} { | ||
set abc "hello" | ||
puts ${abc} | ||
} | ||
|
||
proc proc4 {} {} | ||
|
||
proc3 |
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,2 @@ | ||
proc1 input.tcl /^proc proc1 {} {$/;" p | ||
proc2 input.tcl /^proc proc2 {} {}$/;" p |
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,6 @@ | ||
# Taken from a comment in #2627 submitted by @surmish. | ||
proc proc1 {} { | ||
expr {[string first "\\" $varName]==0} | ||
} | ||
|
||
proc proc2 {} {} |
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