GeSHi Bug Tracker - GeSHi
|Viewing Issue Advanced Details|
|ID:||Category:||Severity:||Reproducibility:||Date Submitted:||Last Update:|
|85||core||feature||N/A||06-06-06 05:26||09-13-06 12:56|
|ETA:||none||Fixed in Version:|
|Summary:||0000085: Preview and Postview Functions for Code Parsers|
In some (rare) cases it might be useful to have the opportunity for the CodeParser to "preview" the source it has to highlight.
This should be realized by letting the CP preview the source it's going to highlight in an order simular to this:
--- Example source ---
--- Example Call Order ---
--- Example End ---
Within the iterator subcontexts are returned unparsed, i.e. if there was an ASM block or another context that needs subdividing, the preview function would see it as a single string.
This feature then could easily be used to prepare highlighting of source, e.g. to detect variable names or the exact context of tokens that were contextually ambiguous otherwise (cf. the example below).
|Steps To Reproduce:||
Any source were the use of a variable preceeds its declaration:
e.g. this (common) example in the header files for Delphi (and CPP)
This feature would require the token iterator of 0000084 or at least could be based on that feature.
An example where "look-behind highlighting" along wont do is the following Delphi source:
with //... being loads of source. If this source was highlighted using simple look-behind highlighting (as the current CP could do) you would have to store nearly all information of the source snippet on the highlighting stack before you knew that Foo in the const declaration was a procedure name instead of a simple variable. TSomeProcType is a type declaration, not a procedure name and Ptr a variable name (Procedure reference, but no procedure!).
If you could skim over the source before going to highlight it, the CP could extract such information beforehand and handle them correctly.
|There are no notes attached to this issue.|