[sicsh-develop] Re: Syntax hooks
Status: Alpha
Brought to you by:
gvv
From: Ezra P. <epe...@zi...> - 2000-04-13 20:34:50
|
Sorry for not getting back sooner: >I wonder whether we also need to provide hooks at various points in >the code between building the input buffer and passing parts of the >Tokens* array into the evaluator... This would >A cleaner way to implement `$' substitution would be let the dollar >module register a hook function after tokenisation that rewrites any >token that begins with a `$'. The module would still need to provide >a syntax handler to keep all of $(foo bar baz) in a single token (or >maybe just a flag like we do for strings?). This could also work with equals, etc. This makes the syntax tables responsible for the breaking the line into tokens. The Syntax_Hook can then handle the context specific requirements and rewriting. >The only sane way I can think of to implement globbing is to register >a hook function that rewrites the buffer contents with any glob >expansions done. In this case the function would need to be called >before the syntax pass in tokenize(). I do not follow this reasoning. What exactly are you trying to expand with glob expansion? Filenames? Commands? Filenames could be handled at the Syntax_Hook level. Please elaborate. Therefore, I like the Syntax_Hook, but am not convinced of the need for the init_hooks. Ezra |