-
Notifications
You must be signed in to change notification settings - Fork 327
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
Move documentation into documented AST node #11302
Comments
Keziah Wesley reports a new STANDUP for yesterday (2024-10-15): Progress: Debugging backend tests. Started working on Next Day: Next day I will be working on the #11302 task. Finish changes for |
Keziah Wesley reports a new STANDUP for today (2024-10-16): Progress: Replaced private modifier-node with field. It should be finished by 2024-10-19. Next Day: Next day I will be working on the #11302 task. Move TypeSignature into Function. |
Keziah Wesley reports a new STANDUP for today (2024-10-17): Progress: Moved TypeSignature into Function field in parser and parser tests. It should be finished by 2024-10-19. Next Day: Next day I will be working on the #11302 task. Updating backend tests. |
Align `Assignment`/`Function` distinction in AST with compiler's implemented semantics: - The ambiguous case `funcOrVar = expression` is now parsed as a `Function` when in a `Type` definition or in the top level of a module. I.e. it is an `Assignment` in contexts where the RHS is evaluated immediately when the binding is evaluated, and a `Function` in contexts where the RHS is evaluated each time the bound name is evaluated. - `Assignment` statements now may only occur in function bodies. Correcting this distinction lays the groundwork for #11302. Other changes: - Fixed incorrect source code locations for negative literals and negated expressions. # Important Notes New APIs: - The parser now exposes a `parse_block` entry point, which allows parsing input lines as if in the body of a function. The previous entry point has been renamed to `parse_module`.
Keziah Wesley reports a new STANDUP for the last Friday (2024-10-18): Progress: Finished TypeSignature changes. It should be finished by 2024-10-19. Next Day: Next day I will be working on the #11302 task. Start on annotations. |
Keziah Wesley reports a new STANDUP for today (2024-10-21): Progress: Implemented annotations changes. It should be finished by 2024-10-25. Next Day: Next day I will be working on the #11302 task. Moving doc comments into field. |
Keziah Wesley reports a new STANDUP for today (2024-10-22): Progress: Moving doc comments into field of supporting types. It should be finished by 2024-10-25. Next Day: Next day I will be working on the #11302 task. Finish doc-comment changes. |
Keziah Wesley reports a new STANDUP for yesterday (2024-10-23): Progress: Removing innerExpression/wrappingExpression logic; adding Statement/Expression distinction. It should be finished by 2024-10-25. Next Day: Next day I will be working on the #11302 task. Finish doc-comment changes. |
Keziah Wesley reports a new STANDUP for today (2024-10-24): Progress: Refactored node collapsing for testability; using new statements to simplify block printing. It should be finished by 2024-10-25. Next Day: Next day I will be working on the #11302 task. Finish doc-comment changes. |
Keziah Wesley reports a new STANDUP for the last Friday (2024-10-25): Progress: Simplifying printing logic. It should be finished by 2024-10-30. Next Day: Next day I will be working on the #11302 task. Finish printing changes. |
GUI: - Distinguish expression and statement - `Ast.Ast` is still present, as the base class for AST objects. Most references to `Ast.Ast` are now references to `Ast.Expression`. Operations on blocks use `Ast.Statement`. - `Ast.parse` has been replaced with: `Ast.parseExpression`, `Ast.parseStatement`, and `Ast.parseBlock` - `syncToCode` is internally context-aware; it parses the provided code appropriately depending on whether its AST is an expression, a statement, or the top level of a module. - Remove `wrappingExpression` / `innerExpression` APIs: Wrapper types are no longer used; modifier lines are now fields inside parent types. - Simplify AST printing: - Fully implemented autospacing in `concreteChildren` implementations; the type returned by `concreteChildren` now ensures that spacing has been fully resolved. - Eliminate `printBlock` / `printDocs`: `concreteChildren` is now aware of indentation context, and responsible for indentation of its child lines. - The `Pattern` type is now parameterized to identify the AST type it constructs. The `Pattern.parseExpression` function helps create a `Pattern<Expression>`. - Refactor `performCollape` for testability. - e2e tests: Improve table viz test: It still doesn't pass on my Mac, but these changes are necessary if not sufficient. Compiler (TreeToIr): - An expression in statement context is now found in an `ExpressionStatement` wrapper. - Documentation for a `Function` is now found inside the function node. - Deduplicate some polyglot-function logic.
Keziah Wesley reports a new STANDUP for yesterday (2024-10-28): Progress: Finished simplifying printing. Implemented full Expression/Statement type safety. It should be finished by 2024-10-30. Next Day: Next day I will be working on the #11302 task. Look into issue causes e2e test failures. |
Keziah Wesley reports a new STANDUP for today (2024-10-29): Progress: Finished the PR. It should be finished by 2024-10-30. Next Day: Next day I will be working on the #11302 task. Address review, fix merge conflicts, testing. Maybe start integrating new doc panel. |
Keziah Wesley reports a new STANDUP for yesterday (2024-10-30): Progress: Addressing review, fixing merge conflicts. It should be finished by 2024-10-30. Next Day: Next day I will be working on the #11302 task. Fix any new merge conflicts, testing. Bringing doc panel PR up to date with develop and docs-fields PR. |
Move documentation into documentable types (implements #11302). # Important Notes GUI: - Distinguish expression and statement - `Ast.Ast` is still present, as the base class for AST objects. Most references to `Ast.Ast` are now references to `Ast.Expression`. Operations on blocks use `Ast.Statement`. - `Ast.parse` has been replaced with: `Ast.parseExpression`, `Ast.parseStatement`, and `Ast.parseBlock` - `syncToCode` is internally context-aware; it parses the provided code appropriately depending on whether its AST is an expression, a statement, or the top level of a module. - Remove `wrappingExpression` / `innerExpression` APIs: Wrapper types have been eliminated; modifier lines are now fields inside parent types. - Simplify AST printing: - Fully implemented autospacing in `concreteChildren` implementations; the type returned by `concreteChildren` now ensures that spacing has been fully resolved. - Eliminate `printBlock` / `printDocs`: `concreteChildren` is now aware of indentation context, and responsible for indentation of its child lines. - The `Pattern` type is now parameterized to identify the AST type it constructs. The `Pattern.parseExpression` function helps create a `Pattern<Expression>`. - Refactor `performCollape` for testability. - e2e tests: Improve table viz test: It still doesn't pass on my Mac, but these changes are necessary if not sufficient. Compiler (TreeToIr): - An expression in statement context is now found in an `ExpressionStatement` wrapper. - Documentation for a `Function` is now found inside the function node. - Deduplicate some polyglot-function logic.
Eliminate
Ast.Documented
; add adocumentation
field to documentable syntax nodes (method definition, assignment, type definition, constructor definition, case-of branch). Introduce a node type for "free documentation" that couldn't be attached to anything.This will enable better warnings: Currently, documentation can be attached to any line; however, documentation attached to some expression types is never used. By explicitly attaching documentation only to syntactic constructs that accept it, we can emit a warning when documentation occurs elsewhere.
This will simplify edits in the frontend: Currently adding or removing documentation changes the AST structurally. This particularly complicates switching to Y.Text-based documentation synchronization.
Tasks
private
modifier node with field on supporting types #11346The text was updated successfully, but these errors were encountered: