1
1
mirror of https://github.com/gelisam/hawk.git synced 2024-11-30 21:37:35 +03:00
Commit Graph

21 Commits

Author SHA1 Message Date
Samuel Gélineau
c99a5e8f89 only use Paths_haskell_awk from the library
apparently with cabal-v2 the executable and the tests don't have access
to that auto-generated module.
2021-01-01 16:33:05 -05:00
Samuel Gélineau
bd6cb85ad3 Delimiters, Separators, Processors 2020-05-22 19:13:25 -04:00
Samuel Gélineau
b07248765d remove unused imports 2018-12-02 13:16:05 -05:00
Carlo Dapor
5a1023fcd8 Address hlint hints in runtime/ 2016-08-01 19:22:29 +02:00
Samuel Gélineau
83f1c9eaa2 Don't use empty output delimiters unless requested
In particular, while input delimiters are usually used for the default
output delimiters, setting empty input delimiters to specify the
line-based or the stream based input format should not cause the output
delimiters to be empty.
2015-02-14 23:52:13 -05:00
Samuel Gélineau
f0b3938f60 "FooExpr" instead of "FooUserExpr"
I still use "UserExpr" instead of "Expr", but when there is an extra
qualifier, I stick to the short form. Before, the long and short forms
were used inconsistently.
2015-02-14 12:07:49 -05:00
Samuel Gélineau
87b2c9d9db use "Expr" instead of "Expression" everywhere
For consistency. I didn't pick "Expression" everywhere because some
lines containing several occurrences of it were getting really long.
2015-02-14 11:52:55 -05:00
Samuel Gélineau
99c613835f type-preserving user expression transformation
We now keep track of the different types which the user expression could
have at the beginning, and we convert it to a processed and then a
canonical expression via a series of type-safe transformations.
2015-02-14 00:05:05 -05:00
Samuel Gélineau
6a73807c90 SomeRows
Instead of hardcoding the output of the transformed user expression to
be (), let's allow it to be any type with an instance of Rows. This will
allow us to hardcode the output of the untransformed user expression
instead.
2015-02-05 23:04:58 -05:00
Samuel Gélineau
270fb4bb23 split ExprSpec into two parts
This will allow us to vary the representation of the user expression as
we proceed through the stages.
2015-02-05 23:04:54 -05:00
Samuel Gélineau
1c10fb6db4 rename "line" to "record" everywhere 2014-05-12 17:23:53 -05:00
Samuel Gélineau
874ee3e300 separate fields by Whitespace by default
No need for the alternate "Words" constructor for LineFormat after all.
Instead, we have the alternate "Whitespace" constructor for Separator.
2014-05-11 22:46:43 -05:00
Samuel Gélineau
6cd8fd9250 Distinguish separators from delimitors
We are about to add a new kind of separator which is not based on a
delimiter string.
2014-05-11 22:32:45 -05:00
Samuel Gélineau
3d59c31519 rename "Words" to "Fields" everywhere
Because "Words" is about to obtain a new meaning.
2014-05-11 00:40:46 -05:00
Samuel Gélineau
9fcbf10c60 use newtype instead of data 2014-05-04 12:19:19 -04:00
Samuel Gélineau
2cdd73ecbf wrap IO in HawkIO
We can import Runtime.Base unqualified, but we can't do so with Prelude.
2014-05-04 12:11:54 -04:00
Samuel Gélineau
db0e8813cb force HawkRuntime to be in scope
...but not processTable
2014-05-03 15:58:07 -04:00
Samuel Gélineau
ac606d57f5 remove the old runtime
The new runtime, based on HawkRuntime, was implemented from scratch,
thereby re-introducing many bugs which had been fixed long ago. Better
to refactor incrementally next time!
2014-03-01 14:15:13 -05:00
Samuel Gélineau
2a1308b5ad fix spurious extra row
lines are terminated by "\n", not separated by "\n", so treat the "\n"
separator as a special case.
2014-02-28 21:12:06 -05:00
Samuel Gélineau
d8ace91c2c remove spurious newline after the output 2014-02-23 12:11:53 -05:00
Samuel Gélineau
72d63ba3dd split off runtime, fix crazy hClose bug
Having the source for the runtime and executable at the same place was
causing issues during the test. By giving the path to the executable
source, ghci (called by doctest) was also finding the source to the
runtime, which caused HawkRuntime values to be interpreted instead of
compiled. This in turn conflicted with hint, who is only using compiled
values except inside the user expression. That caused ghci to segfault,
and doctest to report an unexpectedly-closed handle.
2014-02-23 11:18:17 -05:00