-
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Adds Extracted PLI Compiler Messages/Codes #6
base: feature/langium-project
Are you sure you want to change the base?
Conversation
Co-authored-by: Benjamin Wilson <[email protected]> Co-authored-by: Markus Rudolph <[email protected]> Signed-off-by: Mark Sujew <[email protected]>
cfcd5bf
to
6b5d434
Compare
export const Info = { | ||
|
||
/** | ||
* This message is used in building the options listing. |
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.
I think it would be helpful to have the explanation also embedded as a string.
Both message and explanation have a value for the user. The page number could be also stored as a number for a goto feature if someone wants this (just an idea).
@@ -0,0 +1,18347 @@ | |||
/** | |||
* Generated by process-codes-into-ts.ts |
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.
Where is the generator? Are there reasons to hide it? Would be great if we would be able to make the file also for future or other versions of the documentation.
node: bound, | ||
property: "bound1", | ||
code: "IBM1295IE" | ||
code: code.fullCode |
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.
Not sure if we need the full code here, because VS Code has also a severity which could be mapped to the PL/I severities... but not entirely, I guess.
|
||
export function IBM1295IE_sole_bound_specified(bound: DimensionBound, accept: ValidationAcceptor): void { | ||
if(bound.bound2 !== undefined) { | ||
return; | ||
} | ||
const upper = bound.bound1; | ||
if(isBoundNegative(upper) || isBoundZero(upper)) { | ||
accept("error", "Sole bound specified is less than 1. An upper bound of 1 is assumed.", { | ||
const code = Error.IBM1295I; | ||
accept("error", code.message, { |
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.
"Accepting" the message code could be a one-liner using a helper method. That can be done in a follow-up PR I think...
Just writing it down because of code redundancy reasons: If we do it like this all the time, we are doing too much again and again.
Adds in what was extracted from the 6.1 compiler messages & codes document. Much in the same fashion as tests were extracted, there's over 1k codes, along with detailed messages & explanations. This pulls it all together into a TS file that we can reference with full information intact, ideally making it easier as we start to work these into validations.
Heads-up, the synthesized codes file is over 18k lines long. It's a bit large up front, but we're going to, eventually, need all of these for full support down the road.
One validation is updated to show how this works in practice, the rest can be trivially updated as well. I was also able to auto-detect when params were likely needing to be substituted, and modified those cases to be parametric pli code objects. In that way, usage requires you to provide the params to complete the message as intended.