Skip to content
This repository
Browse code

Merge pull request #52 from StewShack/master

Updated csharp to bypass_defaults = true
  • Loading branch information...
commit ea2fec48b3804068eac8a6ce5cf690b8248daf7d 2 parents 16b5b2e + 4c4700c
Craig Campbell authored
24 js/language/csharp.js
... ... @@ -1,15 +1,15 @@
1 1 /**
2   - * C# patterns
3   - *
4   - * @author Dan Stewart
5   - * @version 1.0
6   - * Do not use generic.js with this.
7   - */
  2 +* C# patterns
  3 +*
  4 +* @author Dan Stewart
  5 +* @version 1.1
  6 +* Do not use generic.js with this.
  7 +*/
8 8 Rainbow.extend('csharp', [
9 9 {
10 10 // @see http://msdn.microsoft.com/en-us/library/23954zh5.aspx
11   - 'name': 'constant',
12   - 'pattern': /\b(false|null|true)\b/g
  11 + 'name': 'constant',
  12 + 'pattern': /\b(false|null|true)\b/g
13 13 },
14 14 {
15 15 // @see http://msdn.microsoft.com/en-us/library/x53a06bb%28v=vs.100%29.aspx
@@ -58,7 +58,7 @@ Rainbow.extend('csharp', [
58 58 'name': 'support.class',
59 59 'pattern': /\w+/g
60 60 }
61   -
  61 +
62 62 },
63 63 'pattern': /\b(new)\s([^\$].*?)(?=\)|\(|;|&)/g
64 64 },
@@ -76,13 +76,13 @@ Rainbow.extend('csharp', [
76 76 },
77 77 {
78 78 'name': 'operator',
79   - // http://msdn.microsoft.com/en-us/library/6a71f45d%28v=vs.100%29.aspx
  79 + // @see http://msdn.microsoft.com/en-us/library/6a71f45d%28v=vs.100%29.aspx
80 80 // ++ += + -- -= - <<= << <= => >>= >> >= != ! ~ ^ || && &= & ?? :: : *= * |= %= |= == =
81 81 'pattern': /(\+\+|\+=|\+|--|-=|-|&lt;&lt;=|&lt;&lt;|&lt;=|=&gt;|&gt;&gt;=|&gt;&gt;|&gt;=|!=|!|~|\^|\|\||&amp;&amp;|&amp;=|&amp;|\?\?|::|:|\*=|\*|\/=|%=|\|=|==|=)/g
82 82 },
83 83 {
84   - // http://msdn.microsoft.com/en-us/library/ed8yd1ha%28v=vs.100%29.aspx
  84 + // @see http://msdn.microsoft.com/en-us/library/ed8yd1ha%28v=vs.100%29.aspx
85 85 'name': 'preprocessor',
86 86 'pattern': /(\#if|\#else|\#elif|\#endif|\#define|\#undef|\#warning|\#error|\#line|\#region|\#endregion|\#pragma)[\s\S]*?$/gm
87 87 }
88   -]);
  88 +], true);
18 tests/language/csharp-test.js
@@ -2,7 +2,7 @@
2 2 * C# tests
3 3 *
4 4 * @author Dan Stewart
5   - * These tests assume all rainbow js files are loaded.
  5 + * The csharp.js file is configured to not load generic.js
6 6 */
7 7 RainbowTester.startTest('csharp');
8 8
@@ -11,7 +11,7 @@ RainbowTester.run(
11 11
12 12 'Console.WriteLine("hello world");',
13 13
14   - 'Console.<span class="function call">WriteLine</span>(<span class="string">"hello world"</span>);'
  14 + 'Console.WriteLine(<span class="string">"hello world"</span>);'
15 15 );
16 16
17 17 RainbowTester.run(
@@ -35,7 +35,7 @@ RainbowTester.run(
35 35
36 36 "var is_array_object = typeof(System.Array);",
37 37
38   - '<span class="keyword">var</span> is_array_object <span class="operator">=</span> <span class="keyword">typeof</span>(System.<span class="keyword">Array</span>);'
  38 + '<span class="keyword">var</span> is_array_object <span class="operator">=</span> <span class="keyword">typeof</span>(System.Array);'
39 39 );
40 40
41 41 RainbowTester.run(
@@ -109,7 +109,7 @@ RainbowTester.run(
109 109
110 110 'static void doSomethingElse() {}',
111 111
112   - '<span class="keyword">static</span> <span class="keyword">void</span> <span class="function call">doSomethingElse</span>() {}'
  112 + '<span class="keyword">static</span> <span class="keyword">void</span> doSomethingElse() {}'
113 113 );
114 114
115 115 RainbowTester.run(
@@ -120,7 +120,7 @@ RainbowTester.run(
120 120 ' // do whatever\n' +
121 121 '}',
122 122
123   - '<span class="keyword">protected</span> <span class="keyword">void</span> <span class="function call">Page_Load</span>(<span class="keyword">object</span> sender, EventArgs e)\n' +
  123 + '<span class="keyword">protected</span> <span class="keyword">void</span> Page_Load(<span class="keyword">object</span> sender, EventArgs e)\n' +
124 124 '{\n' +
125 125 ' <span class="comment">// do whatever</span>\n' +
126 126 '}'
@@ -147,7 +147,7 @@ RainbowTester.run(
147 147
148 148 'var path = Sonic.App.getInstance();',
149 149
150   - '<span class="keyword">var</span> path <span class="operator">=</span> Sonic.App.<span class="function call">getInstance</span>();'
  150 + '<span class="keyword">var</span> path <span class="operator">=</span> Sonic.App.getInstance();'
151 151 );
152 152
153 153 RainbowTester.run(
@@ -155,7 +155,7 @@ RainbowTester.run(
155 155
156 156 'public static string getForUser(User user, Sort sort) {}',
157 157
158   - '<span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">string</span> <span class="function call">getForUser</span>(User user, Sort sort) {}'
  158 + '<span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">string</span> getForUser(User user, Sort sort) {}'
159 159 );
160 160
161 161 RainbowTester.run(
@@ -163,7 +163,7 @@ RainbowTester.run(
163 163
164 164 'public IList&lt;string&gt; firstNames = new List&lt;string&gt;()',
165 165
166   - '<span class="keyword">public</span> IList<span class="keyword operator">&lt;</span><span class="keyword">string</span><span class="keyword operator">&gt;</span> firstNames <span class="operator">=</span> <span class="keyword new">new</span> <span class="support class">List</span><span class="keyword operator">&lt;</span><span class="keyword">string</span><span class="keyword operator">&gt;</span>()'
  166 + '<span class="keyword">public</span> IList&lt;<span class="keyword">string</span>&gt; firstNames <span class="operator">=</span> <span class="keyword new">new</span> <span class="support class">List</span>&lt;<span class="keyword">string</span>&gt;()'
167 167 );
168 168
169   -RainbowTester.endTest('csharp');
  169 +RainbowTester.endTest('csharp');
2  util/builder.py
@@ -14,7 +14,7 @@ def __init__(self, js_path, closure_path, theme_path=None):
14 14
15 15 self.versions = {
16 16 'c': '1.0.6',
17   - 'csharp': '1.0',
  17 + 'csharp': '1.1',
18 18 'css': '1.0.7',
19 19 'generic': '1.0.9',
20 20 'html': '1.0.6',

0 comments on commit ea2fec4

Please sign in to comment.
Something went wrong with that request. Please try again.