Michael Hanus (284411d4) at 27 Mar 11:13
Add output directory in front-end call for Curry system
... and 1 more commit
Michael Hanus (9cd02735) at 26 Mar 13:40
Add case mode Curry
and make old case modes stronger by emitting ...
Michael Hanus (8e3742f0) at 26 Mar 11:29
Add case mode Curry
and make old case modes stronger by emitting ...
Michael Hanus (2c9c8ed3) at 26 Mar 11:24
Fix merge error
In restricted case modes, like haskell
, warnings are generated for illegal uppercase/lowercases.
These warning should be turned into errors in order to really enforce the case mode.
Uppercase/lowercase warnings that are currently generated in the case mode haskell
should be generated in the default case mode.
These warnings could be turned off by, e.g., -W no-haskell-case
.
Michael Hanus (e74f7536) at 26 Mar 11:11
Merge branch 'case-mode-check' into 'master'
... and 13 more commits
This PR tackles the two issues via the following four major changes:
curry
) is introduced, which behaves like haskell
, but emits warnings for wrong casingshaskell
, prolog
, goedel
) are made stricter by emitting errors instead of warningsWarnCheck
into a separate CaseModeCheck
CaseModeCheck
are made more descriptiveTo illustrate, here is an example program:
data x = a
f :: A -> A
f X = X
Compiling the program would not emit any errors or warnings due to the default case mode free
. Even with -c haskell
, the user would get relatively obscure warnings that make sense if the user is already familiar with Curry's case modes, but can appear confusing if not:
src/CaseMode.curry:3:6 Warning:
Wrong case mode in symbol `x' due to selected case mode `haskell`, try renaming to X instead
|
3 | data x = a
| ^
src/CaseMode.curry:3:10 Warning:
Wrong case mode in symbol `a' due to selected case mode `haskell`, try renaming to A instead
|
3 | data x = a
| ^
src/CaseMode.curry:5:6 Warning:
Wrong case mode in symbol `A' due to selected case mode `haskell`, try renaming to a instead
|
5 | f :: A -> A
| ^
src/CaseMode.curry:5:11 Warning:
Wrong case mode in symbol `A' due to selected case mode `haskell`, try renaming to a instead
|
5 | f :: A -> A
| ^
src/CaseMode.curry:6:3 Warning:
Wrong case mode in symbol `X' due to selected case mode `haskell`, try renaming to x instead
|
6 | f X = X
| ^
After this PR, what the user will see in the default case mode (curry
) is the following:
src/CaseMode.curry:3:6 Warning:
Symbol `x' is a data declaration name, but the selected case mode is `curry`, try renaming to X instead
|
3 | data x = a
| ^
src/CaseMode.curry:3:10 Warning:
Symbol `a' is a constructor name, but the selected case mode is `curry`, try renaming to A instead
|
3 | data x = a
| ^
src/CaseMode.curry:5:6 Warning:
Symbol `A' is a variable name, but the selected case mode is `curry`, try renaming to a instead
|
5 | f :: A -> A
| ^
src/CaseMode.curry:5:11 Warning:
Symbol `A' is a variable name, but the selected case mode is `curry`, try renaming to a instead
|
5 | f :: A -> A
| ^
src/CaseMode.curry:6:3 Warning:
Symbol `X' is a variable name, but the selected case mode is `curry`, try renaming to x instead
|
6 | f X = X
| ^
The messages immediately point out that the symbols are variables (not e.g. promoted constructors or other types). Users can still opt into the classic behavior via -c free
to disable all warnings/errors about casings, the defaults should now be much less confusing to programmers familiar with Haskell syntax though.
Michael Hanus (15d1f4d1) at 26 Mar 11:06
Merge branch 'master' into 'case-mode-check'
... and 2 more commits
Michael Hanus (23bf7b2d) at 26 Mar 11:04
Merge branch 'fix-case-mode-typo' into 'master'
... and 1 more commit
Found this small typo in WarnCheck.checkCaseModeDecl
while tinkering around with this check. We won't need this if !74 is accepted, but in case we'd want to discuss that further and/or go a different route, here is the fix, for good measure.
Found this small typo in WarnCheck.checkCaseModeDecl
while tinkering around with this check. We won't need this if !74 is accepted, but in case we'd want to discuss that further and/or go a different route, here is the fix, for good measure.
Michael Hanus (ed1a5a5f) at 25 Mar 17:53
Add free case-mode option
Michael Hanus (d6d5aba7) at 24 Mar 15:15
Remove superfluous specific Curry services
... and 3 more commits
Michael Hanus (a102c28e) at 19 Mar 15:21
Update CPM
Michael Hanus (1724633f) at 19 Mar 14:28
Fix currytools
Michael Hanus (78bb1b4c) at 19 Mar 14:28
Add required package execpath