1
1
// brush: "javascript" aliases: ["js", "actionscript"]
3
// This file is part of the "jQuery.Syntax" project, and is licensed under the GNU AGPLv3.
4
// Copyright 2010 Samuel Williams. All rights reserved.
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
5
// See <jquery.syntax.js> for licensing details.
7
7
Syntax.register('javascript', function(brush) {
8
var keywords = ["break", "case", "catch", "continue", "default", "delete", "do", "else", "for", "if", "in", "instanceof", "new", "return", "super", "switch", "throw", "true", "try", "typeof", "var", "while", "with", "prototype"];
8
var keywords = ["function", "break", "case", "catch", "continue", "default", "delete", "do", "else", "for", "if", "in", "instanceof", "new", "return", "super", "switch", "throw", "true", "try", "typeof", "var", "while", "with", "prototype"];
10
10
var operators = ["+", "*", "/", "-", "&", "|", "~", "!", "%", "<", "=", ">"];
11
var values = ["function", "this", "true", "false", "null"];
11
var values = ["this", "true", "false", "null"];
13
13
brush.push(values, {klass: 'constant'});
14
14
brush.push(keywords, {klass: 'keyword'});
15
15
brush.push(operators, {klass: 'operator'});
17
// Regular expressions
18
brush.push(Syntax.lib.perlStyleRegularExpressions);
17
20
// Camel Case Types
18
21
brush.push(Syntax.lib.camelCaseType);