Add pli language#378
Draft
1000TurquoisePogs wants to merge 1 commit intofeature/v3/lang-jclfrom
Draft
Conversation
Signed-off-by: 1000TurquoisePogs <sgrady@rocketsoftware.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Proposed changes
This PR adds a full PL/I language mode to the zlux-editor Monaco integration.
Changes:
webClient/src/app/editor/code-editor/monaco/hiliters/pli.ts— new file containing:PLI_HOVER_DOCS: ~120 entries covering statement and control-flow keywords (PROCEDURE,DO,IF,SELECT,DECLARE,ALLOCATE,ON,GET/PUT/READ/WRITE/OPEN/CLOSE, etc.), data type and variable attribute keywords (FIXED,FLOAT,BINARY,CHARACTER,POINTER,VARYING,BASED,CONTROLLED,EXTERNAL, etc.), ON condition names (ERROR,OVERFLOW,ENDFILE,ZERODIVIDE,CONVERSION,SUBSCRIPTRANGE, etc.), preprocessor directives (%INCLUDE,%IF,%DECLARE,%ACTIVATE,*PROCESS, etc.), and common built-in functions (SUBSTR,LENGTH,ADDR,NULL,ABS,INDEX,TRANSLATE,VERIFY,ONCODE,ONFILE,DATETIME, etc.).PLI_HILITE: Monarch tokenizer (ignoreCase: true) with three keyword sets matched against identifiers:keywords— statement/control-flow words → tokenpli-keyword(yellow bold)attributes— data type and variable attributes → tokenpli-attribute(light blue)builtins— built-in function names → tokenpli-builtin(green bold)/* ... */), line comments (//),%preprocessor directives,*PROCESS/*PROCINCcompiler option records, single- and double-quoted string literals (with''/""escape handling and type suffix), numeric literals (integer, decimal, floating-point with exponent and type suffix), and operators/punctuation.webClient/src/app/editor/code-editor/monaco/monaco.config.ts— updated to:PLI_HILITEandPLI_HOVER_DOCSfrom the new pli module.PLI_LANGand register the language for extensions.pli,.pl1,.pli1.pli-darktheme (yellow keywords, light-blue attributes, green builtins, amber preprocessor directives, white strings, orange numbers, red operators/punctuation).plilanguage that resolves identifiers againstPLI_HOVER_DOCSand also handles%-prefixed preprocessor directives in the hover context.webClient/src/app/shared/editor-control/editor-control.service.ts— addedcase 'pli'tosetThemeForLanguage()so thepli-darktheme activates automatically when a.plior.pl1file is opened.Type of change
PR Checklist
Testing
.plior.pl1file via the File Explorer. The editor should automatically apply the PL/I language mode andpli-darktheme./* ... */) appear in cyan.//) appear in cyan.PROCEDURE,DO,IF,SELECT,DECLARE,CALL,RETURN,ON, etc.) appear in yellow bold.FIXED,BINARY,CHARACTER,POINTER,VARYING,BASED, etc.) appear in light blue.SUBSTR,LENGTH,ADDR,NULL,ABS, etc.) appear in green bold.%INCLUDE,%IF,%DECLARE,*PROCESS) appear in amber bold with underline.'...'and"...") appear in white;''and""escaped quotes are handled correctly.;,,,(,),=,+,-, etc.) appear in red.PROCEDURE,DECLARE,DO,IF,ON,ALLOCATE, etc.) to see its hover tooltip.FIXED,CHARACTER,POINTER,VARYING,BASED, etc.) to see the tooltip.SUBSTR,ADDR,NULL,ONCODE,DATETIME) to see the tooltip.ERROR,ENDFILE,OVERFLOW,ZERODIVIDE) to see the tooltip.INCLUDEin a%INCLUDEline) to see the tooltip.PL/I/PLI..pl1files are also detected automatically.