- Happy is a parser generator for haskell. like yacc/bison is for C.
- its lexer equivalent is called Alex, which i just implemented use of
- install happy and alex using:
stack install happy alex
these will probably be installed when you run
stack install
, but I’m not really sure.
- This program requires stack to install dependencies and compile properly.
- ghc and cabal can be install using pacman on arch, probably apt-get on ubuntu or whatever.
- stack can be installed idk from the website or whatever
- otherwise stack will take care of libraries when you run the command
stack install
- just run
stack install
To install libraries manually, run
stack install <package>
stack will install binaries into $HOME/.local/bin, so add this to your path if you want
- [X] switch from system.posix.process to system.process, for return val and pipe support
- hopefully this will fix the order of execution of commands not being guaranteeable, i.e. not forked
- [X] problem – varRef vs single word commands. possible solution:
- make if-stmts only contain exprs if theyre wrapped in brackets of some sort
- [X] think about ambiguity, e.g. ‘if 1 == 2 then echo hi ; a = 2’ gets parsed as ‘if .. then ( echo hi ; a = 2)’
- edit %left precedence accordingly
- [X] find a better way to handle empty lines
- [X] start using alex. adding ‘==’ support broke assignment without spaces
- [ ] seperate Expression datatype into Expression and Literal?
- [X] make variable evaluation explicit
- [ ] other things that are listed throughout the code