Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
56 additions
and
0 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
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
Language: JavaScript REPL | ||
Requires: javascript.js | ||
Author: Marat Nagayev <nagaevmt@yandex.ru> | ||
Category: common | ||
*/ | ||
|
||
export default function(hljs) { | ||
return { | ||
name: 'JavaScript REPL', | ||
contains: [ | ||
{ | ||
className: 'meta', | ||
starts: { | ||
// a space separates the REPL prefix from the actual code | ||
// this is purely for cleaner HTML output | ||
end: / |$/, | ||
starts: { | ||
end: '$', subLanguage: 'javascript' | ||
} | ||
}, | ||
variants: [ | ||
{ begin: /^>(?=[ ]|$)/ }, | ||
{ begin: /^\.\.\.(?=[ ]|$)/ } | ||
] | ||
}, | ||
] | ||
} | ||
} | ||
|
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
> a = "1" | ||
'1' | ||
> function b(){ | ||
... return 1+2; |
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<span class="hljs-meta">></span> <span class="javascript"><span class="hljs-keyword">for</span>(<span class="hljs-keyword">let</span> i=<span class="hljs-number">0</span>;i<<span class="hljs-number">5</span>;i++){</span> | ||
<span class="hljs-meta">...</span> <span class="javascript"><span class="hljs-built_in">console</span>.log(i);</span> | ||
<span class="hljs-meta">...</span> <span class="javascript">}</span> | ||
0 | ||
1 | ||
2 | ||
3 | ||
4 | ||
undefined | ||
<span class="hljs-meta">></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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
> for(let i=0;i<5;i++){ | ||
... console.log(i); | ||
... } | ||
0 | ||
1 | ||
2 | ||
3 | ||
4 | ||
undefined | ||
> |