»
« home   paste   Anonymous | Login | Signup for a new account 06-21-2019 01:45 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
0000001 [GeSHi] core feature always 10-20-05 20:06 12-05-05 09:40
Reporter nigel View Status public  
Assigned To nigel
Priority high Resolution open  
Status assigned   Product Version 1.1.0alpha1
Summary 0000001: Support for balancing contexts required
Description Add handling for equal-balanced ending. For example, if the starter for a context is { and the ender is }, if there is a { within the context (after the starting {), then two }'s will have to be encountered. See this example (perl):

my $sql = qq(INSERT INTO table
(row1, row2)
VALUES
('value1', 'value2')
);

The qq context should end at the last ).
Additional Information Codeworker requires this
Attached Files

- Relationships
parent of 0000016assigned nigel Balancing contexts doesn't take children into account. 
related to 0000003assigned nigel CodeWorker support 
Not all the children of this issue are yet resolved or closed.

- Notes
(0000010)
BenBE
10-21-05 22:38

What about using a stack based context ender recognition? Thus that a context may contain itself?

The example given above would than become a qq context containing (two) sub-qq-contexts.

Stuff that would have to be taken care of using that solution would include
1. Max Nesting depth (unlimited in the first place)
2. Error recognition \ error tolerance
3. Stack handling would require state reconstruction mechanism(s)
 
(0000011)
nigel
10-22-05 00:10

The first problem you identify is the one that causes the grief. Believe me, I've tried nesting contexts.

However, I have actually done this (balanced enders) before. It's not hard to check characters and keep a counter of how nested they are, then end the context when the count returns to zero. It's just some changes to _getContextEndData.

The thing that's baking my noodle right now is how to do it *properly*.

I would not do this by creating a new class, because you might want a GeSHiContext OR a GeSHiCodeContext OR ... to have this ability.

So I'll probably code it straight into GeSHiContext, and have a flag for turning it on.

Note to self: make sure to throw a big spaz if the starter and ender are the same.
 
(0000024)
nigel
10-25-05 02:08

Preliminary support is in CVS, awaiting Cedric's feedback.

This will remain alpha until it gets a good workout, which may only be if someone does perl support.

Still have to do some error checking and optimisations.
 
(0000042)
nigel
11-01-05 14:07

Bug 16 has cropped up... this might be harder than I thought.
 

- Issue History
Date Modified Username Field Change
10-20-05 20:06 nigel New Issue
10-20-05 20:06 nigel Status new => assigned
10-20-05 20:06 nigel Assigned To  => nigel
10-20-05 20:21 nigel Projection none => minor fix
10-20-05 20:21 nigel ETA none => < 1 week
10-20-05 20:33 nigel Relationship added related to 0000003
10-21-05 22:38 BenBE Note Added: 0000010
10-22-05 00:10 nigel Note Added: 0000011
10-25-05 02:08 nigel Note Added: 0000024
10-27-05 20:57 BenBE Relationship added parent of 0000016
10-27-05 21:05 BenBE Relationship replaced child of 0000016
11-01-05 14:07 nigel Note Added: 0000042
11-01-05 14:07 nigel Projection minor fix => major rework
11-01-05 14:07 nigel ETA < 1 week => none
12-05-05 09:40 nigel Relationship deleted child of 0000016
12-05-05 09:40 nigel Relationship added parent of 0000016

  


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