-
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.
Added two more functions and fixed choking on escaped quotes
- Loading branch information
1 parent
b180cdb
commit 1e3cc7c
Showing
7 changed files
with
61 additions
and
12 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
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,21 @@ | ||
package cmdreader.std | ||
|
||
import cmdreader._ | ||
import types._ | ||
import util._ | ||
import java.math.BigInteger | ||
|
||
class OAug extends CommandOperator { | ||
override def getName(): String = "aug" | ||
override def getOpAlias() = "&+" | ||
override def isValidArg0(n: Int) = n >= 2 | ||
override def apply(args: Array[Type]): Type = { | ||
val trueLists = args.map(CollectionOps.decodeToList(_)) | ||
val newList = trueLists.fold(Nil)(_ ++ _) | ||
CollectionOps.encodeFromList(newList, args(0).getType) | ||
} | ||
def getPrecedence() = PStandard.ADD_SUBT | ||
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,17 @@ | ||
package cmdreader.std | ||
|
||
import cmdreader._ | ||
import types._ | ||
import scala.math.BigInt | ||
|
||
class Ribzpt extends Command { | ||
override def getName(): String = "ribzpt" | ||
override def isValidArg0(n: Int): Boolean = n == 1 | ||
override def apply(args: Array[Type]): Type = { | ||
val nb = args(0) match { | ||
case n: TNumerical => n.intValue | ||
case _ => return new TError(1) | ||
} | ||
TMountain(BigInt(nb, Global.r)) | ||
} | ||
} |
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