-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rewrote the parser so it wouldn't choke on parenthesized lambdas.
Also, added two new tasty operators, << and >> (They do what you expect them to do)
- Loading branch information
1 parent
3024ba4
commit c7b6e7f
Showing
9 changed files
with
117 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,4 +16,5 @@ object PStandard { | |
val CONJUNCTION = 100 | ||
val DISJUNCTION = 50 | ||
val DOUBLE_OP = 1600 | ||
val SHIFT = 175 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package cmdreader.std | ||
|
||
import cmdreader._ | ||
import types._ | ||
import util._ | ||
import java.math.BigInteger | ||
|
||
class OShl extends CommandOperator { | ||
override def getName(): String = "shl" | ||
override def getOpAlias() = "<<" | ||
override def isValidArg0(n: Int) = n == 2 | ||
override def apply(args: Array[Type]): Type = { | ||
MathUtil.shl(args(0), args(1)) | ||
} | ||
def getPrecedence() = PStandard.SHIFT | ||
def isReversed() = false | ||
def hasAssignmentEquiv() = true | ||
def getDoubleBase() = None | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package cmdreader.std | ||
|
||
import cmdreader._ | ||
import types._ | ||
import util._ | ||
import java.math.BigInteger | ||
|
||
class OShr extends CommandOperator { | ||
override def getName(): String = "shr" | ||
override def getOpAlias() = ">>" | ||
override def isValidArg0(n: Int) = n == 2 | ||
override def apply(args: Array[Type]): Type = { | ||
MathUtil.shr(args(0), args(1)) | ||
} | ||
def getPrecedence() = PStandard.SHIFT | ||
def isReversed() = false | ||
def hasAssignmentEquiv() = true | ||
def getDoubleBase() = None | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters