Browse files

Merge pull request #52 from StewShack/master

Updated csharp to bypass_defaults = true
  • Loading branch information...
2 parents 16b5b2e + 4c4700c commit ea2fec48b3804068eac8a6ce5cf690b8248daf7d @ccampbell committed May 10, 2012
Showing with 22 additions and 22 deletions.
  1. +12 −12 js/language/csharp.js
  2. +9 −9 tests/language/csharp-test.js
  3. +1 −1 util/builder.py
View
24 js/language/csharp.js
@@ -1,15 +1,15 @@
/**
- * C# patterns
- *
- * @author Dan Stewart
- * @version 1.0
- * Do not use generic.js with this.
- */
+* C# patterns
+*
+* @author Dan Stewart
+* @version 1.1
+* Do not use generic.js with this.
+*/
Rainbow.extend('csharp', [
{
// @see http://msdn.microsoft.com/en-us/library/23954zh5.aspx
- 'name': 'constant',
- 'pattern': /\b(false|null|true)\b/g
+ 'name': 'constant',
+ 'pattern': /\b(false|null|true)\b/g
},
{
// @see http://msdn.microsoft.com/en-us/library/x53a06bb%28v=vs.100%29.aspx
@@ -58,7 +58,7 @@ Rainbow.extend('csharp', [
'name': 'support.class',
'pattern': /\w+/g
}
-
+
},
'pattern': /\b(new)\s([^\$].*?)(?=\)|\(|;|&)/g
},
@@ -76,13 +76,13 @@ Rainbow.extend('csharp', [
},
{
'name': 'operator',
- // http://msdn.microsoft.com/en-us/library/6a71f45d%28v=vs.100%29.aspx
+ // @see http://msdn.microsoft.com/en-us/library/6a71f45d%28v=vs.100%29.aspx
// ++ += + -- -= - <<= << <= => >>= >> >= != ! ~ ^ || && &= & ?? :: : *= * |= %= |= == =
'pattern': /(\+\+|\+=|\+|--|-=|-|&lt;&lt;=|&lt;&lt;|&lt;=|=&gt;|&gt;&gt;=|&gt;&gt;|&gt;=|!=|!|~|\^|\|\||&amp;&amp;|&amp;=|&amp;|\?\?|::|:|\*=|\*|\/=|%=|\|=|==|=)/g
},
{
- // http://msdn.microsoft.com/en-us/library/ed8yd1ha%28v=vs.100%29.aspx
+ // @see http://msdn.microsoft.com/en-us/library/ed8yd1ha%28v=vs.100%29.aspx
'name': 'preprocessor',
'pattern': /(\#if|\#else|\#elif|\#endif|\#define|\#undef|\#warning|\#error|\#line|\#region|\#endregion|\#pragma)[\s\S]*?$/gm
}
-]);
+], true);
View
18 tests/language/csharp-test.js
@@ -2,7 +2,7 @@
* C# tests
*
* @author Dan Stewart
- * These tests assume all rainbow js files are loaded.
+ * The csharp.js file is configured to not load generic.js
*/
RainbowTester.startTest('csharp');
@@ -11,7 +11,7 @@ RainbowTester.run(
'Console.WriteLine("hello world");',
- 'Console.<span class="function call">WriteLine</span>(<span class="string">"hello world"</span>);'
+ 'Console.WriteLine(<span class="string">"hello world"</span>);'
);
RainbowTester.run(
@@ -35,7 +35,7 @@ RainbowTester.run(
"var is_array_object = typeof(System.Array);",
- '<span class="keyword">var</span> is_array_object <span class="operator">=</span> <span class="keyword">typeof</span>(System.<span class="keyword">Array</span>);'
+ '<span class="keyword">var</span> is_array_object <span class="operator">=</span> <span class="keyword">typeof</span>(System.Array);'
);
RainbowTester.run(
@@ -109,7 +109,7 @@ RainbowTester.run(
'static void doSomethingElse() {}',
- '<span class="keyword">static</span> <span class="keyword">void</span> <span class="function call">doSomethingElse</span>() {}'
+ '<span class="keyword">static</span> <span class="keyword">void</span> doSomethingElse() {}'
);
RainbowTester.run(
@@ -120,7 +120,7 @@ RainbowTester.run(
' // do whatever\n' +
'}',
- '<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' +
+ '<span class="keyword">protected</span> <span class="keyword">void</span> Page_Load(<span class="keyword">object</span> sender, EventArgs e)\n' +
'{\n' +
' <span class="comment">// do whatever</span>\n' +
'}'
@@ -147,23 +147,23 @@ RainbowTester.run(
'var path = Sonic.App.getInstance();',
- '<span class="keyword">var</span> path <span class="operator">=</span> Sonic.App.<span class="function call">getInstance</span>();'
+ '<span class="keyword">var</span> path <span class="operator">=</span> Sonic.App.getInstance();'
);
RainbowTester.run(
'type hint',
'public static string getForUser(User user, Sort sort) {}',
- '<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) {}'
+ '<span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">string</span> getForUser(User user, Sort sort) {}'
);
RainbowTester.run(
'generics',
'public IList&lt;string&gt; firstNames = new List&lt;string&gt;()',
- '<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>()'
+ '<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;()'
);
-RainbowTester.endTest('csharp');
+RainbowTester.endTest('csharp');
View
2 util/builder.py
@@ -14,7 +14,7 @@ def __init__(self, js_path, closure_path, theme_path=None):
self.versions = {
'c': '1.0.6',
- 'csharp': '1.0',
+ 'csharp': '1.1',
'css': '1.0.7',
'generic': '1.0.9',
'html': '1.0.6',

0 comments on commit ea2fec4

Please sign in to comment.