... | ... | @@ -108,3 +108,9 @@ If you're working on the lexer, it can be useful to have a function `lex :: Stri |
|
|
```Haskell
|
|
|
lex str = case Lexer.lexTokenStream (StringBuffer.stringToStringBuffer str) (SrcLoc.mkRealSrcLoc (FastString.fsLit "") 0 0) DynFlags.unsafeGlobalDynFlags of Lexer.POk _ a -> Prelude.map (\l -> case l of (SrcLoc.L _ e) -> e) a
|
|
|
```
|
|
|
|
|
|
It is also possible to get a function that takes a list of active extensions:
|
|
|
|
|
|
```Haskell
|
|
|
lex exts str = case Lexer.lexTokenStream (StringBuffer.stringToStringBuffer str) (SrcLoc.mkRealSrcLoc (FastString.fsLit "") 0 0) (Data.List.foldl' xopt_set DynFlags.unsafeGlobalDynFlags exts) of Lexer.POk _ a -> Prelude.map (\l -> case l of (SrcLoc.L _ e) -> e) a
|
|
|
``` |
|
|
\ No newline at end of file |