Feather2
========
Bugs
====
Feather doesn't look for methods on super classes when using Functions
import static class's methods cannot be used as Functions.
e.g. HelperFunctions::foo works, but ::foo doesn't.
val command = arrayOf<String>("play", "-q", file.path)
uk.co.nickthecoder.feather.core.FeatherException: Feather Compiler Bug
Constructors ignore generic type info
See TestFunction.wrongFunctionToConstructor (@Ignore-d).
Parser.required(...) isn't doing what it is designed to do.
I had to faf with exitFieldDeclarationDescription to see the ACTUAL reason for the error.
.required() should return this?, not this.
throw and catch an exception. Store it, and it the parsing DOES complete (which it won't),
then throw the stored exception as a compiler bug.
There should ALSO be a "required" method for getting text???
Cannot iterate over strings???
I think this is fixed now?
Words/JigsawStencil.foocad
Variable called e3 not allowed, but f3 (and others are). I assume this is a problem with real numbers.
VisualTests/ScaleTo.foocad
Method called "open" isn't allowed due to keyword clash. This is very annoying!
Claimed it was a `val`, even though extra is a var.
val drawerClip = DrawerClip().apply {
extra = 10
}
*= and or */ threw a Compiler bug exception!
//Quality.minimumSize *= revolveResolution
//Quality.minimumAngle *= revolveResolution
val result = shellP.revolve()
//Quality.minimumSize /= revolveResolution
//Quality.minimumAngle /= revolveResolution
General
=======
@AlwaysThisType method annotation
If a sub-class doesn't implement the method, then a method is automatically added,
with a bridging method. The new return type is the same type as the current method.
Use on PromptForm.copy()
New feather2-jar subproject
A command line tool for creating jar files.
Allow keywords to be quoted, like Kotlin. i.e. foo.`class`
We can get round this using foo.getClass()
But in other cases there may be no simple work-around. e.g. foo.library = ...
New project to edit and run feather scripts, with syntax highlighting.
Maybe part of feather2glok.
Side panel to set command line arguments.
Generate toString, equals and hashCode method for classes which are tagged with the @Data annotation.
(If they haven't been manually implemented)
Check that all abstract methods and methods from interfaces are implemented
(unless the class is abstract).
try finally
If a `return` is encountered inside, then how is the `finally` block called?
Is the return value from finally popped?
as, as? and is : What to do if generic types are specified?
Code review!
copyright header,
comments
tested
using Messages.kt
vararg constructors not tested at all.
finding constructors probably don't have all the features of find method???
Operators which don't support calling methods/extension functions.
Unary !
in, !in (contains). Note - the order of parameters is reversed.
() "invoke(...)" method i.e.
>, < >=, <= (Using compareTo() : Int)
Check the sandbox whenever asmName/asmDescription is called.
Cache per compilation.
in, !in
Do we need special case for Array, or does Arrays.contains(...) exist?
New (Optional) Features
=======================
For
Add special case for IntRange, and maybe IntProgression too.
Build a dependency graph.
For each class, list which classes it depends upon.
This can then be mapped to which Scripts it depends upon.
We could then perform a partial recompilation :
Supply which scripts have been changed
Calculate which scripts need to be recompiled, and which can stay.
Needs to be recompiled if in the CHANGED list, plus scripts which DIRECTLY depend on the CHANGED list.
Indirect dependencies are not important.
Create a classloader for the classes that can stay.
Recompile them.
Create results from the previous compile + the results of the recompilation.
Replace ArraySpecialMethods with a simple import of the Arrays class???
Add tests of existing code, then replace with a static import.
Parser shouldn't use `required`, but return if anything is missing.
Maybe also add to a list of problems.
Later (Low priority)
=====
Allow FeatherClass to extend a Generic Type.
I would really like to extend Comparable<T>.
For methods with type parameter, which also take a Class<T>, then auto-fill that parameter.
Done in the "Call" class - maybe only for extension functions.
Only after everything else has failed.
As the first / last parameter,
Commands
Backticks as syntactic sugar for CommandBase.eval.
This would require a new grammar mode???
Add && and || operators for commands.
Store return value statically