You are here: PSPad forum > Developer forum - new builds > Re: PSPad unicode 4.5.5 (2395) English
Goto Page: Previous1 2 3 4 5 6 7 Next
Posted by: human | Date: 2010-10-05 13:24 | IP: IP Logged
Thank you for this new build. I recognized a problem with code explorer that seems to be quite old for COBOL syntax:
PSPad sees "exit section." as a section named exit while this source only leaves the current section (somewhat like return in C).
Nearly the same is the usage of "continue." which is seen as a paragraph (the subordinate item to a section) but is simply a command.
Maybe this issue can be fixed with the next build.
Thank you in advance,
human
Posted by: pspad | Date: 2010-10-05 18:26 | IP: IP Logged
can you send me some source sample?
Posted by: jerzy_s | Date: 2010-10-05 22:14 | IP: IP Logged
Hi!
Here comes an example showing another (old?) error in CE for Cobol. Just paste it into a new Cobol file, replace underlines by spaces and watch the result in CE pane:
000001 IDENFTIFICATION DIVISION.
000002 PROGRAM-ID. CONFUSER.
000003 DATA DIVISION.
000004 WORKING-STORAGE SECTION.
000005 01 PARM-1 PIC X(8).
000006 01 PARM-2 PIC X(8).
000007 PROCEDURE DIVISION.
000008 MAIN SECTION.
000009 PARA-1.
000010 ___ CALL 'SUBMOD' USING PARM-1
000011 _______________________ PARM-2.
000012 PARA-2.
000013 ___ GOBACK.
000014 DUMMY SECTION.
000015 DUMMY-EXIT.
000016 ___ EXIT.
Explanation:
In order to interpret a name as a paragraph name it must start in area-A (i.e. PARM-2 is not a paragraph name).
Posted by: human | Date: 2010-10-06 09:10 | IP: IP Logged
Here comes some sample code including the post before. See the explanations in COBOL comments what can be improved (click the Quote link for this post to get the right indentation):
*-----------------------------------------------------------------
* Program PSPSAM showing some stuff for testing COBOL lexers
* (especially old errors in PSPad COBOL syntax)
*-----------------------------------------------------------------
IDENFTIFICATION DIVISION.
PROGRAM-ID. 'PSPSAM'.
*-----------------------------------------------------------------
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SPECIAL-NAMES.
SYSERR IS MY-ERR
DECIMAL-POINT IS COMMA.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT MY-FILE ASSIGN TO MY-FILE-NAME
ORGANIZATION IS LINE SEQUENTIAL
FILE STATUS IS MY-FILE-STATUS.
SELECT MY-INPFILE ASSIGN TO "INPUT.DAT"
ORGANIZATION IS SEQUENTIAL
FILE STATUS IS MY-FILE-STATUS.
I-O-CONTROL.
DATA DIVISION.
FILE SECTION.
FD MY-FILE.
01 MY-FILE-REC.
02 MY-REC.
03 MY-BIG1 PIC X(32000).
03 MY-BIG2 PIC X(32000).
FD MY-INPFILE.
01 MY-INPFILE-REC.
02 MY-INPREC PIC X(320).
*-----------------------------------------------------------------
WORKING-STORAGE SECTION.
78 MY-FILE-NAME VALUE 'TEST.DAT'.
77 MY-FILE-STATUS PIC X(02).
01 PARM-1.
05 PARM-1-1 PIC X(12).
05 PARM-1-2 PIC X(10).
01 PARM-2 PIC X(80).
COPY WSCPY.
* BASED/ALLOCATE not in PSPad's keywords:
77 BVAR PIC X(650000) BASED.
*-----------------------------------------------------------------
* LOCAL-STORAGE is marked while WORKING-STORAGE is not because
* LOCAL-STORAGE is missing in PSPad's keywords
LOCAL-STORAGE SECTION.
* This var is marked:
01 local-var pic 9 value zero.
88 local-var-unchanged value zero.
* This var is NOT marked (because of two spaces):
* Either all these vars should be marked or none
01 loc2 PIC X(12) VALUE SPACES.
77 loc3 pic 9(05) usage comp-3 value 12.
*-----------------------------------------------------------------
LINKAGE SECTION.
01 some-rec.
02 some-rec-1 pic 9(04).
02 some-rec-2 pic x(4096).
*-----------------------------------------------------------------
PROCEDURE DIVISION USING some-rec.
declaratives.
* Error section for MY-FILE:
DEC-MY SECTION.
USE AFTER STANDARD ERROR PROCEDURE ON MY-FILE.
DM-BEG.
display 'ERROR IN MYFILE: "' MY-FILE-STATUS '"'
* end-display missing in keywords (and not shown as belonging
* to the display, see some2 section for explanation)
end-display
accept loc2
end-accept
* returning missing in keywords
exit program returning 1
DM-END.
EXIT SECTION.
* Error section for all files opened with INPUT:
DEC-MYIN SECTION.
USE AFTER STANDARD ERROR PROCEDURE ON INPUT.
DMI-BEG.
display 'ERROR IN MYINPFILE: "' MY-FILE-STATUS '"'
end-display
accept loc2
end-accept
exit program returning 1
DMI-END.
EXIT SECTION.
end declaratives.
*-----------------------------------------------------------------
MAIN SECTION.
PARA-1.
OPEN INPUT MYINPFILE
READ MYINP-REC END-READ
OPEN OUTPUT MYFILE
perform 2 times
write MYFILE from myinp-rec
end-write
end-perform
CLOSE MYFILE
CLOSE MYINPFILE
ALLOCATE BVAR
MOVE ALL 'A' TO BVAR
CALL 'SUBMOD' USING PARM-1
BVAR
* This is a one-word-line with a dot afterwards,
* not a paragraph.
* DIVISIONs, SECTIONs, paragraphs, FD/SD and lvl 01/77 entries
* have to start in Area A --> columns 8 to 11)
PARM-2.
FREE ADDRESS OF BVAR
* This is simply a normal one-word-command with a dot afterwards,
* Not a paragraph:
continue.
PARA-2.
EXIT PROGRAM.
*-----------------------------------------------------------------
SOME SECTION.
move PARM-1 to PARM-2
* EXIT written uppercase - all fine in Code-Explorer
EXIT SECTION.
*-----------------------------------------------------------------
SOME2 SECTION.
if 1 = 1
CANCEL 'SUBMOD'
* Only if/end-if are shown as belonging together
* (both are highlighted if the cursor is in one of them).
* Can the else be highlighted there, too?
else
continue
end-if
*
evaluate true
* Only evaluate/end-wevaluate are shown as belonging together
* (both are highlighted if the cursor is in one of them).
* Can all when be highlighted there, too?
when 1 = 1
continue
when 0 = 0
continue
end-evaluate
*
* exit written lowercase - shown as a new section
* in Code-Explorer
exit SECTION.
*-----------------------------------------------------------------
* It would be nice to have a list of all used copies in
* Code-Explorer like it is avaliable for includes in C-Syntax.
* Copies can occur EVERYWHERE in the source.
* They can have different ways of naming:
* Without anything (most compilers will look for PDCPY.CBL, then
* PDCPY.CPY, then PDCPY in this case)
COPY PDCPY.
* As literal with/without full name
COPY "PDCPY2.CPY".
COPY "C:\COBOL\CPY\PDCPY2.CPY".
* With IN clause:
COPY "PDCPY3.CPY" IN "C:\COBOL\CPY".
* With al lot of clauses:
COPY PDCPY4
IN CPYBIB
SUPPRESS PRINTING
REPLACING ==SOMETEXT== BY ==SOME OTHER TEXT==
LEADING ==AA-== BY ==PSPSAM==.
*-----------------------------------------------------------------
*--- End of program PSPSAM ---------------------------------------
Thank you for having a look at this.
human
Posted by: human | Date: 2010-10-06 09:22 | IP: IP Logged
One comment missing: declaratives currently not recognized correct as an own area (inside working storage) but as empty paragraph.
human
Posted by: pspad | Date: 2010-10-07 07:40 | IP: IP Logged
Can you help me identify problem in your source code highlighting?
Posted by: human | Date: 2010-10-07 09:16 | IP: IP Logged
Sure. The part from the image has only two problems:
1. missing keywords BASED, ALLOCATE and LOCAL-STORAGE
2. local-var is in grey/blue (don't know why but there is surely a reason), while loc2 isn't.
The other points occur either in code-explorer or are explained where they occur. If useful, I can do some additional explanations like I did with the image you showed us.
human
Posted by: Buoka | Date: 2010-10-13 09:15 | IP: IP Logged
Can someone fix the link to go get the download. All I see is a white page of garbage. Please
Posted by: MrSpock | Date: 2010-10-13 10:06 | IP: IP Logged
Buoka:Can someone fix the link to go get the download. All I see is a white page of garbage. Please
Try saving the "garbage" with a cab file extension from your browser. (Menu File -> Save as ...)
Posted by: MadCompie | Date: 2010-10-13 18:02 | IP: IP Logged
A very good COBOL syntax highlighter for me!
Could it also be possible to integrate inline-comments, these are lines starting with *> from position 12?
(acts just like the // comment in C++)
example:
...
ADD 1 TO X
DISPLAY X *> comment: display value of X...
could it also possible to continue the comment highlight color after pos. 72?
Edited 1 time(s). Last edit at 2010-10-13 18:03 by MadCompie.
Editor PSPad - freeware editor, © 2001 - 2024 Jan Fiala, Hosted by Webhosting TOJEONO.CZ, design by WebDesign PAY & SOFT, code Petr Dvořák, Privacy policy and GDPR