1
1
2
2
const assert = require ( `assert` ) ;
3
+ const path = require ( `path` ) ;
3
4
4
5
const { default : parserSetup } = require ( `../parserSetup` ) ;
5
6
@@ -416,6 +417,37 @@ exports.fixed9_2 = async () => {
416
417
assert . strictEqual ( theExtProcedure . subItems . length , 1 ) ;
417
418
} ;
418
419
420
+
421
+
422
+ exports . fixed9_3 = async ( ) => {
423
+ const lines = [
424
+ `` ,
425
+ ` Ctl-Opt DftActGrp(*No);` ,
426
+ ` /copy tests,eof4 Call plist update program ESF` ,
427
+ ` *COPY EQCPYLESRC,PLUPT_SB Call plist update program ESF` ,
428
+ `` ,
429
+ ` Dcl-s MyVariable2 Char(20);` ,
430
+ `` ,
431
+ ` Dcl-C theConstant 'Hello world';` ,
432
+ `` ,
433
+ ` dsply theConstant;` ,
434
+ `` ,
435
+ ` Return;`
436
+ ] . join ( `\n` ) ;
437
+
438
+ const cache = await parser . getDocs ( uri , lines , { withIncludes : true , ignoreCache : true } ) ;
439
+
440
+ assert . strictEqual ( cache . includes . length , 1 ) ;
441
+ assert . strictEqual ( cache . variables . length , 1 , `Expect length of 1` ) ;
442
+ assert . strictEqual ( cache . constants . length , 1 , `Expect length of 1` ) ;
443
+ assert . strictEqual ( cache . procedures . length , 1 , `Expect length of 1` ) ;
444
+
445
+ const uppercase = cache . find ( `UPPERCASE` ) ;
446
+
447
+ const baseNameInclude = path . basename ( uppercase . position . path ) ;
448
+ assert . strictEqual ( baseNameInclude , `eof4.rpgle` ) ;
449
+ }
450
+
419
451
/**
420
452
* Issue with detecting correct type on subfield.
421
453
*/
@@ -1088,4 +1120,54 @@ exports.file_keywords = async () => {
1088
1120
assert . strictEqual ( ord100d . keyword [ `INDDS` ] , `indds` ) ;
1089
1121
assert . strictEqual ( ord100d . keyword [ `SFILE` ] , `sfl01:rrn01` ) ;
1090
1122
assert . strictEqual ( ord100d . keyword [ `INFDS` ] , `Info` ) ;
1123
+ }
1124
+
1125
+ exports . plist_test = async ( ) => {
1126
+ const lines = [
1127
+ `` ,
1128
+ ` ?* PLPVD` ,
1129
+ ` ?* PLPVD - Calling Plist for prompt/validate module driver PLPVD` ,
1130
+ ` ?* PLPVD` ,
1131
+ ` ?* Kaprog - E3A PLPVD` ,
1132
+ ` ?* PLPVD` ,
1133
+ ` ?* @PGMID - Program name PLPVD` ,
1134
+ ` ?* @FLN - Field to prompt/validate on PLPVD` ,
1135
+ ` ?* @SQN - Sequence number of type of validation/prompt PLPVD` ,
1136
+ ` ?* @PRMPT - Prompt mode ('Y' or 'N') PLPVD` ,
1137
+ ` ?* CCN - Communication array PLPVD` ,
1138
+ ` ?* @ERMSG - Error message return field & parms PLPVD` ,
1139
+ ` ?* @NUM - Numeric return field PLPVD` ,
1140
+ ` ?* @CKEY - Command key used from prompt screen return field PLPVD` ,
1141
+ ` ?* @PPF - Prompt performed flag ('Y' or 'N') returned PLPVD` ,
1142
+ ` ?* @DSCNTRL - API Control Fields PLPVD` ,
1143
+ ` ?* @DSSUPER - API Supervisor Data PLPVD` ,
1144
+ ` ?* @DSINCRM - API Incremental Mode Control Fields PLPVD` ,
1145
+ ` ?* @DSPV - PV Control Fields PLPVD` ,
1146
+ ` ?* @DLFILTER - DL Filter Data PLDLD` ,
1147
+ ` ?* @DLLIST - Array of DL row data PLDLD` ,
1148
+ ` ?* @DLSELECTION - DL Selected Item PLDLD` ,
1149
+ ` ?* PLDLD` ,
1150
+ ` C PLPVD PLIST` ,
1151
+ ` C PARM @PGMID 10` ,
1152
+ ` C PARM @FLN 6` ,
1153
+ ` C PARM @SQN 2 0` ,
1154
+ ` C PARM @PRMPT 1` ,
1155
+ ` C PARM CCN` ,
1156
+ ` C DSEPMS PARM DSEPMS @ERMSG 37` ,
1157
+ ` C PARM @NUM 15 0` ,
1158
+ ` C PARM @CKEY 2` ,
1159
+ ` C PARM @PPF 1` ,
1160
+ ` C PARM @DSCNTRL` ,
1161
+ ` C PARM @DSSUPER` ,
1162
+ ` C PARM @DSINCRM` ,
1163
+ ` C PARM @DSPV` ,
1164
+ ` C PARM @PVFILTER 256` ,
1165
+ ` C PARM @PVLIST 9999` ,
1166
+ ` C PARM @PVSELECTION 256` ,
1167
+ ``
1168
+ ] . join ( `\n` ) ;
1169
+
1170
+ const cache = await parser . getDocs ( uri , lines , { ignoreCache : true , withIncludes : true } ) ;
1171
+
1172
+ assert . strictEqual ( cache . variables . length , 0 ) ;
1091
1173
}
0 commit comments