Comments (5)
Tabs are size 8 in Haskell, see the Haskell report.
from alex.
How is this related with tab sizes in Haskell report? \t
is one character but Alex behaves as if it's 8 characters.
from alex.
Maybe a flag for --tab-size=NUMBER
that defaults to 8 can be added. I guess that would be done by adding a State
Monad in the ParseMonad
module.
from alex.
Alex adopts the same convention for .x
files as for Haskell, which is that tab stops are 8 columns apart. If you don't like this, you don't have to use tabs (in fact, it's better just not to use tabs anyway).
Now, in the generated lexer (rather than Alex itself) it is arguably wrong to fix the same convention: https://github.com/simonmar/alex/blob/master/templates/wrappers.hs#L151
By all means submit a pull request to change this, I suppose we could have a command line flag, and plumb the tab width through to wrappers.hs using CPP.
from alex.
Oh... I see my mistake. I thought the line in the ParseMonad
module was for the generated lexer. That is what I meant to link. Thank you for clearing that up!
Now, in the line in the wrapper file that you linked, that one should follow the flag's instruction. I'll see to make a pull request with that change!
from alex.
Related Issues (20)
- Feature request: Add support for UTF8 bytestring wrappers (utf8-bytestring-basic, utf8-bytestring-posn...) HOT 1
- Explore unboxed parser representations
- Hackage releases don't pass tests on ghc 9.0 HOT 1
- Alex build failing with missing filepath at preprocessing step HOT 5
- New release HOT 3
- alex 3.2.7 fails to parse definitions which can pass alex 3.2.6 HOT 13
- How to build `alex` from git sources? Instructions in `README.md` are broken. HOT 3
- Agda-style Lexing HOT 3
- website (bad link) HOT 10
- Makefile (examples) HOT 2
- UTF-8 and text 2.0 HOT 2
- spelling of `DFS.GForrest` HOT 3
- Make `haskell.org/alex` redirect to `haskell-alex.readthedocs.io` ? HOT 6
- `alexSetUserState`/`alexGetUserState` with `monadUserState-bytestring` wrapper HOT 6
- Alex PVP violation? HOT 2
- Function `Util.brack` is not used
- Functions `Sort.isort` and `Sort.insrt` not used HOT 2
- Is module DFS really needed? HOT 2
- Deriving Ord for AlexPosn HOT 4
- upgrading problems with Cabal HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from alex.