Overview
| Artifact ID: | 993159f8e3ad7c2380643e16b600987d7f6faca3 |
|---|---|
| Ticket: | 219275ffffffffffffffffffffffffffffffffff
Compiler support for custom preprocessors written in Tcl |
| User & Date: | nobody on 2000-10-26 05:09:44 |
Changes
- assignee changed to: "nobody"
- closer changed to: "nobody"
- cmimetype changed to: "text/plain"
- comment changed to:
OriginalBugID: 1709 RFE Version: 8.0.5 SubmitDate: '1999-04-05' LastModified: '1999-04-05' Severity: LOW Status: UnAssn Submitter: pat ChangedBy: pat OS: All OSVersion: NA Machine: NA FixedDate: '2000-10-25' FixedInVersion: NA ClosedDate: '2000-10-25' Name: Alexandre FERRIEUX email: [email protected] Support: None Synopsis: Compiler support for custom preprocessors written in Tcl DesiredBehavior: A modification of the bytecode-compiler that would allow people to add their own preprocessing step, even written in Tcl. Obvious application: bang-comments. Proponents of the approach could test it out for themselves. Explanation: the idea would be to give a '<<'-like capability to Tcl commands (now it is restricted to child processes), so that we could hand *any* kind of text garbage in-line to an arbitrary Tcl command: inlinedata -until EOFEOFEOF myproc hey boys this is unrestricted {{{{{{{ text]]]]]]] ! EOFEOFEOF The example above would call myproc with the text as a single string argument. The key is that 'inlinedata' has to be known by the compiler, so that it takes the new delimiter syntax into account immediately. Of course, this can only happen if the stream is being compiled as code at this point, so it's necessarily at toplevel of a script file or of an evalled (uplevelled) string; however it is very flexible since it allows any kind of preprocessing to be written and tested in pure Tcl ! For example, the bang comment: proc nobangs s { regsub -all "\n\[ \t\]*!\[^\n\]*" \n$s "" s uplevel $s } inlinedata nobangs ;# without -until, goes to end of current script ! Ha, this one works: }}} ! Just as a #. No big deal proc butthisone {} { ! is more }}}}} ! impressive indeed ]]]] puts yes } Notice also that the natural restriction of the scope allows to avoid many backward compatibility problems (especially ominous in the bang case), since the preprocessing can be done on a per-script or even per-procedure basis. Comments: This idea has already been posted in the kilometer-long braces-in-comment thread, but Jeff Hobbs pointed out that it was off-topic there and could easily be overlooked...
- foundin changed to: "final: 8.0.5"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Deleted"
- submitter changed to: "nobody"
- subsystem changed to: "69. Other"
- title changed to:
Compiler support for custom preprocessors written in Tcl
- type changed to: "RFE"