diff --git a/lamagraph-compiler/src/Lamagraph/Compiler/Parser.y b/lamagraph-compiler/src/Lamagraph/Compiler/Parser.y index 79fe9db..16c6d4f 100644 --- a/lamagraph-compiler/src/Lamagraph/Compiler/Parser.y +++ b/lamagraph-compiler/src/Lamagraph/Compiler/Parser.y @@ -239,11 +239,16 @@ atomic_type :: { LLmlType LmlcPs } --------------- -- Constants -- --------------- + constant :: { XLocated LmlcPs (LmlLit LmlcPs) } : integer_literal { sL1 $1 $ LmlInt noExtField (getInt $1) } | char_literal { sL1 $1 $ LmlChar noExtField (getChar $1) } | string_literal { sL1 $1 $ LmlString noExtField (getString $1)} +signed_constant :: { XLocated LmlcPs (LmlLit LmlcPs) } + : constant { $1 } + | '-' integer_literal { sLL $1 $2 $ LmlInt noExtField (getMinusInt $2) } + -------------- -- Patterns -- -------------- @@ -266,7 +271,7 @@ simple_pattern :: { LLmlPat LmlcPs } : delimited_pattern { $1 } | value_name { sL1 $1 $ LmlPatVar noExtField $1 } | '_' { sL1 $1 $ LmlPatAny noExtField } - | constant { sL1 $1 $ LmlPatConstant noExtField (unLoc $1) } + | signed_constant { sL1 $1 $ LmlPatConstant noExtField (unLoc $1) } | constr %prec below_DOT { sL1 $1 $ LmlPatConstruct noExtField $1 Nothing } | tuple_pattern '|' tuple_pattern { sLL $1 $3 $ LmlPatOr noExtField $1 $3 } | constr tuple_pattern %prec constr_appl { sLL $1 $2 $ LmlPatConstruct noExtField $1 (Just $2)} @@ -315,8 +320,12 @@ compound_expr :: { LLmlExpr LmlcPs } sLL $1 $2 $ LmlExprApply noExtField prefixIdent (pure $2) } | '-' compound_expr %prec prec_unary_minus - { let prefixIdent = sL1 $1 $ LmlExprIdent noExtField (mkLongident $ pure "~-") in - sLL $1 $2 $ LmlExprApply noExtField prefixIdent (pure $2) + { case unLoc $2 of + LmlExprConstant _ (LmlInt _ n) -> + sLL $1 $2 $ LmlExprConstant noExtField (LmlInt noExtField (-n)) + _ -> + let prefixIdent = sL1 $1 $ LmlExprIdent noExtField (mkLongident $ pure "~-") + in sLL $1 $2 $ LmlExprApply noExtField prefixIdent (pure $2) } | simple_expr infix_op compound_expr { let infixIdent = sL1 $2 $ LmlExprIdent noExtField ((mkLongident . pure . unLoc) $2) in @@ -530,7 +539,10 @@ getLongident :: NonEmpty LToken -> Longident getLongident = mkLongident . fmap getIdent getInt :: LToken -> Int -getInt (L _ (TokInt val)) = val +getInt (L _ (TokInt val)) = Prelude.read $ toString val + +getMinusInt :: LToken -> Int +getMinusInt (L _ (TokInt val)) = Prelude.read $ ("-" ++ (toString val)) getChar :: LToken -> Char getChar (L _ (TokChar val)) = val diff --git a/lamagraph-compiler/src/Lamagraph/Compiler/Parser/Lexer.x b/lamagraph-compiler/src/Lamagraph/Compiler/Parser/Lexer.x index 292fa96..01c75c4 100644 --- a/lamagraph-compiler/src/Lamagraph/Compiler/Parser/Lexer.x +++ b/lamagraph-compiler/src/Lamagraph/Compiler/Parser/Lexer.x @@ -49,6 +49,7 @@ import Lamagraph.Compiler.Parser.SrcLoc $digit = [0-9] $letter = [a-zA-Z] + $capital_letter = [A-Z] $lowercase_letter = [a-z] @@ -71,7 +72,7 @@ $operator_char = [\! \$ \% & \* \+ \. \/ \: \< \= \> \? \@ \^ \| \~] ) -- Integer literals -@integer_literal = \-? $digit ( $digit | \_ )* +@integer_literal = $digit ( $digit | \_ )* -- Operators @infix_symbol = ( \= | \< | \> | \@ | \^ | \| | & | \+ | \- | \* | \/ | \$ | \% ) ( $operator_char )* @@ -226,7 +227,7 @@ tokAnyIdent ctor input@(startPosn, _, _, str) len = do tokInt :: AlexAction LToken tokInt input@(startPosn, _, _, str) len = do - let num = read $ toString $ Text.take len str + let num = Text.take len str return $ L (alexPosnToSrcSpan startPosn $ getEndPos input len) (TokInt num) diff --git a/lamagraph-compiler/src/Lamagraph/Compiler/Parser/LexerTypes.hs b/lamagraph-compiler/src/Lamagraph/Compiler/Parser/LexerTypes.hs index 2ed2e9f..1269c4d 100644 --- a/lamagraph-compiler/src/Lamagraph/Compiler/Parser/LexerTypes.hs +++ b/lamagraph-compiler/src/Lamagraph/Compiler/Parser/LexerTypes.hs @@ -41,7 +41,7 @@ data IdentType = Capitalized | Lowercase data Token = TokIdent IdentType Text | {- Integer literals -} - TokInt Int + TokInt Text | {- Character literals -} TokChar Char | {- String literals -} diff --git a/lamagraph-compiler/test/Lamagraph/Compiler/Parser/LexerTest.hs b/lamagraph-compiler/test/Lamagraph/Compiler/Parser/LexerTest.hs index aeb0e0a..8a0ad38 100644 --- a/lamagraph-compiler/test/Lamagraph/Compiler/Parser/LexerTest.hs +++ b/lamagraph-compiler/test/Lamagraph/Compiler/Parser/LexerTest.hs @@ -55,7 +55,7 @@ lowercaseIdent = integerLiteral :: TestTree integerLiteral = testCase "Lex Int literal" $ do - getTokenTypesFromText "42" @?= Right [TokInt 42, TokEOF] + getTokenTypesFromText "42" @?= Right [TokInt "42", TokEOF] allLetterKeywords :: TestTree -- Yep, strange name allLetterKeywords = diff --git a/lamagraph-compiler/test/golden/eval/output/Minus64.lml.out b/lamagraph-compiler/test/golden/eval/output/Minus64.lml.out new file mode 100644 index 0000000..7f447f9 --- /dev/null +++ b/lamagraph-compiler/test/golden/eval/output/Minus64.lml.out @@ -0,0 +1 @@ +-9223372036854775807-9223372036854775807-9223372036854775806-9223372036854775806-9223372036854775806 \ No newline at end of file diff --git a/lamagraph-compiler/test/golden/eval/source/Minus64.lml b/lamagraph-compiler/test/golden/eval/source/Minus64.lml new file mode 100644 index 0000000..f57bda5 --- /dev/null +++ b/lamagraph-compiler/test/golden/eval/source/Minus64.lml @@ -0,0 +1,18 @@ +module Minus64 + +let bad_number_spaced = -9223372036854775808 +let bad_number=-9223372036854775808 +let bad_number_plus=9223372036854775807 + +(* val x: int *) +let f0 x = x + -9223372036854775808 +let f1 x = x + - 9223372036854775808 +let f2 x = x- 9223372036854775807 +let f3 x = x-9223372036854775807 +let f4 x = x -9223372036854775807 + +let s = print_int (f0 1) +let s = print_int (f1 1) +let s = print_int (f2 1) +let s = print_int (f3 1) +let s = print_int (f4 1) diff --git a/lamagraph-compiler/test/golden/parser/ast/Minus64.lml.ast b/lamagraph-compiler/test/golden/parser/ast/Minus64.lml.ast new file mode 100644 index 0000000..3f807a8 --- /dev/null +++ b/lamagraph-compiler/test/golden/parser/ast/Minus64.lml.ast @@ -0,0 +1,399 @@ +(Module + (Just + (L + { :1:8-15 } + ("Minus64"))) + [ (L + { :3:1-45 } + (ValD + (L + { :3:5-45 } + (NonRec + [ (L + { :3:5-45 } + (Bind + (L + { :3:5-22 } + (PatVar + (L + { :3:5-22 } + "bad_number_spaced"))) + (L + { :3:25-45 } + (ExprConstant -9223372036854775808)))) ])))) + , (L + { :4:1-36 } + (ValD + (L + { :4:5-36 } + (NonRec + [ (L + { :4:5-36 } + (Bind + (L + { :4:5-15 } + (PatVar + (L + { :4:5-15 } + "bad_number"))) + (L + { :4:16-36 } + (ExprConstant -9223372036854775808)))) ])))) + , (L + { :5:1-40 } + (ValD + (L + { :5:5-40 } + (NonRec + [ (L + { :5:5-40 } + (Bind + (L + { :5:5-20 } + (PatVar + (L + { :5:5-20 } + "bad_number_plus"))) + (L + { :5:21-40 } + (ExprConstant 9223372036854775807)))) ])))) + , (L + { :8:1-37 } + (ValD + (L + { :8:5-37 } + (NonRec + [ (L + { :8:5-37 } + (Bind + (L + { :8:5-7 } + (PatVar + (L + { :8:5-7 } + "f0"))) + (L + { :8:8-37 } + (ExprFunction + (L + { :8:8-9 } + (PatVar + (L + { :8:8-9 } + "x"))) + (L + { :8:12-37 } + (ExprApply + (L + { :8:14-15 } + (ExprIdent + "+")) + [ (L + { :8:12-13 } + (ExprIdent + "x")) + , (L + { :8:17-37 } + (ExprConstant -9223372036854775808)) ])))))) ])))) + , (L + { :9:1-37 } + (ValD + (L + { :9:5-37 } + (NonRec + [ (L + { :9:5-37 } + (Bind + (L + { :9:5-7 } + (PatVar + (L + { :9:5-7 } + "f1"))) + (L + { :9:8-37 } + (ExprFunction + (L + { :9:8-9 } + (PatVar + (L + { :9:8-9 } + "x"))) + (L + { :9:12-37 } + (ExprApply + (L + { :9:14-15 } + (ExprIdent + "+")) + [ (L + { :9:12-13 } + (ExprIdent + "x")) + , (L + { :9:16-37 } + (ExprConstant -9223372036854775808)) ])))))) ])))) + , (L + { :10:1-34 } + (ValD + (L + { :10:5-34 } + (NonRec + [ (L + { :10:5-34 } + (Bind + (L + { :10:5-7 } + (PatVar + (L + { :10:5-7 } + "f2"))) + (L + { :10:8-34 } + (ExprFunction + (L + { :10:8-9 } + (PatVar + (L + { :10:8-9 } + "x"))) + (L + { :10:12-34 } + (ExprApply + (L + { :10:13-14 } + (ExprIdent + "-")) + [ (L + { :10:12-13 } + (ExprIdent + "x")) + , (L + { :10:15-34 } + (ExprConstant 9223372036854775807)) ])))))) ])))) + , (L + { :11:1-33 } + (ValD + (L + { :11:5-33 } + (NonRec + [ (L + { :11:5-33 } + (Bind + (L + { :11:5-7 } + (PatVar + (L + { :11:5-7 } + "f3"))) + (L + { :11:8-33 } + (ExprFunction + (L + { :11:8-9 } + (PatVar + (L + { :11:8-9 } + "x"))) + (L + { :11:12-33 } + (ExprApply + (L + { :11:13-14 } + (ExprIdent + "-")) + [ (L + { :11:12-13 } + (ExprIdent + "x")) + , (L + { :11:14-33 } + (ExprConstant 9223372036854775807)) ])))))) ])))) + , (L + { :12:1-34 } + (ValD + (L + { :12:5-34 } + (NonRec + [ (L + { :12:5-34 } + (Bind + (L + { :12:5-7 } + (PatVar + (L + { :12:5-7 } + "f4"))) + (L + { :12:8-34 } + (ExprFunction + (L + { :12:8-9 } + (PatVar + (L + { :12:8-9 } + "x"))) + (L + { :12:12-34 } + (ExprApply + (L + { :12:14-15 } + (ExprIdent + "-")) + [ (L + { :12:12-13 } + (ExprIdent + "x")) + , (L + { :12:15-34 } + (ExprConstant 9223372036854775807)) ])))))) ])))) + , (L + { :14:1-25 } + (ValD + (L + { :14:5-25 } + (NonRec + [ (L + { :14:5-25 } + (Bind + (L + { :14:5-6 } + (PatVar + (L + { :14:5-6 } + "s"))) + (L + { :14:9-25 } + (ExprApply + (L + { :14:9-18 } + (ExprIdent + "print_int")) + [ (L + { :14:19-25 } + (ExprApply + (L + { :14:20-22 } + (ExprIdent + "f0")) + [(L { :14:23-24 } (ExprConstant 1))])) ])))) ])))) + , (L + { :15:1-25 } + (ValD + (L + { :15:5-25 } + (NonRec + [ (L + { :15:5-25 } + (Bind + (L + { :15:5-6 } + (PatVar + (L + { :15:5-6 } + "s"))) + (L + { :15:9-25 } + (ExprApply + (L + { :15:9-18 } + (ExprIdent + "print_int")) + [ (L + { :15:19-25 } + (ExprApply + (L + { :15:20-22 } + (ExprIdent + "f1")) + [(L { :15:23-24 } (ExprConstant 1))])) ])))) ])))) + , (L + { :16:1-25 } + (ValD + (L + { :16:5-25 } + (NonRec + [ (L + { :16:5-25 } + (Bind + (L + { :16:5-6 } + (PatVar + (L + { :16:5-6 } + "s"))) + (L + { :16:9-25 } + (ExprApply + (L + { :16:9-18 } + (ExprIdent + "print_int")) + [ (L + { :16:19-25 } + (ExprApply + (L + { :16:20-22 } + (ExprIdent + "f2")) + [(L { :16:23-24 } (ExprConstant 1))])) ])))) ])))) + , (L + { :17:1-25 } + (ValD + (L + { :17:5-25 } + (NonRec + [ (L + { :17:5-25 } + (Bind + (L + { :17:5-6 } + (PatVar + (L + { :17:5-6 } + "s"))) + (L + { :17:9-25 } + (ExprApply + (L + { :17:9-18 } + (ExprIdent + "print_int")) + [ (L + { :17:19-25 } + (ExprApply + (L + { :17:20-22 } + (ExprIdent + "f3")) + [(L { :17:23-24 } (ExprConstant 1))])) ])))) ])))) + , (L + { :18:1-25 } + (ValD + (L + { :18:5-25 } + (NonRec + [ (L + { :18:5-25 } + (Bind + (L + { :18:5-6 } + (PatVar + (L + { :18:5-6 } + "s"))) + (L + { :18:9-25 } + (ExprApply + (L + { :18:9-18 } + (ExprIdent + "print_int")) + [ (L + { :18:19-25 } + (ExprApply + (L + { :18:20-22 } + (ExprIdent + "f4")) + [(L { :18:23-24 } (ExprConstant 1))])) ])))) ])))) ]) \ No newline at end of file diff --git a/lamagraph-compiler/test/golden/parser/ppr/Minus64.lml b/lamagraph-compiler/test/golden/parser/ppr/Minus64.lml new file mode 100644 index 0000000..3c5ff9c --- /dev/null +++ b/lamagraph-compiler/test/golden/parser/ppr/Minus64.lml @@ -0,0 +1,27 @@ +module Minus64 + +let bad_number_spaced = -9223372036854775808 + +let bad_number = -9223372036854775808 + +let bad_number_plus = 9223372036854775807 + +let f0 = fun x -> ( + ) (x) (-9223372036854775808) + +let f1 = fun x -> ( + ) (x) (-9223372036854775808) + +let f2 = fun x -> ( - ) (x) (9223372036854775807) + +let f3 = fun x -> ( - ) (x) (9223372036854775807) + +let f4 = fun x -> ( - ) (x) (9223372036854775807) + +let s = print_int (f0 (1)) + +let s = print_int (f1 (1)) + +let s = print_int (f2 (1)) + +let s = print_int (f3 (1)) + +let s = print_int (f4 (1)) \ No newline at end of file diff --git a/lamagraph-compiler/test/golden/parser/source/Minus64.lml b/lamagraph-compiler/test/golden/parser/source/Minus64.lml new file mode 120000 index 0000000..18f44ac --- /dev/null +++ b/lamagraph-compiler/test/golden/parser/source/Minus64.lml @@ -0,0 +1 @@ +../../eval/source/Minus64.lml \ No newline at end of file diff --git a/lamagraph-compiler/test/golden/typechecker/ast/Minus64.lml.ast b/lamagraph-compiler/test/golden/typechecker/ast/Minus64.lml.ast new file mode 100644 index 0000000..f692aa5 --- /dev/null +++ b/lamagraph-compiler/test/golden/typechecker/ast/Minus64.lml.ast @@ -0,0 +1,503 @@ +(Module + ~-: int -> int + >=: int -> int -> bool + bad_number_plus: int + /: int -> int -> int + f0: int -> int + *: int -> int -> int + ::: forall 'a. ('a * 'a list) -> 'a list + <: int -> int -> bool + []: forall 'a. 'a list + f3: int -> int + bad_number: int + bad_number_spaced: int + -: int -> int -> int + s: () + +: int -> int -> int + >: int -> int -> bool + f4: int -> int + <=: int -> int -> bool + Some: forall 'a. 'a -> 'a option + None: forall 'a. 'a option + false: bool + f1: int -> int + true: bool + f2: int -> int + print_int: int -> () + (Just + (L + { :1:8-15 } + ("Minus64"))) + [ (L + { :3:1-45 } + (ValD + (L + { :3:5-45 } + (NonRec + [ (L + { :3:5-45 } + (Bind + bad_number_spaced: int + (L + { :3:5-22 } + (PatVar + int + (L + { :3:5-22 } + "bad_number_spaced"))) + (L + { :3:25-45 } + (ExprConstant int int + -9223372036854775808)))) ])))) + , (L + { :4:1-36 } + (ValD + (L + { :4:5-36 } + (NonRec + [ (L + { :4:5-36 } + (Bind + bad_number: int + (L + { :4:5-15 } + (PatVar + int + (L + { :4:5-15 } + "bad_number"))) + (L + { :4:16-36 } + (ExprConstant int int + -9223372036854775808)))) ])))) + , (L + { :5:1-40 } + (ValD + (L + { :5:5-40 } + (NonRec + [ (L + { :5:5-40 } + (Bind + bad_number_plus: int + (L + { :5:5-20 } + (PatVar + int + (L + { :5:5-20 } + "bad_number_plus"))) + (L + { :5:21-40 } + (ExprConstant int int + 9223372036854775807)))) ])))) + , (L + { :8:1-37 } + (ValD + (L + { :8:5-37 } + (NonRec + [ (L + { :8:5-37 } + (Bind + f0: int -> int + (L + { :8:5-7 } + (PatVar + int -> int + (L + { :8:5-7 } + "f0"))) + (L + { :8:8-37 } + (ExprFunction + int -> int + (L + { :8:8-9 } + (PatVar + int + (L + { :8:8-9 } + "x"))) + (L + { :8:12-37 } + (ExprApply + int + (L + { :8:14-15 } + (ExprIdent + int -> int -> int + "+")) + [ (L + { :8:12-13 } + (ExprIdent + int + "x")) + , (L + { :8:17-37 } + (ExprConstant int int + -9223372036854775808)) ])))))) ])))) + , (L + { :9:1-37 } + (ValD + (L + { :9:5-37 } + (NonRec + [ (L + { :9:5-37 } + (Bind + f1: int -> int + (L + { :9:5-7 } + (PatVar + int -> int + (L + { :9:5-7 } + "f1"))) + (L + { :9:8-37 } + (ExprFunction + int -> int + (L + { :9:8-9 } + (PatVar + int + (L + { :9:8-9 } + "x"))) + (L + { :9:12-37 } + (ExprApply + int + (L + { :9:14-15 } + (ExprIdent + int -> int -> int + "+")) + [ (L + { :9:12-13 } + (ExprIdent + int + "x")) + , (L + { :9:16-37 } + (ExprConstant int int + -9223372036854775808)) ])))))) ])))) + , (L + { :10:1-34 } + (ValD + (L + { :10:5-34 } + (NonRec + [ (L + { :10:5-34 } + (Bind + f2: int -> int + (L + { :10:5-7 } + (PatVar + int -> int + (L + { :10:5-7 } + "f2"))) + (L + { :10:8-34 } + (ExprFunction + int -> int + (L + { :10:8-9 } + (PatVar + int + (L + { :10:8-9 } + "x"))) + (L + { :10:12-34 } + (ExprApply + int + (L + { :10:13-14 } + (ExprIdent + int -> int -> int + "-")) + [ (L + { :10:12-13 } + (ExprIdent + int + "x")) + , (L + { :10:15-34 } + (ExprConstant int int + 9223372036854775807)) ])))))) ])))) + , (L + { :11:1-33 } + (ValD + (L + { :11:5-33 } + (NonRec + [ (L + { :11:5-33 } + (Bind + f3: int -> int + (L + { :11:5-7 } + (PatVar + int -> int + (L + { :11:5-7 } + "f3"))) + (L + { :11:8-33 } + (ExprFunction + int -> int + (L + { :11:8-9 } + (PatVar + int + (L + { :11:8-9 } + "x"))) + (L + { :11:12-33 } + (ExprApply + int + (L + { :11:13-14 } + (ExprIdent + int -> int -> int + "-")) + [ (L + { :11:12-13 } + (ExprIdent + int + "x")) + , (L + { :11:14-33 } + (ExprConstant int int + 9223372036854775807)) ])))))) ])))) + , (L + { :12:1-34 } + (ValD + (L + { :12:5-34 } + (NonRec + [ (L + { :12:5-34 } + (Bind + f4: int -> int + (L + { :12:5-7 } + (PatVar + int -> int + (L + { :12:5-7 } + "f4"))) + (L + { :12:8-34 } + (ExprFunction + int -> int + (L + { :12:8-9 } + (PatVar + int + (L + { :12:8-9 } + "x"))) + (L + { :12:12-34 } + (ExprApply + int + (L + { :12:14-15 } + (ExprIdent + int -> int -> int + "-")) + [ (L + { :12:12-13 } + (ExprIdent + int + "x")) + , (L + { :12:15-34 } + (ExprConstant int int + 9223372036854775807)) ])))))) ])))) + , (L + { :14:1-25 } + (ValD + (L + { :14:5-25 } + (NonRec + [ (L + { :14:5-25 } + (Bind + s: () + (L + { :14:5-6 } + (PatVar + () + (L + { :14:5-6 } + "s"))) + (L + { :14:9-25 } + (ExprApply + () + (L + { :14:9-18 } + (ExprIdent + int -> () + "print_int")) + [ (L + { :14:19-25 } + (ExprApply + int + (L + { :14:20-22 } + (ExprIdent + int -> int + "f0")) + [(L { :14:23-24 } (ExprConstant int int 1))])) ])))) ])))) + , (L + { :15:1-25 } + (ValD + (L + { :15:5-25 } + (NonRec + [ (L + { :15:5-25 } + (Bind + s: () + (L + { :15:5-6 } + (PatVar + () + (L + { :15:5-6 } + "s"))) + (L + { :15:9-25 } + (ExprApply + () + (L + { :15:9-18 } + (ExprIdent + int -> () + "print_int")) + [ (L + { :15:19-25 } + (ExprApply + int + (L + { :15:20-22 } + (ExprIdent + int -> int + "f1")) + [(L { :15:23-24 } (ExprConstant int int 1))])) ])))) ])))) + , (L + { :16:1-25 } + (ValD + (L + { :16:5-25 } + (NonRec + [ (L + { :16:5-25 } + (Bind + s: () + (L + { :16:5-6 } + (PatVar + () + (L + { :16:5-6 } + "s"))) + (L + { :16:9-25 } + (ExprApply + () + (L + { :16:9-18 } + (ExprIdent + int -> () + "print_int")) + [ (L + { :16:19-25 } + (ExprApply + int + (L + { :16:20-22 } + (ExprIdent + int -> int + "f2")) + [(L { :16:23-24 } (ExprConstant int int 1))])) ])))) ])))) + , (L + { :17:1-25 } + (ValD + (L + { :17:5-25 } + (NonRec + [ (L + { :17:5-25 } + (Bind + s: () + (L + { :17:5-6 } + (PatVar + () + (L + { :17:5-6 } + "s"))) + (L + { :17:9-25 } + (ExprApply + () + (L + { :17:9-18 } + (ExprIdent + int -> () + "print_int")) + [ (L + { :17:19-25 } + (ExprApply + int + (L + { :17:20-22 } + (ExprIdent + int -> int + "f3")) + [(L { :17:23-24 } (ExprConstant int int 1))])) ])))) ])))) + , (L + { :18:1-25 } + (ValD + (L + { :18:5-25 } + (NonRec + [ (L + { :18:5-25 } + (Bind + s: () + (L + { :18:5-6 } + (PatVar + () + (L + { :18:5-6 } + "s"))) + (L + { :18:9-25 } + (ExprApply + () + (L + { :18:9-18 } + (ExprIdent + int -> () + "print_int")) + [ (L + { :18:19-25 } + (ExprApply + int + (L + { :18:20-22 } + (ExprIdent + int -> int + "f4")) + [(L { :18:23-24 } (ExprConstant int int 1))])) ])))) ])))) ]) \ No newline at end of file diff --git a/lamagraph-compiler/test/golden/typechecker/source/Minus64.lml b/lamagraph-compiler/test/golden/typechecker/source/Minus64.lml new file mode 120000 index 0000000..18f44ac --- /dev/null +++ b/lamagraph-compiler/test/golden/typechecker/source/Minus64.lml @@ -0,0 +1 @@ +../../eval/source/Minus64.lml \ No newline at end of file