PageRenderTime 25ms CodeModel.GetById 20ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/BlogEngine/BlogEngine.NET/App_Code/Extensions/CodeFormatter/JavaScriptFormat.cs

#
C# | 64 lines | 31 code | 5 blank | 28 comment | 0 complexity | 31e540d0e6ddadd38fac3c82301684c6 MD5 | raw file
 1#region Copyright © 2001-2003 Jean-Claude Manoli [jc@manoli.net]
 2
 3/*
 4 * This software is provided 'as-is', without any express or implied warranty.
 5 * In no event will the author(s) be held liable for any damages arising from
 6 * the use of this software.
 7 * 
 8 * Permission is granted to anyone to use this software for any purpose,
 9 * including commercial applications, and to alter it and redistribute it
10 * freely, subject to the following restrictions:
11 * 
12 *   1. The origin of this software must not be misrepresented; you must not
13 *      claim that you wrote the original software. If you use this software
14 *      in a product, an acknowledgment in the product documentation would be
15 *      appreciated but is not required.
16 * 
17 *   2. Altered source versions must be plainly marked as such, and must not
18 *      be misrepresented as being the original software.
19 * 
20 *   3. This notice may not be removed or altered from any source distribution.
21 */
22#endregion
23
24namespace CodeFormatter
25{
26    /// <summary>
27    /// Generates color-coded HTML 4.01 from JavaSctript source code.
28    /// </summary>
29    public class JavaScriptFormat : CLikeFormat
30    {
31        #region Properties
32
33        /// <summary>
34        ///     The list of JavaScript keywords.
35        /// </summary>
36        protected override string Keywords
37        {
38            get
39            {
40                return "var function abstract as base bool break byte case catch char " +
41                       "checked class const continue decimal default delegate do double else " +
42                       "enum event explicit extern false finally fixed float for foreach goto " +
43                       "if implicit in int interface internal is lock long namespace new null " +
44                       "object operator out override params private protected public readonly " +
45                       "ref return sbyte sealed short sizeof stackalloc static string struct " +
46                       "switch this throw true try typeof uint ulong unchecked unsafe ushort " +
47                       "using virtual void while";
48            }
49        }
50
51        /// <summary>
52        ///     Use the pre-processor color to mark directives that start with @.
53        /// </summary>
54        protected override string Preprocessors
55        {
56            get
57            {
58                return @"@\w*";
59            }
60        }
61
62        #endregion
63    }
64}