|
definition: |
scan :: String -> [Token]
scan "" = []
scan s@(c:cs) = case c of
'(' -> LParen : scan cs
')' -> RParen : scan cs
'!' -> Bang : scan cs
'_' -> Underscore : scan cs
':' -> Colon : scan cs
'"' -> DQuote : scan cs
',' -> Comma : scan cs
';' -> scanLineCmt cs
_ | isInt c -> scanInt s
| isAlpha c || isSpecial c -> scanKWOrId s
| isSpace c -> scan cs
| otherwise -> error $ "Scanner.scan: Unexpected character "
++ [c] ++ "\nRemaining tokens: " ++ cs
|
|
demand: |
argument 1 |
|
deterministic: |
deterministic operation |
|
failfree: |
<FAILING> |
|
indeterministic: |
referentially transparent operation |
|
infix: |
no fixity defined |
|
iotype: |
{({[]}) |-> {[]} || ({:}) |-> _}
|
|
name: |
scan |
|
precedence: |
no precedence defined |
|
result-values: |
_ |
|
signature: |
String -> [Token] |
|
solution-complete: |
operation might suspend on free variables |
|
terminating: |
possibly non-terminating |
|
totally-defined: |
possibly non-reducible on same data term |