Maintainer | bastiaan.heeren@ou.nl |
---|---|
Stability | provisional |
Portability | portable (depends on ghc) |
Safe Haskell | Safe |
Language | Haskell98 |
This module defines the lexing (1st) phase of the assessment pipeline.
The only function you should need is extract
.
Note that we don't do true lexing: we don't convert symbols into tokens.
Instead, we mostly tend to remove text/symbols and do some conversion.
Synopsis
- extract :: StringLexerOptions -> String -> ([String], Bool)
- useColumns :: StringLexerOptions -> String -> Maybe [[String]]
- parseColumns :: MathLexer [String]
- parseSimple :: Parser a -> String -> Either String a
- allowedWords :: MathLexer String
- trim :: String -> String
Documentation
extract :: StringLexerOptions -> String -> ([String], Bool) Source #
This is the lexer function.
It takes some options for string lexing, the string to lex and return a list of lines and a boolean denoting columnization.
useColumns :: StringLexerOptions -> String -> Maybe [[String]] Source #
Determines for a given string whether it should be parsed using columns Columns can occur in a horizontal or vertical fashion. Horizontal columns means that several expressions on a single line form one solution Vertical columns means that several expressions directly below another form one solution
parseColumns :: MathLexer [String] Source #
Parses several expressions on a single line
allowedWords :: MathLexer String Source #
Matches on expressions that may contain spaces. It currently does parse "60 60" as a single expression