Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
doxverilog
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
doxverilog
Commits
9d315a98
Commit
9d315a98
authored
Jun 11, 2014
by
wtschueller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tcl: recurse for []
parent
6245ef41
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
677 additions
and
74 deletions
+677
-74
tclscanner.l
src/tclscanner.l
+182
-74
058__bracket__recursion_8tcl.xml
testing/058/058__bracket__recursion_8tcl.xml
+354
-0
058_bracket_recursion.tcl
testing/058_bracket_recursion.tcl
+141
-0
No files found.
src/tclscanner.l
View file @
9d315a98
This diff is collapsed.
Click to expand it.
testing/058/058__bracket__recursion_8tcl.xml
0 → 100644
View file @
9d315a98
This diff is collapsed.
Click to expand it.
testing/058_bracket_recursion.tcl
0 → 100644
View file @
9d315a98
#// objective: tests processing of commands inside brackets [
]
, only references/referencedby relations are relevant
#// check: 058__bracket__recursion_8tcl.xml
#// config: REFERENCED_BY_RELATION = yes
#// config: REFERENCES_RELATION = yes
#// config: EXTRACT_ALL = yes
#// config: INLINE_SOURCES = yes
##
# \brief should be reference by every proc below
proc
Invoked args
{
puts
"Procedure
\"
Invoked
\"
is invoked indeed. Ok."
return
$args
}
##
# \brief must not be reference by every proc below
proc
NotInvoked args
{
puts
"Procedure
\"
NotInvoked
\"
is invoked. Not Ok!"
return
$args
}
#
# check if call references work at all
proc
a args
{
Invoked NotInvoked
return
}
#
# check brackets with various quoting, bracing
proc
b args
{
set r
[
Invoked
]
set r
[
list
\[
NotInvoked
\]
]
return
}
proc
c args
{
set r
\{
[
Invoked
]
\}
set r
{[
NotInvoked
]}
return
}
proc
d args
{
set r
"
[
Invoked
]
"
set r
"
\[
NotInvoked
\]
"
return
}
proc
e args
{
set r
[
list
\[
NotInvoked
[
Invoked
]
\]
]
return
}
proc
f args
{
set r
[
list
[
Invoked
\[
NotInvoked
\]
]]
return
}
proc
g args
{
set r
"{
[
Invoked
]
}"
set r
"{
\[
NotInvoked
\]
}"
return
}
proc
h args
{
[
Invoked set
]
r
{[
NotInvoked
]}
return
}
# check brackets in tcl commands containing script arguments
#
# example generated according to
# https://groups.google.com/d/msg/comp.lang.tcl/G5-mc3GiIyY/e-AVD9t7xMkJ
proc
i args
{
foreach item
[
Invoked
]
{
return
}
}
proc
j args
{
foreach
[
Invoked item
]
[
list
one two three
]
{
}
return
}
proc
k args
{
while
{[
Invoked 0
]}
{
}
}
proc
l args
{
for
{}
{[
Invoked 0
]}
{}
{
}
}
proc
m args
{
if
{[
Invoked 1
]}
{
}
}
proc
n args
{
if
[
Invoked 1
]
{
}
}
proc
o args
{
if
{
0
}
{
}
else
if
{[
Invoked 0
]}
{
}
}
# these are really nasty examples
# they shows, that the condition argument may not be parsed as a script
set
NotInvoked
\$
NotInvoked
proc
$NotInvoked args
{
puts
"Procedure
\"\$
NotInvoked
\"
is invoked. Not Ok!"
return
$args
}
proc
p args
{
set NotInvoked
\$
NotInvoked
if
{
$NotInvoked eq
[
Invoked 1
]}
{
}
return
}
proc
q args
{
set NotInvoked
\$
NotInvoked
if
{
0
}
{
}
else
if
{
$NotInvoked eq
[
Invoked 1
]}
{
}
return
}
proc
r args
{
set NotInvoked
\$
NotInvoked
while
{
$NotInvoked eq
[
Invoked 1
]}
{
}
return
}
proc
s args
{
set NotInvoked
\$
NotInvoked
for
{}
{
$NotInvoked eq
[
Invoked 1
]}
{}
{
}
return
}
# dangling open brackets should not confuse the scanner
proc
t args
{
set foo ]]]]
[
Invoked
]
return
}
#
# call all single letter procs
# let tcl check what is called and what is not called
foreach
p
[
info
procs ?
]
{
puts
"Check procedure
\"
$p
\"
"
$p
}
exit
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment