From 50f1ca930974a1c805a15fb2b5d35ae5721cd494 Mon Sep 17 00:00:00 2001 From: Thibaut Date: Sun, 6 Apr 2014 15:07:41 -0400 Subject: [PATCH] Update Prism.js and Go syntax --- assets/javascripts/vendor/prism.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/assets/javascripts/vendor/prism.js b/assets/javascripts/vendor/prism.js index e92be7ff..d5e0dc72 100644 --- a/assets/javascripts/vendor/prism.js +++ b/assets/javascripts/vendor/prism.js @@ -451,7 +451,7 @@ Prism.languages.clike = { }; ; Prism.languages.javascript = Prism.languages.extend('clike', { - 'keyword': /\b(var|let|if|else|while|do|for|return|in|instanceof|function|new|with|typeof|try|throw|catch|finally|null|break|continue)\b/g, + 'keyword': /\b(var|let|if|else|while|do|for|return|in|instanceof|function|get|set|new|with|typeof|try|throw|catch|finally|null|break|continue|this)\b/g, 'number': /\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?|NaN|-?Infinity)\b/g }); @@ -551,3 +551,13 @@ Prism.languages.insertBefore('ruby', 'keyword', { 'symbol': /:\b[a-zA-Z_][a-zA-Z_0-9]*[?!]?\b/g }); ; +Prism.languages.go = Prism.languages.extend('clike', { + 'keyword': /\b(break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/g, + 'builtin': /\b(bool|byte|complex(64|128)|error|float(32|64)|rune|string|u?int(8|16|32|64|)|uintptr|append|cap|close|complex|copy|delete|imag|len|make|new|panic|print(ln)?|real|recover)\b/g, + 'boolean': /\b(_|iota|nil|true|false)\b/g, + 'operator': /([(){}\[\]]|[*\/%^!]=?|\+[=+]?|-[>=-]?|\|[=|]?|>[=>]?|<(<|[=-])?|==?|&(&|=|^=?)?|\.(\.\.)?|[,;]|:=?)/g, + 'number': /\b(-?(0x[a-f\d]+|(\d+\.?\d*|\.\d+)(e[-+]?\d+)?)i?)\b/ig, + 'string': /("|'|`)(\\?.|\r|\n)*?\1/g +}); +delete Prism.languages.go['class-name']; +;