diff options
author | Martin Odersky <odersky@gmail.com> | 2013-06-17 01:25:14 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2013-06-17 01:25:14 +0200 |
commit | 3c7936515a9aaf383b453fe5844598fd53a2e551 (patch) | |
tree | 82a581b7f5fc3c7abb4c6c56721a4118465db7ab /src/dotty/tools/dotc/typer/Modes.scala | |
parent | c190626eb0a7c6a314429bb4f3c498da989395fc (diff) | |
download | dotty-3c7936515a9aaf383b453fe5844598fd53a2e551.tar.gz dotty-3c7936515a9aaf383b453fe5844598fd53a2e551.tar.bz2 dotty-3c7936515a9aaf383b453fe5844598fd53a2e551.zip |
Added typer.Mode
Replaces desugar.Mode. Is now a value class representing a set.
Diffstat (limited to 'src/dotty/tools/dotc/typer/Modes.scala')
-rw-r--r-- | src/dotty/tools/dotc/typer/Modes.scala | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/dotty/tools/dotc/typer/Modes.scala b/src/dotty/tools/dotc/typer/Modes.scala new file mode 100644 index 000000000..edcbc79b4 --- /dev/null +++ b/src/dotty/tools/dotc/typer/Modes.scala @@ -0,0 +1,18 @@ +package dotty.tools.dotc.typer + +case class Mode(val bits: Int) extends AnyVal { + def | (that: Mode) = Mode(bits | that.bits) + def & (that: Mode) = Mode(bits & that.bits) + def &~ (that: Mode) = Mode(bits & ~that.bits) + def is (that: Mode) = (bits & that.bits) == that.bits +} + +object Mode { + val None = Mode(1 << 0) + + val Expr = Mode(1 << 1) + val Pattern = Mode(1 << 2) + val Type = Mode(1 << 3) + + +}
\ No newline at end of file |