-
Couldn't load subscription status.
- Fork 1.1k
Implement unused (renamed to ghost terms) #3342
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
4b81aae
ea4c483
cf52f93
85f9a70
5e774d7
68ea63c
7474ba3
e755dd8
2177da5
724bf9c
f1aa9fc
ae8f80e
81ec565
dd661dd
6a40b84
aa53182
aba82ba
7c4662d
ce2d805
544c8d5
f10f2d0
ddf5b2c
7f81bc3
c877473
ed50958
c040798
68afbcd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -93,4 +93,5 @@ object Mode { | |
|
|
||
| /** We are in the IDE */ | ||
| val Interactive = newMode(20, "Interactive") | ||
|
|
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -174,31 +174,53 @@ object NameOps { | |
| */ | ||
| def functionArity: Int = | ||
| functionArityFor(str.Function) max { | ||
| val n = functionArityFor(str.ImplicitFunction) | ||
| val n = | ||
| functionArityFor(str.ImplicitFunction) max | ||
| functionArityFor(str.UnusedFunction) max | ||
| functionArityFor(str.UnusedImplicitFunction) | ||
| if (n == 0) -1 else n | ||
| } | ||
|
|
||
| /** Is a function name | ||
| * - FunctionN for N >= 0 | ||
| * - ImplicitFunctionN for N >= 1 | ||
| * - UnusedFunctionN for N >= 1 | ||
| * - UnusedImplicitFunctionN for N >= 1 | ||
| * - false otherwise | ||
| */ | ||
| def isFunction: Boolean = functionArity >= 0 | ||
|
|
||
| /** Is a implicit function name | ||
| * - ImplicitFunctionN for N >= 1 | ||
| * - UnusedImplicitFunctionN for N >= 1 | ||
| * - false otherwise | ||
| */ | ||
| def isImplicitFunction: Boolean = functionArityFor(str.ImplicitFunction) >= 1 | ||
| def isImplicitFunction: Boolean = { | ||
| functionArityFor(str.ImplicitFunction) >= 1 || | ||
| functionArityFor(str.UnusedImplicitFunction) >= 1 | ||
| } | ||
|
|
||
| /** Is a implicit function name | ||
| * - UnusedFunctionN for N >= 1 | ||
| * - UnusedImplicitFunctionN for N >= 1 | ||
| * - false otherwise | ||
| */ | ||
| def isUnusedFunction: Boolean = { | ||
| functionArityFor(str.UnusedFunction) >= 1 || | ||
| functionArityFor(str.UnusedImplicitFunction) >= 1 | ||
| } | ||
|
|
||
| /** Is a synthetic function name | ||
| * - FunctionN for N > 22 | ||
| * - ImplicitFunctionN for N >= 1 | ||
| * - UnusedFunctionN for N >= 1 | ||
| * - UnusedImplicitFunctionN for N >= 1 | ||
| * - false otherwise | ||
| */ | ||
| def isSyntheticFunction: Boolean = { | ||
| functionArityFor(str.Function) > MaxImplementedFunctionArity || | ||
| functionArityFor(str.ImplicitFunction) >= 1 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Replace with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Better functionArityFor(str.Function) > MaxImplementedFunctionArity ||
functionArityFor(str.ImplicitFunction) >= 1 ||
isUnusedFunctionto avoid checking |
||
| functionArityFor(str.ImplicitFunction) >= 1 || | ||
| isUnusedFunction | ||
| } | ||
|
|
||
| /** Parsed function arity for function with some specific prefix */ | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand the logic here (and suspect it might be wrong).
Would be good to document this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will add documentation.