»
« home   paste   Anonymous | Login | Signup for a new account 04-26-2019 08:25 CEST
 
* X »
«
GeSHi - Generic Syntax Highlighter Syntax Coloriser for PHP
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0000090 [GeSHi] core tweak always 09-13-06 13:22 09-13-06 23:32
Reporter BenBE View Status public  
Assigned To nigel
Priority normal Resolution open  
Status assigned   Product Version 1.1.2alpha2
Summary 0000090: Allow for custom starter ender names of contexts
Description As of pre-1.1.1 it was possible to to set the style you wanted a context starter or ender to be highlighted as. Being rewritten with 1.1.1's release (rewriting language format) you missed reimplementing that feature some language files (e.g. Delphi) relied on.
Additional Information It would be nice if there was a way to:
1. set the relative alias start and end are located at
--> $this->aliasDelimiters('delphi/delphi');
2. set explicit names for them
--> $this->aliasStarter('delphi/delphi/keyword');
--> $this->aliasEnder('delphi/delphi/symbol');
3. ask the parent context to highlight them
--> $this->aliasDelimiterMode(ALIAS_BY_PARENT);
Attached Files

- Relationships
child of 0000006assigned BenBE Delphi support 

- Notes
(0000437)
nigel
09-13-06 15:05

Those options you give:

  * 3 may already be implemented, if you try $context->parseDelimiters(GESHI_CHILD_PARSE_NONE) in the context you have aliased, I encourage you to give that a go.
  * 2 makes sense, although I would be tempted to merge it with the call to alias() - e.g. $context->alias('delphi/delphi', 'keytype', 'symbol'); where parameters 2 and 3 are for the starter and ender
  * 1: could you explain the effect of this one more?
 
(0000441)
BenBE
09-13-06 21:46

The first is ment for languages that have a lot of subcontext where you've many context having e.g. symbols as subcontext starters. In that case you could make one genereal start \ end style pair in some context (e.g. the language root) and have all starters \ enders be aliased to that context, independet from the actual context alias used for data.

HTML could be a example of that where you could make html/html/tag/start end html/html/tag/end and have every subcontext that is initialized by a tag have its starters\enders be rendered with that style, even if the actual subcontext was php, css or such.

This method is basically a full-qualified alias for the second method to give the alias directory, the second would give the actual naes (so they could be combined).

Delphi could use this one too as I mostly start subcontexts with a keyword and terminate them by a symbol, having both being in delphi/delphi.
 
(0000443)
nigel
09-13-06 23:32

Meh. I can't really see the use of that given that there's nothing in the current language file format that can't handle this situation.

HTML won't necessarily work if the delimiter is something with attributes in it anyway, e.g. <style type="text/css"> - you still have to parse that whole thing. Of course the delphi example you give may be a place where it is used though.

I can see this possibly being a benefit as an *optimisation* - e.g. rather than parsing the delimiters (according to the _parseDelimiter flag - e.g. GESHI_CHILD_PARSE_*), if that method has been called then GeSHi could simply automatically put the stuff in that context. If that's how you would see it working, then it's probably a separate, optimisation related bug.

Number 2 is still present and valid for this bug, and will probably be implemented in a similar way to the above - i.e. where starters/enders detected, if we have an alias name for them then use that else do the parsing.

You still might want to look into number 3.
 

- Issue History
Date Modified Username Field Change
09-13-06 13:22 BenBE New Issue
09-13-06 13:22 BenBE Status new => assigned
09-13-06 13:22 BenBE Assigned To  => nigel
09-13-06 13:24 BenBE Relationship added child of 0000006
09-13-06 15:05 nigel Note Added: 0000437
09-13-06 21:46 BenBE Note Added: 0000441
09-13-06 23:32 nigel Note Added: 0000443

  


Mantis 1.0.0rc2[^]
Copyright © 2000 - 2005 Mantis Group
41 total queries executed.
33 unique queries executed.
Powered by Mantis Bugtracker