~ubuntu-branches/ubuntu/quantal/awstats/quantal

« back to all changes in this revision

Viewing changes to docs/scripts/lang-sql.js

  • Committer: Bazaar Package Importer
  • Author(s): Jonas Smedegaard, Sergey B Kirpichev, Jonas Smedegaard
  • Date: 2011-03-12 19:44:25 UTC
  • mfrom: (1.2.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20110312194425-hn7bo427pgqw2smz
Tags: 7.0~dfsg-1
* New upstream release.
  Closes: bug#613447.

[ Sergey B Kirpichev ]
* Unfuzz patches.
* Update patch 1008.
* Drop obsolete patches.
* Fix +x bit on *.js in docs/examples
* Avoid asterisks in debian/NEWS entries, to please lintian.
* Fix recode bulgarian tooltips file as utf-8.
  Closes: bug#610632.
* Forward patches 0007 and 1015 upstream.
* Allow DM (Debian Maintainer) uploads.

[ Jonas Smedegaard ]
* Update copyright file:
  + Rewrite using Subversion rev.173 of draft DEP5 format.
  + Add some previously missed authors and licenses.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright (C) 2008 Google Inc.
 
2
//
 
3
// Licensed under the Apache License, Version 2.0 (the "License");
 
4
// you may not use this file except in compliance with the License.
 
5
// You may obtain a copy of the License at
 
6
//
 
7
//      http://www.apache.org/licenses/LICENSE-2.0
 
8
//
 
9
// Unless required by applicable law or agreed to in writing, software
 
10
// distributed under the License is distributed on an "AS IS" BASIS,
 
11
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 
12
// See the License for the specific language governing permissions and
 
13
// limitations under the License.
 
14
 
 
15
 
 
16
 
 
17
/**
 
18
 * @fileoverview
 
19
 * Registers a language handler for SQL.
 
20
 *
 
21
 *
 
22
 * To use, include prettify.js and this file in your HTML page.
 
23
 * Then put your code in an HTML tag like
 
24
 *      <pre class="prettyprint lang-sql">(my SQL code)</pre>
 
25
 *
 
26
 *
 
27
 * http://savage.net.au/SQL/sql-99.bnf.html is the basis for the grammar, and
 
28
 * http://msdn.microsoft.com/en-us/library/aa238507(SQL.80).aspx as the basis
 
29
 * for the keyword list.
 
30
 *
 
31
 * @author mikesamuel@gmail.com
 
32
 */
 
33
 
 
34
PR.registerLangHandler(
 
35
    PR.createSimpleLexer(
 
36
        [
 
37
         // Whitespace
 
38
         [PR.PR_PLAIN,       /^[\t\n\r \xA0]+/, null, '\t\n\r \xA0'],
 
39
         // A double or single quoted, possibly multi-line, string.
 
40
         [PR.PR_STRING,      /^(?:"(?:[^\"\\]|\\.)*"|'(?:[^\'\\]|\\.)*')/, null,
 
41
          '"\'']
 
42
        ],
 
43
        [
 
44
         // A comment is either a line comment that starts with two dashes, or
 
45
         // two dashes preceding a long bracketed block.
 
46
         [PR.PR_COMMENT, /^(?:--[^\r\n]*|\/\*[\s\S]*?(?:\*\/|$))/],
 
47
         [PR.PR_KEYWORD, /^(?:ADD|ALL|ALTER|AND|ANY|AS|ASC|AUTHORIZATION|BACKUP|BEGIN|BETWEEN|BREAK|BROWSE|BULK|BY|CASCADE|CASE|CHECK|CHECKPOINT|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMN|COMMIT|COMPUTE|CONSTRAINT|CONTAINS|CONTAINSTABLE|CONTINUE|CONVERT|CREATE|CROSS|CURRENT|CURRENT_DATE|CURRENT_TIME|CURRENT_TIMESTAMP|CURRENT_USER|CURSOR|DATABASE|DBCC|DEALLOCATE|DECLARE|DEFAULT|DELETE|DENY|DESC|DISK|DISTINCT|DISTRIBUTED|DOUBLE|DROP|DUMMY|DUMP|ELSE|END|ERRLVL|ESCAPE|EXCEPT|EXEC|EXECUTE|EXISTS|EXIT|FETCH|FILE|FILLFACTOR|FOR|FOREIGN|FREETEXT|FREETEXTTABLE|FROM|FULL|FUNCTION|GOTO|GRANT|GROUP|HAVING|HOLDLOCK|IDENTITY|IDENTITYCOL|IDENTITY_INSERT|IF|IN|INDEX|INNER|INSERT|INTERSECT|INTO|IS|JOIN|KEY|KILL|LEFT|LIKE|LINENO|LOAD|NATIONAL|NOCHECK|NONCLUSTERED|NOT|NULL|NULLIF|OF|OFF|OFFSETS|ON|OPEN|OPENDATASOURCE|OPENQUERY|OPENROWSET|OPENXML|OPTION|OR|ORDER|OUTER|OVER|PERCENT|PLAN|PRECISION|PRIMARY|PRINT|PROC|PROCEDURE|PUBLIC|RAISERROR|READ|READTEXT|RECONFIGURE|REFERENCES|REPLICATION|RESTORE|RESTRICT|RETURN|REVOKE|RIGHT|ROLLBACK|ROWCOUNT|ROWGUIDCOL|RULE|SAVE|SCHEMA|SELECT|SESSION_USER|SET|SETUSER|SHUTDOWN|SOME|STATISTICS|SYSTEM_USER|TABLE|TEXTSIZE|THEN|TO|TOP|TRAN|TRANSACTION|TRIGGER|TRUNCATE|TSEQUAL|UNION|UNIQUE|UPDATE|UPDATETEXT|USE|USER|VALUES|VARYING|VIEW|WAITFOR|WHEN|WHERE|WHILE|WITH|WRITETEXT)(?=[^\w-]|$)/i, null],
 
48
         // A number is a hex integer literal, a decimal real literal, or in
 
49
         // scientific notation.
 
50
         [PR.PR_LITERAL,
 
51
          /^[+-]?(?:0x[\da-f]+|(?:(?:\.\d+|\d+(?:\.\d*)?)(?:e[+\-]?\d+)?))/i],
 
52
         // An identifier
 
53
         [PR.PR_PLAIN, /^[a-z_][\w-]*/i],
 
54
         // A run of punctuation
 
55
         [PR.PR_PUNCTUATION, /^[^\w\t\n\r \xA0\"\'][^\w\t\n\r \xA0+\-\"\']*/]
 
56
        ]),
 
57
    ['sql']);