PHP Classes


Recommend this page to a friend!
  Classes of Andrea Giammarchi   SourceMap   Download  
Role: Auxiliary data
Content type: text/plain
Description: Python Delimeters Example
Class: SourceMap
Tokenize source code in several languages
Author: By
Last change:
Date: 17 years ago
Size: 1,584 bytes


Class file image Download
# JavaScript genric delimeter [C# too without last array] jsRules = [ {"name":"doublequote", "start":'"', "end":'"', "noslash":True}, {"name":"singlequote", "start":"'", "end":"'", "noslash":True}, {"name":"singlelinecomment", "start":"//", "end":["\n", "\r"]}, {"name":"multilinecomment", "start":"/*", "end":"*/"}, {"name":"regexp", "start":"/", "end":"/", "match":"^/[^\n\r]+/$", "noslash":True} ] # PHP genric delimeter phpRules = [ {"name":"doublequote", "start":'"', "end":'"', "noslash":True}, {"name":"singlequote", "start":"'", "end":"'", "noslash":True}, {"name":"singlelinecomment", "start":"//", "end":["\n", "\r"]}, {"name":"singlelinecomment", "start":"#", "end":["\n", "\r"]}, {"name":"multilinecomment", "start":"/*", "end":"*/"} ] # PHP embed in HTML genric delimeter embedPhpRules = [ {"name":"phpcode", "start":"<?php", "end":"?>", "noslash":True}, {"name":"phpcode", "start":"<?", "end":"?>", "noslash":True}, {"name":"doublequote", "start":'"', "end":'"', "noslash":True}, {"name":"singlequote", "start":"'", "end":"'", "noslash":True}, {"name":"singlelinecomment", "start":"//", "end":["\n", "\r"]}, {"name":"singlelinecomment", "start":"#", "end":["\n", "\r"]}, {"name":"multilinecomment", "start":"/*", "end":"*/"} ] # Python genric delimeter pythonRules = [ {"name":"multiquote", "start":'"""', "end":'"""'}, {"name":"doublequote", "start":'"', "end":'"', "noslash":True}, {"name":"singlequote", "start":"'", "end":"'", "noslash":True}, {"name":"singlelinecomment", "start":"#", "end":["\n", "\r"]} ]