Login   Register  
PHP Classes
elePHPant
Icontem

File: delimeters.js

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Andrea Giammarchi  >  SourceMap  >  delimeters.js  >  Download  
File: delimeters.js
Role: Auxiliary data
Content type: text/plain
Description: JavaScript Delimeters Example
Class: SourceMap
Tokenize source code in several languages
Author: By
Last change:
Date: 8 years ago
Size: 1,009 bytes
 

Contents

Class file image Download
var
	// JavaScript genric delimeter [C# too without last object]
	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:'*/'}
	],

	// 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']}
	];