Method/macro parameter annotation support#12044
Method/macro parameter annotation support#12044straight-shoota merged 6 commits intocrystal-lang:masterfrom
Conversation
|
|
||
| def foo( | ||
| id : Int32, | ||
| @[Ann] &block : Int32 -> |
|
Seems something is broken with I'll see if I can figure out what's wrong tomorrow. EDIT: Seems a single |
Reset arg type after processing an `Arg`, versus a `Def`
|
Bump. Another review on this would be much appreciated 🙂. |
|
How's the memory consumption after this PR for, say, compiling the compiler? You can check this with "-s" |
|
On this branch: On the commit I branched off of: So seems pretty much the same? |
|
Interesting! Since we are adding something to every |
| property default_value : ASTNode? | ||
| property restriction : ASTNode? | ||
| property doc : String? | ||
| property parsed_annotations : Array(Annotation)? |
There was a problem hiding this comment.
Instead of keeping the annotations on each arg, I think we can move this to the Def and Macro objects, similar to how the splat index is kept there.
But we could do this refactor later on if we see memory issues. I just don't think that annotations on args will be that common, and so adding this overhead to every arg instead of adding just a nilable attribute to Def and Macro might be better.
Also added an optional focus parameter to assert_format to make debugging a specific failure a bit easier. Fixes formatter after #12044.
Also added an optional focus parameter to assert_format to make debugging a specific failure a bit easier. Fixes formatter after crystal-lang#12044.
Also added an optional focus parameter to assert_format to make debugging a specific failure a bit easier. Fixes formatter after #12044.
Also added an optional focus parameter to assert_format to make debugging a specific failure a bit easier. Fixes formatter after #12044.
…escriptor` constructors (#16034) The final patch to the blocking behavior rework. Each event loop configures the system file descriptor or handle as per its internal requirement, and we shall deprecate the `blocking` parameter. Parser support for annotations on def parameters was only added in #12044 for Crystal 1.5.
Resolves #12039
to_sBased on #9322 (comment) i took a bit of a diff approach and stored the parsed annotation instances within the
Argnode itself. Ended up making the implementation much easier and figured we wouldn't have to worry about breaking compatibility since this is a new feature.