markwatkinson / luminous

Accurate and powerful syntax highlighting library
http://luminous.asgaard.co.uk
GNU Lesser General Public License v2.1
50 stars 5 forks source link

re-factor web languages into a generic scanner with subscanners #18

Closed markwatkinson closed 13 years ago

markwatkinson commented 13 years ago

The web scanners are a bit convoluted and repetitive.

PHP, Ruby and Django could in theory each share a generic scanner, which takes as subscanners: a web (PHP/Ruby/Django) scanner and a HTML scanner.

The code for context switching between the server side language and the client side language would be generic, it would just be the server-side scanner that would change. If I recall correctly, PHP and Rails are already factored much like this anyway and there's no reason they shouldn't be merged.

markwatkinson commented 13 years ago

After looking at it in a bit more detail, there are probably too many specific (special) cases to make it worthwhile.