TV apr 16 03 13:16
I was wondering how to find matching brackets, or braces would be fine too, I guess even quotes would do, in *ANY* syntactically corrent tcl/tk script?
I mean preferably a way which is applicable to any code which can be fed to the interpreters, I mean complete general applicability, including comments.
I tried various things as in bwise amoung which some working methods, but I need a nice proc for a simple enough application, like the tml pages I want to generate html pages from a html + tcl extended page in a text editor.
While I'm asking, maybe there is a tcl coded tcl parser of some generality somewhere to be downloaded?
RS: info complete will bring you most of the way, I think: "info complete command Returns 1 if command is a complete Tcl command in the sense of having no unclosed quotes, braces, brackets or array element names, If the command doesn't appear to be complete then 0 is returned. This command is typically used in line-oriented input environments to allow users to type in commands that span multiple lines; if the command isn't complete, the script can delay evaluating it until additional lines have been typed to complete the command. " (TclHelp)