-
Notifications
You must be signed in to change notification settings - Fork 317
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
Ast.Vector #9328
Ast.Vector #9328
Conversation
: props.input.expectedType?.startsWith('Standard.Base.Data.Vector.Vector') ? Score.Good | ||
: props.input.value instanceof Ast.Vector ? Score.Perfect |
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.
nit: I suggest switching these lines. If we have vector Ast and the expected type is Vector, it should be a perfect match, not Good
.
@@ -231,12 +232,27 @@ const yLabelLeft = computed( | |||
) | |||
const yLabelTop = computed(() => -margin.value.left + 15) | |||
|
|||
function vectorOfNumericLiterals(values: number[]): Ast.Owned | undefined { |
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.
What about moving this to utils? Seems like a useful function.
const escapeString = (str: string): string => { | ||
const escaped = str.replaceAll(/([\\'])/g, '\\$1') | ||
return `'${escaped}'` | ||
function vectorOfTextLiterals(values: string[]): Ast.Owned { |
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.
Same here.
Pull Request Description
Add
Vector
AST type, corresponding to theRawAst.Tree.Array
type (nameArray
not used for obvious reasons).This is the first step of #5138.
Important Notes
Vector.new
, improving type-safety.Ast
changes are covered by the round-trip tests; the use-site changes have been tested manually.Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:
Scala,
Java,
and
Rust
style guides. In case you are using a language not listed above, follow the Rust style guide.
./run ide build
.