Sha256: 11915b5263c1b23830b63d6ee96d9c7abb0d6c5a7882ea993d89e1818df0c093

Contents?: true

Size: 1.26 KB

Versions: 2

Compression:

Stored size: 1.26 KB

Contents

(function()
{
	typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;

	function Brush()
	{
		var constants	= 'FALSE NULL TRUE';

		var keywords	= 'break continue else export for foreach function global_var if ' +
				  'import include local_var repeat return until while namespace object ' +
                                  'var public private case switch default do';

		this.regexList = [
			{ regex: SyntaxHighlighter.regexLib.singleLinePerlComments,		css: 'comment' },

			{ regex: SyntaxHighlighter.regexLib.doubleQuotedString,			css: 'string' },
			{ regex: SyntaxHighlighter.regexLib.singleQuotedString,			css: 'string' },
			{ regex: new RegExp('\\b[0-9]+\\b', 'gm'),				css: 'number' },

			{ regex: new RegExp(this.getKeywords(constants), 'gm'),			css: 'constant' },
			{ regex: new RegExp(this.getKeywords(keywords), 'gm'),			css: 'keyword' },

			{ regex: new RegExp('\\b[A-Za-z_][A-Za-z0-9_]*\\b(?=\\s*\\()', 'gm'),	css: 'function' },
			{ regex: new RegExp('\\b[A-Za-z_][A-Za-z0-9_]*\\b(?!\\s*\\()', 'gm'),	css: 'variable' }
		];
	};

	Brush.prototype	= new SyntaxHighlighter.Highlighter();
	Brush.aliases	= ['nasl'];

	SyntaxHighlighter.brushes.Nasl = Brush;

	typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
})();

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
nasldoc-0.4.2 lib/nasldoc/assets/js/shBrushNasl.js
nasldoc-0.3.2 lib/nasldoc/assets/js/shBrushNasl.js