summaryrefslogtreecommitdiff
path: root/tests/examplefiles/example.xtend
diff options
context:
space:
mode:
authorSven Efftinge <sven@efftinge.de>2012-04-07 09:13:25 +0200
committerSven Efftinge <sven@efftinge.de>2012-04-07 09:13:25 +0200
commit99e64fc2fdce7497ea4e5f6a63cd84effbfa26e2 (patch)
tree04fab5282312d9358a5bc1112ba0133a3b61b1ca /tests/examplefiles/example.xtend
parentb70d989a1b9c06b62e816a65675402f8c44ab363 (diff)
downloadpygments-99e64fc2fdce7497ea4e5f6a63cd84effbfa26e2.tar.gz
Added lexer for Xtend http://xtend-lang.org
Diffstat (limited to 'tests/examplefiles/example.xtend')
-rw-r--r--tests/examplefiles/example.xtend34
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/examplefiles/example.xtend b/tests/examplefiles/example.xtend
new file mode 100644
index 00000000..f6a51f7a
--- /dev/null
+++ b/tests/examplefiles/example.xtend
@@ -0,0 +1,34 @@
+package beer
+
+import static extension beer.BottleSupport.*
+import org.junit.Test
+
+class BottleSong {
+
+ @Test
+ def void singIt() {
+ println(singTheSong(99))
+ }
+
+ def singTheSong(int all) '''
+ «FOR i : all .. 1»
+ «i.Bottles» of beer on the wall, «i.bottles» of beer.
+ Take one down and pass it around, «(i - 1).bottles» of beer on the wall.
+
+ «ENDFOR»
+ No more bottles of beer on the wall, no more bottles of beer.
+ Go to the store and buy some more, «all.bottles» of beer on the wall.
+ '''
+
+ def private java.lang.String bottles(int i) {
+ switch i {
+ case 0 : 'no more bottles'
+ case 1 : 'one bottle'
+ default : '''«i» bottles'''
+ }.toString
+ }
+
+ def String Bottles(int i) {
+ bottles(i).toFirstUpper
+ }
+} \ No newline at end of file