amrun 0.0.0.2 → 0.0.0.3
raw patch · 2 files changed
+5/−4 lines, 2 files
Files
- amrun.cabal +1/−1
- src/amrun.hs +4/−3
amrun.cabal view
@@ -1,5 +1,5 @@ Name: amrun-Version: 0.0.0.2+Version: 0.0.0.3 Synopsis: Interpreter for AM Description: The package contains an interpreter for the AM-Language that is introduced in the basic programming course \"Algorithmisches Denken und imperative Programmierung\" (WS 2011/12 and later) at the University of Bonn. License: GPL
src/amrun.hs view
@@ -5,6 +5,7 @@ import System.IO import System.IO.Unsafe import Control.DeepSeq+import Data.Char (toUpper) import Text.Parsec import Text.ParserCombinators.Parsec.Char@@ -138,10 +139,10 @@ commandParser :: CharParser Int Command commandParser = do {- cmd <- ((many1 upper) <|> lookAhead ((space <|> char ';') >> return "")) <?> "expected command (did you write upper case letters?)";+ cmd <- ((many1 letter) <|> lookAhead ((space <|> char ';') >> return "")) <?> "expected command"; spaces <?> "";- let noArgCmd = readCmd cmd- oneArgCmd = readCmd' cmd+ let noArgCmd = readCmd (map toUpper cmd)+ oneArgCmd = readCmd' (map toUpper cmd) in case noArgCmd of Just c -> return c