-
Notifications
You must be signed in to change notification settings - Fork 2.5k
TML-3230: declare block-level attributes on the attribute-spec kit (block-attributes-on-kit) #30162
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
Open
StevenMcClankerton
wants to merge
10
commits into
main
Choose a base branch
from
tml-3230-block-attributes-on-kit
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 8 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
ca870cc
TML-3230: open the block-attributes-on-kit slice (spec, plan, trace)
SevInf 5ba5fbc
TML-3230: give the attribute-spec kit a block-level interpret ctx and…
SevInf 45cd83c
TML-3230: carry parsed block attributes on the extension-block node a…
SevInf b7b17f9
TML-3230: parse block attributes through the kit at symbol-table time
SevInf 5a70545
TML-3230: declare block attributes on their descriptors and read the …
SevInf 768eaf5
TML-3230: dispatch attribute combinators on syntax kind instead of AS…
SevInf c6ac2cc
TML-3230: carry the parsed @@type on the sql family enum test blocks
SevInf 7121335
TML-3230: record the block-attributes-on-kit dispatch loop in the pro…
SevInf 9c7b807
TML-3230: assert kit-parsed enum codec ids, reject non-function block…
SevInf b991bd0
TML-3230: record extension upgrade instructions for the block-attribu…
SevInf File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
packages/1-framework/2-authoring/psl-parser/src/attribute-spec/block-attribute.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| import type { PslDiagnostic } from '@internal/framework-components/psl-ast'; | ||
| import type { AstNode } from '../syntax/ast-helpers'; | ||
| import type { | ||
| AttributeOut, | ||
| AttributeSpec, | ||
| BlockInterpretCtx, | ||
| Param, | ||
| PositionalParam, | ||
| } from './types'; | ||
|
|
||
| interface BlockAttributeConfig< | ||
| Pos extends readonly PositionalParam<unknown, BlockInterpretCtx>[], | ||
| Named extends Record<string, Param<unknown, BlockInterpretCtx>>, | ||
| > { | ||
| readonly positional?: Pos; | ||
| readonly named?: Named; | ||
| readonly refine?: ( | ||
| parsed: AttributeOut<Pos, Named>, | ||
| ctx: BlockInterpretCtx, | ||
| attributeNode: AstNode, | ||
| ) => readonly PslDiagnostic[]; | ||
| } | ||
|
|
||
| export function blockAttribute< | ||
| const Pos extends readonly PositionalParam<unknown, BlockInterpretCtx>[] = readonly [], | ||
| const Named extends Record<string, Param<unknown, BlockInterpretCtx>> = Record<never, never>, | ||
| >( | ||
| name: string, | ||
| config: BlockAttributeConfig<Pos, Named>, | ||
| ): AttributeSpec<AttributeOut<Pos, Named>, BlockInterpretCtx> { | ||
| return { | ||
| level: 'block', | ||
| name, | ||
| positional: config.positional ?? [], | ||
| named: config.named ?? {}, | ||
| ...(config.refine !== undefined ? { refine: config.refine } : {}), | ||
| }; | ||
| } |
9 changes: 5 additions & 4 deletions
9
packages/1-framework/2-authoring/psl-parser/src/attribute-spec/combinators/bool.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
packages/1-framework/2-authoring/psl-parser/src/attribute-spec/combinators/diagnostic.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
packages/1-framework/2-authoring/psl-parser/src/attribute-spec/combinators/identifier.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win
Keep the type export in an
exports/module.packages/1-framework/1-core/framework-components/src/control/psl-ast.tsre-exportsPslExtensionBlockParsedAttributeoutside anexports/folder. Remove this re-export and usepackages/1-framework/1-core/framework-components/src/exports/authoring.tsas the public export surface.As per coding guidelines: “Do not re-export from one file in another, except in
exports/folders.”🤖 Prompt for AI Agents
Source: Coding guidelines