Skip to content

Added o spec feature#507

Open
supravi96 wants to merge 5 commits into
codefori:mainfrom
supravi96:O-spec_feature
Open

Added o spec feature#507
supravi96 wants to merge 5 commits into
codefori:mainfrom
supravi96:O-spec_feature

Conversation

@supravi96

@supravi96 supravi96 commented May 5, 2026

Copy link
Copy Markdown

Changes

Added comprehensive O-spec (Output Specification) parsing support to the fixed-form RPG parser in language/models/fixed.js.
Changes Made
New Function: parseOLine()
Implemented a complete parser for fixed-form RPG Output specifications that extracts all standard O-spec fields according to IBM i RPG column positions
contributers @Monikacopilot2

Checklist

  • have tested my change
  • updated relevant documentation
  • Remove any/all console.logs I added
  • eslint is not complaining
  • have added myself to the contributors' list in the README
  • for feature PRs: PR only includes one feature enhancement.

@supravi96 supravi96 marked this pull request as draft May 5, 2026 13:06
@supravi96 supravi96 mentioned this pull request May 6, 2026
@supravi96 supravi96 marked this pull request as ready for review May 6, 2026 04:18
@supravi96

Copy link
Copy Markdown
Author

@worksofliam could you please view this pr .

@bobcozzi bobcozzi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see support for columns 81 to 100 for Comments.
I don't see support for Input specs at all, but since the name is o spec I shouldn't expect that.
There are also several different formats for O specs. In my RPGIV2FREE I have:

  O:    [1, 6, 7, 17, 18, 21, 24, 27, 30, 40, 43, 46, 49],  // Record ID: name, type, flag, 3× indicators, EXCEPT, spacing
  OAnd: [1, 6, 16, 21, 24, 27, 30],                          // AND/OR continuation: AND keyword, 3× indicators, EXCEPT name
  OF:   [1, 6, 21, 24, 27, 30, 44, 45, 47, 52, 53],         // Prog-described field: indicators, name, edit code, end pos, constant
  OFC:  [1, 6, 53],                                          // Field constant continuation
  OXF:  [1, 6, 21, 24, 27, 30, 45],                         // Ext-described field: indicators, name, blank-after
...

Hope this helps

@worksofliam

worksofliam commented May 7, 2026

Copy link
Copy Markdown
Member

@supravi96 we've had some PRs merged again. Can you please fix the conflicts and I can get this reviewed?

Please also see @bobcozzi's comments.

@supravi96

Copy link
Copy Markdown
Author

@worksofliam I have resolved the merge conflicts. While implementing support for different O-spec formats, I wanted to check whether we should include comment support in this PR or if it would be better to address it in a follow-up.

@supravi96 supravi96 marked this pull request as draft May 8, 2026 12:31
@supravi96 supravi96 marked this pull request as ready for review May 13, 2026 06:52
@worksofliam

Copy link
Copy Markdown
Member

@supravi96 just need you to fix the conflicts again and I can test. Thanks!

@supravi96

Copy link
Copy Markdown
Author

@worksofliam conflicts are resolved and code is updated and pushed , Requesting you to please review and provide feedback.

@supravi96

Copy link
Copy Markdown
Author

@bobcozzi could you please mention the expectation with respect to comments ?it should be displayed in outline or highlighted in the parsed code ?

@bobcozzi

Copy link
Copy Markdown
Collaborator

In short, I think the tab positions of the full spec should be included in case future features need them--I'd like to avoid duplicating structures like these or modifying the existing ones. So everything should be included in the tab poition array.

@worksofliam

Copy link
Copy Markdown
Member

@bobcozzi what do you recommend they do to close out this PR? I'd like it clean too :)

@bobcozzi

Copy link
Copy Markdown
Collaborator

I'll look at this later today. I'm integrating the CL Command Help Text into the CLPrompter this morning. Once that's operating as designed, I will look at this and provide the full Output Spec's tab positions.

@bobcozzi

Copy link
Copy Markdown
Collaborator

I added a PR that updates the rulers and adds the missing O spec variants. Let me know if you need me to do anything else.

@bobcozzi

Copy link
Copy Markdown
Collaborator

Hi @supravi96 — I tested your changes locally and found one build-breaking issue: language/models/fixed.js needs to be renamed to language/models/fixed.ts.

Your detectOSpecType function uses a TypeScript union return type:

function detectOSpecType(content: string): 'O' | 'OAnd' | 'OF' | 'OFC' | 'OXF' {

Webpack can't parse TypeScript syntax in a .js file, so the build fails with:

ERROR in ../../language/models/fixed.js 158:32
Module parse failed: Unexpected token (158:32)

Simply renaming the file to fixed.ts fixes it — the import in language/parser.ts uses ./models/fixed (no extension) so no import changes are needed.

Also, separately, I've opened PR #520 which adds correct column ruler and Column Assistant UI support for all five O-spec sub-types (O, OAnd, OF, OFC, OXF) with accurate column positions. That PR and this one are complementary — yours handles parsing, mine handles the editor assist UI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants