IBM / zopeneditor-about

IBM Z Open Editor: File issues here!
https://ibm.github.io/zopeneditor-about
Apache License 2.0
47 stars 25 forks source link

PL/1 false positive syntax errors and highlighting issues #392

Open tombav opened 3 months ago

tombav commented 3 months ago

Development environment used

Problem Description

  1. A size of the HANDLER is valid but is marked as an error image

  2. FILE VARIABLE is valid syntax image

  3. Some keywords followed by comma are not highlighted as keywords image

  4. Other valid syntax marked as error. image

    The CALLER_AMODE variable is passed using INCAFTER compile option where the included file contains one line: image

Russell-May commented 3 months ago

Hi @tombav , I'm trying to replicate these syntax errors and highlighting issues, can you provide an example pli file with these issues in them as the context of the source can play a role in what may be parsing incorrectly. Thanks.

tombav commented 3 months ago

Copy & paste the following examples. Each example to its own new file.


  DEFINE STRUCTURE
  1 test_struct,
   3 el0  FILE VARIABLE ,  /* marked as error */
   3 el1  FILE VARIABLE,   /* marked as error + VARIABLE keyword is not colorized as keyword. */
   3 el2  PTR;
  DEFINE STRUCTURE
  1 test_struct,
   3 el2  PTR ,        /* ok */
   3 el20 PTR,         /* keyword not colorized */
   3 el3  PTR(32),     /* marked as error */
   3 el4  PTR(64),     /* marked as error */
   3 el5  HANDLE,      /* keyword not colorized */
   3 el50 HANDLE ,     /* ok */
   3 el6  HANDLE(32),  /* marked as error */
   3 el7  HANDLE(64);  /* marked as error */
 TPROC2: PROC(parm1)
            OPTIONS(FETCHABLE AMODE31 NODESCRIPTOR CMPAT(V2) LINKAGE(OPTLINK))
            EXTERNAL;

  DCL parm1 PTR;

 END TPROC2;

 // The CALLER_AMODE variable is passed using INCAFTER compile option where the included file 
 // contains the following line:
 // %DCL CALLER_AMODE FIXED INIT(64);  Feel free to uncomment to see what will change in that case
 %SELECT(CALLER_AMODE);  
 %WHEN(31) %DO;
  TPROC1: PROC(parm1)
            OPTIONS(FETCHABLE NODESCRIPTOR)
            EXTERNAL;
 %END;
 %WHEN(64) %DO;
  TPROC2: PROC(parm1)
            OPTIONS(FETCHABLE AMODE31 NODESCRIPTOR CMPAT(V2) LINKAGE(OPTLINK))
            EXTERNAL;
 %END;
 %OTHERWISE %DO;
   NOTE("Unsupported caller AMODE.", 12);
 %END;
 %END;

   DCL parm1 CHAR(*) VAR BYADDR INONLY;

 %SELECT(CALLER_AMODE);
 %WHEN(31) %DO;
  END TPROC1;
 %END;
 %WHEN(64) %DO;
  END TPROC2;
 %END;
 %OTHERWISE %DO;
   NOTE("Unsupported caller AMODE.", 12);
 %END;
 %END;