This repository has been archived on 2024-06-20. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
coffee.pygments/tests/examplefiles/xtend/example.xtend
Georg Brandl a447256385 conftest: disallow error tokens in examplefiles
They are ok in small snippets to demonstrate error cases.

Also recode all examplefiles to UTF-8.
2021-01-21 22:20:46 +01:00

34 lines
No EOL
741 B
Text

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
}
}