[Tcsh] One-line command parsing
Matheus
tateusg at protonmail.com
Mon Aug 24 10:51:37 EDT 2026
https://github.com/Krush206/etcsh/pull/2
Hello. I'm writing this e-mail as a matter of contribution. I forked Tcsh, and added some features. My most-recent contribution is on one-line command parsing. I'm currently working on an implementation to parse control structures in a single line, as in Bourne shells.
At first, I thought on parsing one-line commands on top of a temporary function. This turned out to be too complicated. Instead, I parse semicolons into a new node mode [NODE_FUNC]. I implemented a new mode [F_LINE]. I "reparse" the entire tree, setting the F_LINE bit to every command node [NODE_COMMAND]. Then, in execute(), I walk through the entire tree, analyzing which of the NODE_COMMAND entries contain the F_LINE mode. The node shall be saved in a circular linked list for each containing the F_LINE mode. Next, the circular linked list is analyzed from search1(). The parsing is almost the same from search().
This is still a work in progress. Not ready for production use. I don't know if this is 100% feasible, though, compared to past implementations, progressed quite fairly.
I'd appreciate for contributions and feedback.
Thank you.
More information about the Tcsh
mailing list