Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into feature/ast-optimizer
Browse files Browse the repository at this point in the history
  • Loading branch information
AxelHumeau committed Jan 11, 2024
2 parents 6f46bc9 + 08c72b8 commit ed0219f
Show file tree
Hide file tree
Showing 7 changed files with 539 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ cabal.project.local~
.stack-work
glados
.vscode
output
11 changes: 11 additions & 0 deletions LobsterLang/LobsterLang.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ library
AST
AstEval
AstOptimizer
Compiler
Parse
Scope
SExpr
Expand All @@ -42,6 +43,9 @@ library
ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-export-lists -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints
build-depends:
base >=4.7 && <5
, binary
, bytestring
, utf8-string
default-language: Haskell2010

executable LobsterLang-exe
Expand All @@ -56,6 +60,9 @@ executable LobsterLang-exe
build-depends:
LobsterLang
, base >=4.7 && <5
, binary
, bytestring
, utf8-string
default-language: Haskell2010

test-suite LobsterLang-test
Expand All @@ -64,6 +71,7 @@ test-suite LobsterLang-test
other-modules:
AstEvalSpec
AstOptimizerSpec
CompilerSpec
VmSpec
Paths_LobsterLang
autogen-modules:
Expand All @@ -74,5 +82,8 @@ test-suite LobsterLang-test
build-depends:
LobsterLang
, base >=4.7 && <5
, binary
, bytestring
, hspec
, utf8-string
default-language: Haskell2010
3 changes: 3 additions & 0 deletions LobsterLang/app/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import System.Exit (exitWith, ExitCode (ExitFailure))
import System.Environment (getArgs)
import Control.Exception
import SExpr (SExpr)
-- import Compiler

-- | Infinite loop until EOF from the user
inputLoop :: [Scope.ScopeMb] -> IO ()
Expand All @@ -35,6 +36,8 @@ compileFile :: String -> IO ()
compileFile s = case runParser parseLisp (0, 0) s of
Left err -> print err >> exitWith (ExitFailure 84)
Right (res, _, _) -> interpretateInfo res []
-- (Right (Just res), stack') -> let instructions = (astToInstructions (AST.Cond (Boolean True) (Value 1) (Just (AST.Call "CallHere" [(Value 0)])))) in showInstructions instructions >> writeCompiledInstructionsToFile "output" (compileInstructions instructions)


checkArgs :: [String] -> IO ()
checkArgs ("-i": _) = print "Launch Interpreter" >> inputLoop []
Expand Down
3 changes: 3 additions & 0 deletions LobsterLang/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ description: Please see the README on GitHub at <https://github.com/gith

dependencies:
- base >= 4.7 && < 5
- bytestring
- utf8-string
- binary

ghc-options:
- -Wall
Expand Down
Loading

0 comments on commit ed0219f

Please sign in to comment.