-
Notifications
You must be signed in to change notification settings - Fork 1
/
colorizeTest
67 lines (56 loc) · 1.27 KB
/
colorizeTest
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
Inline <code>case class Template()</code> done
<pre><code>
scala> val world="world"
scala> println ('>'+"hi "+world+"!")
</code></pre>
In between
<pre><code>
for( i <- 1 to 10 ) yield i
</code></pre>
<pre><code>
/* This is a code snippet */
<xml>
<child x="att"/>
<child2 />
</xml>
</code></pre>
<pre><code>
val sep = """\A?([\s<>=+-:;/\\+,!\(\)\{\}'\|\&\^\[\] ]?)"""
/**
* Scala doc
*/
case class Block(start:String, end:String, styleClass:String){
//Single line comment
val Contains="""(\A.*)(%s.*%s)(.*\z)""".format(start,end).r
val Starts="""^(.*)(%s.*\z)""".format(start).r
val Ends = """^(.*%s)(.*\z)""".format(end).r
/*
* many line comment
*/
override def toString = """Line 1
line2
line3"""
@Annotation
private def index(f:String=>Int)(line:String) = f(line) match {
case x if (x < 0) => None
case x => Some(x)
}
@Annotation def lastIndexOf = index(line => line.lastIndexOf(start)) _
@Annotation(param1="value")
def indexOf = index(line => line.indexOf(start)) _
val l = List[String]()
if( true != false ) println(Nan)
}
</code></pre>
<code class="Java">
/**
* Javadoc
*/
public static interface MyJavaInterface{
//a comment
/*
* another comment
*/
public static String hi = "goog";
}
</code>