acowley / hpp Goto Github PK
View Code? Open in Web Editor NEWhpp - A Haskell Preprocessor
License: BSD 3-Clause "New" or "Revised" License
hpp - A Haskell Preprocessor
License: BSD 3-Clause "New" or "Revised" License
Steps to reproduce:
f1.txt
which has #include "dir1/f2.txt"
and some textdir1/f2.txt
which has #include "dir2/f3.txt"
and some textdir1/dir2/f3.txt
streamHpp
to process f1.txt
.As can be seen from output it succeeds to include f2, but fails to include f3. If we add dir1/dir2
as default include directory. It works. But it should also work without explicit specification.
I've recently swapped out cpphs
for hpp
inside of the Eta compiler and I discovered some interesting behavior.
Input:
'a'
Output:
7
This behavior causes the GHC.Show
module to fail when compiling with Eta.
What was the rationale for this part of the tokenizer? Do escaped character literals have a different behavior when inside of a preprocessor directive definition/body? If so, I think there needs to be a step where the transformation to a number is undone so that the source code isn't mutated like that.
Hi it appears that hpp produces some erratic line numbers. When hpp sees a #ifdef
..#endif
(without an #else
), the line numbers will be different to what is actually in the original file. Here I have a file called test
with the line numbers annotated at the beginning:
#ifdef FOO
2: __LINE__: aaaa
#endif
4: __LINE__:
#ifdef FOO
6: __LINE__: aaaa
#endif
8: __LINE__:
#ifdef FOO
10: __LINE__: aaaa
#endif
When I run hpp test
it produces:
#line 4
4: 3:
#line 7
8: 6:
#line 10
And when I run hpp -DFOO test
it produces:
2: 2: aaaa
#line 4
4: 5:
6: 7: aaaa
#line 9
8: 10:
10: 12: aaaa
#line 14
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.