summaryrefslogtreecommitdiff
path: root/support
diff options
context:
space:
mode:
authormichelou <michelou@epfl.ch>2005-10-22 11:42:41 +0000
committermichelou <michelou@epfl.ch>2005-10-22 11:42:41 +0000
commitf49c6bd79b587496957347119d0f685d7e491612 (patch)
tree36c16772a48f67cfc1038a0cb3ad6de1c862643c /support
parent528a6580ed2d404820fb337181c6ba059120d68a (diff)
downloadscala-f49c6bd79b587496957347119d0f685d7e491612.tar.gz
scala-f49c6bd79b587496957347119d0f685d7e491612.tar.bz2
scala-f49c6bd79b587496957347119d0f685d7e491612.zip
- Some Scala templates for the ConTEXT editor.
Diffstat (limited to 'support')
-rw-r--r--support/context/Template/Scala.ctpl75
1 files changed, 75 insertions, 0 deletions
diff --git a/support/context/Template/Scala.ctpl b/support/context/Template/Scala.ctpl
new file mode 100644
index 0000000000..ed5486f70f
--- /dev/null
+++ b/support/context/Template/Scala.ctpl
@@ -0,0 +1,75 @@
+[class | Scala class template]
+class |MyClass {
+
+}
+
+[def | function definition]
+def |myFunc(): = {
+}
+
+[exit | System.exit]
+System.exit(|);
+
+[for | for comprehensions]
+for (val i <- |) {}
+
+[if | if expression]
+if (|) {
+
+}
+
+[ife | if-else expression]
+if (|) {
+
+}
+else {
+
+}
+
+[main | Scala program template]
+object |Main {
+
+ /** Code documentation here */
+ def main(args: Array[String]): Unit = {
+ /* multi-line and semi-line comments here */
+ // one-line comments here
+ Console.println("Hello, world");
+ }
+
+}
+
+[match | match expression]
+| match {
+ case =>
+ case _ =>
+}
+
+[Pair | Pair object]
+Pair(|, )
+
+[println | Console.println]
+Console.println(|);
+
+[trait | Scala trait template]
+trait |MyTrait {
+}
+
+[try | try-catch block]
+try {
+ |
+}
+catch {
+ case e: Exception =>
+ Console.println("Unexpected exception");
+ e.printStackTrace();
+}
+
+[val | value definition]
+val | = ;
+
+[while | while block]
+var i=0;
+while (i < |) {
+
+ i = i + 1;
+}