aboutsummaryrefslogtreecommitdiff
path: root/compiler/src/dotty/tools/dotc/util/kwords.sc
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/src/dotty/tools/dotc/util/kwords.sc')
-rw-r--r--compiler/src/dotty/tools/dotc/util/kwords.sc18
1 files changed, 18 insertions, 0 deletions
diff --git a/compiler/src/dotty/tools/dotc/util/kwords.sc b/compiler/src/dotty/tools/dotc/util/kwords.sc
new file mode 100644
index 000000000..94c17eaf4
--- /dev/null
+++ b/compiler/src/dotty/tools/dotc/util/kwords.sc
@@ -0,0 +1,18 @@
+package dotty.tools.dotc.util
+
+import dotty.tools.dotc.parsing._
+import Scanners._
+import Tokens._
+
+object kwords {
+ println("Welcome to the Scala worksheet") //> Welcome to the Scala worksheet
+ keywords.toList.map(tokenString) //> res0: List[String] = List(if, for, else, this, null, new, with, super, case,
+ //| case class, case object, val, abstract, final, private, protected, override
+ //| , implicit, var, def, type, extends, true, false, object, class, import, pac
+ //| kage, yield, do, trait, sealed, throw, try, catch, finally, while, return, m
+ //| atch, lazy, then, forSome, _, :, =, <-, =>, ';', ';', <:, >:, #, @, <%)
+ keywords.toList.filter(kw => tokenString(kw) == null)
+ //> res1: List[Int] = List()
+ canStartStatTokens contains CASE //> res2: Boolean = false
+
+} \ No newline at end of file