-
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix to use underscore suffixes for subscopes
Closes GH-43.
- Loading branch information
Showing
9 changed files
with
36 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
<span class="hljs-keyword">class</span> <span class="hljs-title hljs-class">Car</span> <span class="hljs-keyword">extends</span> <span class="hljs-title hljs-class hljs-inherited">Vehicle</span> { | ||
<span class="hljs-title hljs-function">constructor</span>(<span class="hljs-params">speed, cost</span>) { | ||
<span class="hljs-variable hljs-language">super</span>(speed); | ||
<span class="hljs-keyword">class</span> <span class="hljs-title class_">Car</span> <span class="hljs-keyword">extends</span> <span class="hljs-title class_ inherited__">Vehicle</span> { | ||
<span class="hljs-title function_">constructor</span>(<span class="hljs-params">speed, cost</span>) { | ||
<span class="hljs-variable language_">super</span>(speed); | ||
|
||
<span class="hljs-keyword">var</span> c = <span class="hljs-title hljs-class">Symbol</span>(<span class="hljs-string">'cost'</span>); | ||
<span class="hljs-variable hljs-language">this</span>[c] = cost; | ||
<span class="hljs-keyword">var</span> c = <span class="hljs-title class_">Symbol</span>(<span class="hljs-string">'cost'</span>); | ||
<span class="hljs-variable language_">this</span>[c] = cost; | ||
|
||
<span class="hljs-variable hljs-language">this</span>.<span class="hljs-property">intro</span> = <span class="hljs-string">`This is a car runs at | ||
<span class="hljs-variable language_">this</span>.<span class="hljs-property">intro</span> = <span class="hljs-string">`This is a car runs at | ||
<span class="hljs-subst">${speed}</span>.`</span>; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
<span class="hljs-keyword">function</span> <span class="hljs-title hljs-function">$initHighlight</span>(<span class="hljs-params">block, cls</span>) { | ||
<span class="hljs-keyword">function</span> <span class="hljs-title function_">$initHighlight</span>(<span class="hljs-params">block, cls</span>) { | ||
<span class="hljs-keyword">try</span> { | ||
<span class="hljs-keyword">if</span> (cls.<span class="hljs-title hljs-function">search</span>(<span class="hljs-regexp">/\bno\-highlight\b/</span>) != -<span class="hljs-number">1</span>) | ||
<span class="hljs-keyword">return</span> <span class="hljs-title hljs-function">process</span>(block, <span class="hljs-literal">true</span>, <span class="hljs-number">0x0F</span>) + | ||
<span class="hljs-keyword">if</span> (cls.<span class="hljs-title function_">search</span>(<span class="hljs-regexp">/\bno\-highlight\b/</span>) != -<span class="hljs-number">1</span>) | ||
<span class="hljs-keyword">return</span> <span class="hljs-title function_">process</span>(block, <span class="hljs-literal">true</span>, <span class="hljs-number">0x0F</span>) + | ||
<span class="hljs-string">' class=""'</span>; | ||
} <span class="hljs-keyword">catch</span> (e) { | ||
<span class="hljs-comment">/* handle exception */</span> | ||
} | ||
<span class="hljs-keyword">for</span> (<span class="hljs-keyword">var</span> i = <span class="hljs-number">0</span> / <span class="hljs-number">2</span>; i < classes.<span class="hljs-property">length</span>; i++) { | ||
<span class="hljs-keyword">if</span> (<span class="hljs-title hljs-function">checkCondition</span>(classes[i]) === <span class="hljs-literal">undefined</span>) | ||
<span class="hljs-keyword">if</span> (<span class="hljs-title function_">checkCondition</span>(classes[i]) === <span class="hljs-literal">undefined</span>) | ||
<span class="hljs-keyword">return</span> <span class="hljs-regexp">/\d+[\s/]/g</span>; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
<span class="hljs-comment">//------ underscore.js ------</span> | ||
<span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> <span class="hljs-keyword">function</span> (<span class="hljs-params">obj</span>) {}; | ||
<span class="hljs-keyword">export</span> <span class="hljs-keyword">function</span> <span class="hljs-title hljs-function">each</span>(<span class="hljs-params">obj, iterator, context</span>) {}; | ||
<span class="hljs-keyword">export</span> <span class="hljs-keyword">function</span> <span class="hljs-title function_">each</span>(<span class="hljs-params">obj, iterator, context</span>) {}; | ||
<span class="hljs-keyword">export</span> { each <span class="hljs-keyword">as</span> forEach }; | ||
<span class="hljs-keyword">export</span> <span class="hljs-keyword">function</span> <span class="hljs-title hljs-function">something</span>(<span class="hljs-params"></span>) {}; | ||
<span class="hljs-keyword">export</span> <span class="hljs-keyword">function</span> <span class="hljs-title function_">something</span>(<span class="hljs-params"></span>) {}; | ||
|
||
<span class="hljs-comment">//------ main.js ------</span> | ||
<span class="hljs-keyword">import</span> _, { each, something <span class="hljs-keyword">as</span> otherthing } <span class="hljs-keyword">from</span> <span class="hljs-string">'underscore'</span>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
<span class="hljs-keyword">fn</span> <span class="hljs-title hljs-function">sqr</span>(i: <span class="hljs-type">i32</span>) { i * i } | ||
<span class="hljs-keyword">trait</span> <span class="hljs-title hljs-class">Minimum</span> : <span class="hljs-built_in">Copy</span> {} | ||
<span class="hljs-keyword">pub</span> <span class="hljs-keyword">trait</span> <span class="hljs-title hljs-class">Builder</span> <span class="hljs-keyword">where</span> <span class="hljs-keyword">Self</span>: <span class="hljs-built_in">Sized</span> + <span class="hljs-built_in">Iterator</span><Item=Event> {} | ||
<span class="hljs-keyword">fn</span> <span class="hljs-title function_">sqr</span>(i: <span class="hljs-type">i32</span>) { i * i } | ||
<span class="hljs-keyword">trait</span> <span class="hljs-title class_">Minimum</span> : <span class="hljs-built_in">Copy</span> {} | ||
<span class="hljs-keyword">pub</span> <span class="hljs-keyword">trait</span> <span class="hljs-title class_">Builder</span> <span class="hljs-keyword">where</span> <span class="hljs-keyword">Self</span>: <span class="hljs-built_in">Sized</span> + <span class="hljs-built_in">Iterator</span><Item=Event> {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
<span class="hljs-keyword">protocol</span> <span class="hljs-title hljs-class">Protocol</span> { | ||
<span class="hljs-keyword">func</span> <span class="hljs-title hljs-function">f1</span>() | ||
<span class="hljs-keyword">func</span> <span class="hljs-title hljs-function">f2</span>() | ||
<span class="hljs-keyword">protocol</span> <span class="hljs-title class_">Protocol</span> { | ||
<span class="hljs-keyword">func</span> <span class="hljs-title function_">f1</span>() | ||
<span class="hljs-keyword">func</span> <span class="hljs-title function_">f2</span>() | ||
} | ||
|
||
<span class="hljs-keyword">class</span> <span class="hljs-title hljs-class">MyClass</span> { | ||
<span class="hljs-keyword">func</span> <span class="hljs-title hljs-function">f</span>() { | ||
<span class="hljs-keyword">class</span> <span class="hljs-title class_">MyClass</span> { | ||
<span class="hljs-keyword">func</span> <span class="hljs-title function_">f</span>() { | ||
<span class="hljs-keyword">return</span> <span class="hljs-literal">true</span> | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters