Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace externals with a more robust implementation
- Loading branch information
1 parent
564650f
commit 3288298
Showing
25 changed files
with
378 additions
and
499 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 |
---|---|---|
|
@@ -20,7 +20,6 @@ | |
"else" | ||
"end" | ||
"effect" | ||
"external" | ||
"finally" | ||
"for" | ||
"fun" | ||
|
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,129 @@ | ||
type primitive = | ||
| CompareEq | ||
| CompareGe | ||
| CompareGt | ||
| CompareLe | ||
| CompareLt | ||
| CompareNe | ||
| FloatAcos | ||
| FloatAdd | ||
| FloatAsin | ||
| FloatAtan | ||
| FloatCos | ||
| FloatDiv | ||
| FloatExp | ||
| FloatExpm1 | ||
| FloatInfinity | ||
| FloatLog | ||
| FloatLog1p | ||
| FloatMul | ||
| FloatNaN | ||
| FloatNeg | ||
| FloatNegInfinity | ||
| FloatOfInt | ||
| FloatSin | ||
| FloatSqrt | ||
| FloatSub | ||
| FloatTan | ||
| IntegerAdd | ||
| IntegerDiv | ||
| IntegerMod | ||
| IntegerMul | ||
| IntegerNeg | ||
| IntegerPow | ||
| IntegerSub | ||
| IntOfFloat | ||
| StringConcat | ||
| StringLength | ||
| StringOfFloat | ||
| StringOfInt | ||
| StringSub | ||
| ToString | ||
|
||
(* Keep this list up to date with the type above, otherwise the missing primitives will not be loaded *) | ||
let primitives = | ||
[ | ||
CompareEq; | ||
CompareGe; | ||
CompareGt; | ||
CompareLe; | ||
CompareLt; | ||
CompareLt; | ||
CompareNe; | ||
FloatAcos; | ||
FloatAdd; | ||
FloatAsin; | ||
FloatAtan; | ||
FloatCos; | ||
FloatDiv; | ||
FloatExp; | ||
FloatExpm1; | ||
FloatInfinity; | ||
FloatLog; | ||
FloatLog1p; | ||
FloatMul; | ||
FloatNaN; | ||
FloatNeg; | ||
FloatNegInfinity; | ||
FloatOfInt; | ||
FloatSin; | ||
FloatSqrt; | ||
FloatSub; | ||
FloatTan; | ||
IntegerAdd; | ||
IntegerDiv; | ||
IntegerMod; | ||
IntegerMul; | ||
IntegerNeg; | ||
IntegerPow; | ||
IntegerSub; | ||
IntOfFloat; | ||
StringConcat; | ||
StringLength; | ||
StringOfFloat; | ||
StringOfInt; | ||
StringSub; | ||
ToString; | ||
] | ||
|
||
let primitive_name = function | ||
| CompareEq -> "=" | ||
| CompareGe -> ">=" | ||
| CompareGt -> ">" | ||
| CompareLe -> "<=" | ||
| CompareLt -> "<" | ||
| CompareNe -> "<>" | ||
| FloatAcos -> "acos" | ||
| FloatAdd -> "+." | ||
| FloatAsin -> "asin" | ||
| FloatAtan -> "atan" | ||
| FloatCos -> "cos" | ||
| FloatDiv -> "/." | ||
| FloatExp -> "exp" | ||
| FloatExpm1 -> "expm1" | ||
| FloatInfinity -> "infinity" | ||
| FloatLog -> "log" | ||
| FloatLog1p -> "log1p" | ||
| FloatMul -> "*." | ||
| FloatNaN -> "nan" | ||
| FloatNeg -> "~-." | ||
| FloatNegInfinity -> "neg_infinity" | ||
| FloatOfInt -> "float_of_int" | ||
| FloatSin -> "sin" | ||
| FloatSqrt -> "sqrt" | ||
| FloatSub -> "-." | ||
| FloatTan -> "tan" | ||
| IntegerAdd -> "+" | ||
| IntegerDiv -> "/" | ||
| IntegerMod -> "mod" | ||
| IntegerMul -> "*" | ||
| IntegerNeg -> "~-" | ||
| IntegerPow -> "**" | ||
| IntegerSub -> "-" | ||
| IntOfFloat -> "int_of_float" | ||
| StringConcat -> "^" | ||
| StringLength -> "string_length" | ||
| StringOfFloat -> "string_of_float" | ||
| StringOfInt -> "string_of_int" | ||
| StringSub -> "sub" | ||
| ToString -> "to_string" |
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
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
Oops, something went wrong.