diff options
author | William Carroll <wpcarro@gmail.com> | 2022-10-24T21·53-0400 |
---|---|---|
committer | wpcarro <wpcarro@gmail.com> | 2022-10-25T03·59+0000 |
commit | ee235235b98d01b00de5a446b48d6dec574b1458 (patch) | |
tree | 21500ed0dbe683de23cea8a1928604d433743595 /users/wpcarro/scratch/compiler/types.ml | |
parent | 1e9c3955bf2c17206c6dd536ebaf96a7e6f4f22d (diff) |
feat(wpcarro/compiler): Support string literal type r/5196
``` repl> "Hello, world" String repl> (fn x "testing") a0 -> String ``` Change-Id: Ia76299a56aa4d2032c9a21277e2fddfb2e055831 Reviewed-on: https://cl.tvl.fyi/c/depot/+/7079 Tested-by: BuildkiteCI Reviewed-by: wpcarro <wpcarro@gmail.com>
Diffstat (limited to 'users/wpcarro/scratch/compiler/types.ml')
-rw-r--r-- | users/wpcarro/scratch/compiler/types.ml | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/users/wpcarro/scratch/compiler/types.ml b/users/wpcarro/scratch/compiler/types.ml index 79c51c681240..0acd05737cdc 100644 --- a/users/wpcarro/scratch/compiler/types.ml +++ b/users/wpcarro/scratch/compiler/types.ml @@ -1,4 +1,7 @@ -type literal = LiteralInt of int | LiteralBool of bool +type literal + = LiteralInt of int + | LiteralBool of bool + | LiteralString of string (* Lambda Calculus definition *) type value = @@ -14,6 +17,7 @@ module FromString = Map.Make (String) type _type = | TypeInt | TypeBool + | TypeString | TypeVariable of string | TypeArrow of _type * _type |