From b51be83eff25d31e39598a4ababf380f8211b319 Mon Sep 17 00:00:00 2001 From: Laborratte5 Date: Tue, 16 Jul 2024 00:05:15 +0200 Subject: [PATCH] Read input for Lexer from file --- app/Main.hs | 6 +++++- arithmetic.txt | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 arithmetic.txt diff --git a/app/Main.hs b/app/Main.hs index 65ae4a0..f3b2830 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -1,4 +1,8 @@ module Main where +import qualified Lexer + main :: IO () -main = putStrLn "Hello, Haskell!" +main = do + source <- readFile "arithmetic.txt" + putStr $ show (Lexer.lex source) diff --git a/arithmetic.txt b/arithmetic.txt new file mode 100644 index 0000000..9e02457 --- /dev/null +++ b/arithmetic.txt @@ -0,0 +1 @@ +1 + 22 * (3 - 4) \ No newline at end of file