~ubuntu-branches/ubuntu/trusty/yelp-xsl/trusty

« back to all changes in this revision

Viewing changes to js/jquery.syntax.brush.go.js

  • Committer: Package Import Robot
  • Author(s): Michael Biebl
  • Date: 2012-03-19 17:46:00 UTC
  • mto: (11.1.2 experimental) (1.3.1)
  • mto: This revision was merged to the branch mainline in revision 15.
  • Revision ID: package-import@ubuntu.com-20120319174600-pzeaayow54b559hi
Tags: upstream-3.3.92
ImportĀ upstreamĀ versionĀ 3.3.92

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// brush: "go" aliases: []
 
2
 
 
3
//      This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License.
 
4
//      Copyright (c) 2011 Samuel G. D. Williams. <http://www.oriontransfer.co.nz>
 
5
//      See <jquery.syntax.js> for licensing details.
 
6
 
 
7
Syntax.register('go', function(brush) {
 
8
        var keywords = ["break", "default", "func", "interface", "select", "case", "defer", "go", "map", "struct", "chan", "else", "goto", "package", "switch", "const", "fallthrough", "if", "range", "type", "continue", "for", "import", "return", "var"];
 
9
        
 
10
        var types = [
 
11
                /u?int\d*/g,
 
12
                /float\d+/g,
 
13
                /complex\d+/g,
 
14
                "byte",
 
15
                "uintptr",
 
16
                "string",
 
17
        ];
 
18
        
 
19
        var operators = ["+", "&", "+=", "&=", "&&", "==", "!=", "-", "|", "-=", "|=", "||", "<", "<=", "*", "^", "*=", "^=", "<-", ">", ">=", "/", "<<", "/=", "<<=", "++", "=", ":=", ",", ";", "%", ">>", "%=", ">>=", "--", "!", "...", ".", ":", "&^", "&^="];
 
20
        
 
21
        var values = ["true", "false", "iota", "nil"];
 
22
        
 
23
        var functions = ["append", "cap", "close", "complex", "copy", "imag", "len", "make", "new", "panic", "print", "println", "real", "recover"];
 
24
        
 
25
        brush.push(values, {klass: 'constant'});
 
26
        brush.push(types, {klass: 'type'});
 
27
        brush.push(keywords, {klass: 'keyword'});
 
28
        brush.push(operators, {klass: 'operator'});
 
29
        brush.push(functions, {klass: 'function'});
 
30
        
 
31
        brush.push(Syntax.lib.cStyleFunction);
 
32
        
 
33
        brush.push(Syntax.lib.camelCaseType);
 
34
        
 
35
        brush.push(Syntax.lib.cStyleComment);
 
36
        brush.push(Syntax.lib.cppStyleComment);
 
37
        brush.push(Syntax.lib.webLink);
 
38
        
 
39
        // Strings
 
40
        brush.push(Syntax.lib.singleQuotedString);
 
41
        brush.push(Syntax.lib.doubleQuotedString);
 
42
        brush.push(Syntax.lib.stringEscape);
 
43
        
 
44
        // Numbers
 
45
        brush.push(Syntax.lib.decimalNumber);
 
46
        brush.push(Syntax.lib.hexNumber);
 
47
});