Commit b8275198db0cb655ae476b0341e6a22a91008993

wayward710 2016-04-07T23:50:03

Fixed whitespaces, reordered tokens, used Gulp to min JS

diff --git a/components/prism-bro.js b/components/prism-bro.js
index d616083..4591d92 100644
--- a/components/prism-bro.js
+++ b/components/prism-bro.js
@@ -2,23 +2,21 @@ Prism.languages.bro = {
 
 	'comment': {
 		pattern: /(^|[^\\$])#.*/,
-		lookbehind: true
+		lookbehind: true,
+			inside: {
+				'italic':  /\b(TODO|FIXME|XXX)\b/
+		}
 	},
 
 	'string': /(["'])(\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
 
 	'boolean': /\b(T|F)\b/,
 
-	'keyword': 
-		/\b(break|next|continue|alarm|using|of|add|delete|export|print|return|schedule|when|timeout|addr|any|bool|count|double|enum|file|int|interval|pattern|opaque|port|record|set|string|subnet|table|time|vector|for|if|else|in|module)\b/,                     
-	            
-	'operator': /--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&|\|\|?|\?|\*|\/|~|\^|%/,
-
 	'function': {
-	    pattern: /(?:function|hook|event) [a-zA-Z0-9_]+(::[a-zA-Z0-9_]+)?/,
-	    inside: {
-	        keyword: /^(?:function|hook|event)/
-	    }
+		pattern: /(?:function|hook|event) [a-zA-Z0-9_]+(::[a-zA-Z0-9_]+)?/,
+		inside: {
+			keyword: /^(?:function|hook|event)/
+		}
 	},
 
 	'variable':	{
@@ -28,13 +26,8 @@ Prism.languages.bro = {
 		}
 	},
 
-	'number': /\b-?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)\b/i,
-
-	'italic':  /\b(TODO|FIXME|XXX)\b/,
-	'punctuation': /[{}[\];(),.:]/,
-
-	'builtin': 
-	    /(@(load(-(sigs|plugin))?|unload|prefixes|ifn?def|else|(end)?if|DIR|FILENAME))|(&?(redef|priority|log|optional|default|add_func|delete_func|expire_func|read_expire|write_expire|create_expire|synchronized|persistent|rotate_interval|rotate_size|encrypt|raw_output|mergeable|group|error_handler|type_column))/,           
+	'builtin':
+		/(@(load(-(sigs|plugin))?|unload|prefixes|ifn?def|else|(end)?if|DIR|FILENAME))|(&?(redef|priority|log|optional|default|add_func|delete_func|expire_func|read_expire|write_expire|create_expire|synchronized|persistent|rotate_interval|rotate_size|encrypt|raw_output|mergeable|group|error_handler|type_column))/,
 
 	'constant': {
 		pattern: /const [a-zA-Z0-9_]+/i,
@@ -42,4 +35,13 @@ Prism.languages.bro = {
 			keyword: /const/
 		}
 	},
+
+	'keyword': 
+		/\b(break|next|continue|alarm|using|of|add|delete|export|print|return|schedule|when|timeout|addr|any|bool|count|double|enum|file|int|interval|pattern|opaque|port|record|set|string|subnet|table|time|vector|for|if|else|in|module|function)\b/,
+
+	'operator': /--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&|\|\|?|\?|\*|\/|~|\^|%/,
+
+	'number': /\b-?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)\b/i,
+
+	'punctuation': /[{}[\];(),.:]/
 };
diff --git a/components/prism-bro.min.js b/components/prism-bro.min.js
index 5770f8f..bc8a649 100644
--- a/components/prism-bro.min.js
+++ b/components/prism-bro.min.js
@@ -1 +1 @@
-Prism.languages.bro={"comment":{pattern:/(^|[^\\$])#.*/,lookbehind:true},"string":/(["'])(\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,"boolean":/\b(T|F)\b/,"keyword":/\b(break|next|continue|alarm|using|of|add|delete|export|print|return|schedule|when|timeout|addr|any|bool|count|double|enum|file|int|interval|pattern|opaque|port|record|set|string|subnet|table|time|vector|for|if|else|in|module)\b/,"operator":/--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&|\|\|?|\?|\*|\/|~|\^|%/,"function":{pattern:/(?:function|hook|event) [a-zA-Z0-9_]+(::[a-zA-Z0-9_]+)?/,inside:{keyword:/^(?:function|hook|event)/}},"variable":{pattern:/(?:global|local) [a-zA-Z0-9_]+/i,inside:{keyword:/(?:global|local)/}},"number":/\b-?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)\b/i,"italic":/\b(TODO|FIXME|XXX)\b/,"punctuation":/[{}[\];(),.:]/,"builtin":/(@(load(-(sigs|plugin))?|unload|prefixes|ifn?def|else|(end)?if|DIR|FILENAME))|(&?(redef|priority|log|optional|default|add_func|delete_func|expire_func|read_expire|write_expire|create_expire|synchronized|persistent|rotate_interval|rotate_size|encrypt|raw_output|mergeable|group|error_handler|type_column))/,"constant":{pattern:/const [a-zA-Z0-9_]+/i,inside:{keyword:/const/}},};
\ No newline at end of file
+Prism.languages.bro={comment:{pattern:/(^|[^\\$])#.*/,lookbehind:!0,inside:{italic:/\b(TODO|FIXME|XXX)\b/}},string:/(["'])(\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,"boolean":/\b(T|F)\b/,"function":{pattern:/(?:function|hook|event) [a-zA-Z0-9_]+(::[a-zA-Z0-9_]+)?/,inside:{keyword:/^(?:function|hook|event)/}},variable:{pattern:/(?:global|local) [a-zA-Z0-9_]+/i,inside:{keyword:/(?:global|local)/}},builtin:/(@(load(-(sigs|plugin))?|unload|prefixes|ifn?def|else|(end)?if|DIR|FILENAME))|(&?(redef|priority|log|optional|default|add_func|delete_func|expire_func|read_expire|write_expire|create_expire|synchronized|persistent|rotate_interval|rotate_size|encrypt|raw_output|mergeable|group|error_handler|type_column))/,constant:{pattern:/const [a-zA-Z0-9_]+/i,inside:{keyword:/const/}},keyword:/\b(break|next|continue|alarm|using|of|add|delete|export|print|return|schedule|when|timeout|addr|any|bool|count|double|enum|file|int|interval|pattern|opaque|port|record|set|string|subnet|table|time|vector|for|if|else|in|module|function)\b/,operator:/--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&|\|\|?|\?|\*|\/|~|\^|%/,number:/\b-?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)\b/i,punctuation:/[{}[\];(),.:]/};
\ No newline at end of file
diff --git a/examples/prism-bro.html b/examples/prism-bro.html
index cddf567..73f0ab7 100644
--- a/examples/prism-bro.html
+++ b/examples/prism-bro.html
@@ -19,6 +19,7 @@
 <h2>Misc</h2>
 <pre><code>
 @ifndef ourexp
+@load-sigs somesigs
 </code></pre>
 
 <h2>Full example</h2>