Skip to content

Commit 2c40d85

Browse files
committed
add class markup test
1 parent 58eeb07 commit 2c40d85

File tree

3 files changed

+26
-1
lines changed

3 files changed

+26
-1
lines changed

scripts/setup.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@
33
export PLAYGROUND="playground"
44
export HIGHLIGHTJS_RASCRIPT="${PLAYGROUND}/extra/highlightjs-rascript"
55
export RASCRIPT_SYNTAX_VERSION="v0.2.0"
6+
export HIGHLIGHTJS_VERSION="11.11.1"
67

78
rm -rf ${PLAYGROUND}
89
mkdir -p ${PLAYGROUND}
910
git clone https://github.com/highlightjs/highlight.js ${PLAYGROUND}
1011
cd ${PLAYGROUND}
11-
git checkout tags/11.11.1
12+
git checkout tags/${HIGHLIGHTJS_VERSION}
1213
cd ..
1314
wget -O rascript-upstream.js "https://github.com/joshraphael/rascript-syntax/releases/download/${RASCRIPT_SYNTAX_VERSION}/rascript.js"
1415
mkdir -p ${HIGHLIGHTJS_RASCRIPT}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<span class="hljs-keyword">class</span> <span class="hljs-variable">Test</span>
2+
{
3+
<span class="hljs-variable">t_test</span> = <span class="hljs-number">0</span>
4+
5+
<span class="hljs-keyword">function</span> <span class="hljs-title function_ invoke__">DoSomething</span>(<span class="hljs-variable">arg1</span>, <span class="hljs-variable">arg2</span>) {
6+
<span class="hljs-variable language_">this</span>.<span class="hljs-variable">t_test</span> = <span class="hljs-variable">arg1</span> <span class="hljs-operator">+</span> <span class="hljs-variable">arg2</span>
7+
}
8+
9+
<span class="hljs-keyword">function</span> <span class="hljs-title function_ invoke__">GetSomething</span>() {
10+
<span class="hljs-keyword">return</span> <span class="hljs-variable language_">this</span>.<span class="hljs-variable">t_test</span>
11+
}
12+
}

test/markup/rascript/class.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
class Test
2+
{
3+
t_test = 0
4+
5+
function DoSomething(arg1, arg2) {
6+
this.t_test = arg1 + arg2
7+
}
8+
9+
function GetSomething() {
10+
return this.t_test
11+
}
12+
}

0 commit comments

Comments
 (0)