Functions are not Recognised correctly (FORTH)

If reporting a bug with the Zeus IDE please post the details here. Please do not post questions here.
Christian
Posts: 12
Joined: Mon Nov 09, 2015 8:47 am

Functions are not Recognised correctly (FORTH)

Post by Christian » Mon Nov 09, 2015 9:04 am

Hello,

i am testing around a bit with Zeus Edit for SwiftForth. Targeted at replacing our current Editor.
Keywords and Coloring is not a big problem, but the Function tagging is.

Let's say i have a Funtion called XYZ! it is found by the Funtion Tab as XYZ and not with the "!" i have erased "!" from the Delimiters Field but nothing changed.

Could it be that the tagging Programm can't handle "!" ?

For Sure it would be possible to programm without "!" as a part of a Function Name, but in that case i have to update all current Projects as this spelling was used a lot due to easy recognition for store and fetch functions.

On the other side "@" works quite fine and is recognised in the correct way. E.G XYZ@ is recognised as XYZ@in the Functions tab.

jussij
Site Admin
Posts: 2512
Joined: Fri Aug 13, 2004 5:10 pm

Re: Functions are not Recognised correctly (FORTH)

Post by jussij » Mon Nov 09, 2015 1:20 pm

It does sound you have found an issue with the Zeus ctags tagger :(

If you post a short sample piece of FORTH code that does not parse properly that will make it easier to identify this issue.

Cheers Jussi

Christian
Posts: 12
Joined: Mon Nov 09, 2015 8:47 am

Re: Functions are not Recognised correctly (FORTH)

Post by Christian » Mon Nov 09, 2015 1:38 pm

It is very Simple.
But the File has to be placed in a Workspace in order to open the Functions Tab.

Code: Select all

: function! ." wont Work" ;

: function@ ." will Work" ;

\ File needs to be in a Workspace. Then open the Functions Tab
\ end there you find function and function@ but none with "!"
These are simply two Functions to show the effect.

jussij
Site Admin
Posts: 2512
Joined: Fri Aug 13, 2004 5:10 pm

Re: Functions are not Recognised correctly (FORTH)

Post by jussij » Tue Nov 10, 2015 6:44 am

Could you try this new xtags.exe found in the link below:

http://www.zeusedit.com/z300/xtags.zip

Just replace the xtags.exe found here with the one from the zip file.

Code: Select all

C:\Program Files (x86)\Zeus\
Also remember to do Tags, Rebuild found on the Tags menu.

Cheers Jussi

Christian
Posts: 12
Joined: Mon Nov 09, 2015 8:47 am

Re: Functions are not Recognised correctly (FORTH)

Post by Christian » Tue Nov 10, 2015 7:19 am

Replaced it and now it behaves like it should.

Thank you for your fast response and Problem solving.

jussij
Site Admin
Posts: 2512
Joined: Fri Aug 13, 2004 5:10 pm

Re: Functions are not Recognised correctly (FORTH)

Post by jussij » Tue Nov 10, 2015 7:30 am

Glad to read it is now working as expected :)

If you find any other issues with the FORTH tagging don't hesitate to post another bug report.

Also, if you have suggests on how the FORTH tagging could be improved, fell free to also post those suggestions to the forum.

Cheers Jussi

Christian
Posts: 12
Joined: Mon Nov 09, 2015 8:47 am

Re: Functions are not Recognised correctly (FORTH)

Post by Christian » Thu Nov 12, 2015 11:06 am

It seems i have fond another thing while looking through our Workfiles.

First of all
Another tagging Problem if "-" is used seems like same Problem as with "!" the last time.

And a problem with the Import of a Keyfile wich contains [ or ] as enclosure/start/end of a defined Word.

In the dialouge Box inside Zeus it is possible to enter such expressions.
If you Try to import it, everything after a used [ or ] wil be cut away from importing.

Last thing for today, when using a block Comment control element inside a comment (not line comment ) it takes over the whole comment control.
Sounds weird but i hope i can help with the folowing example:

Code: Select all


blablabla ( text { )
shouldnotbecomment
blablabla ( text } )

blablabla \ ( text { )
shouldnotbecomment
blablabla  \ ( text } )

To reproduce my problem. Set up ( and ) for comment 1 together with \ as line comment
For comment 2 it would be { and }.

Greetings
Christian

jussij
Site Admin
Posts: 2512
Joined: Fri Aug 13, 2004 5:10 pm

Re: Functions are not Recognised correctly (FORTH)

Post by jussij » Thu Nov 12, 2015 12:45 pm

Hi Christian,
Another tagging Problem if "-" is used seems like same Problem as with "!" the last time.
Are you saying that the "-" can also be used as part of the function name as shown below:

Code: Select all

: function- ." should be found as a function????" ;
And a problem with the Import of a Keyfile which contains [ or ] as enclosure/start/end of a defined Word.

All the Zeus exported files are just Windows INI files and since that file format uses [] characters to mark sections, I suspect might be causing this issue.

Can you try escaping those characters :?:

Code: Select all

\[ \]
Last thing for today, when using a block Comment control element inside a comment (not line comment ) it takes over the whole comment control.
Thanks for the code. I see what is going wrong.

Cheers Jussi

Christian
Posts: 12
Joined: Mon Nov 09, 2015 8:47 am

Re: Functions are not Recognised correctly (FORTH)

Post by Christian » Thu Nov 12, 2015 1:20 pm

Hello Jussi

Yes function names could be with - and _ e.g:

Code: Select all

function-do_something
fun-ction
do_something
Names like this appear from time to time in the Files i got provided to get Zeus tested and running. ( We purchased it yesterday as the function tab is very comfortable in comparison to our old editor )

That escaping tipp was partly working.
If i escape a Word like

Code: Select all

\[+ASSEMBLER]
it is parsed but with the leading \
Now it is not that big of a Problem as escaping allows me to import the rest of the following Keywords, and altering these Escape marcs is not that hard for me.

As always thank you for your fast response.
P.S. is there a way to set up multiple String delimiters ?

jussij
Site Admin
Posts: 2512
Joined: Fri Aug 13, 2004 5:10 pm

Re: Functions are not Recognised correctly (FORTH)

Post by jussij » Thu Nov 12, 2015 10:14 pm

Hi Christian,

Can you try the new beta version found here: http://www.zeusedit.com/z300/zeus-beta.zip

The zip file contains a set of replacement files for this folder:

Code: Select all

c:\Program Files (x86)\Zeus\
IMPORTANT: Before you overwrite that folder make sure you take a backup copy.

This version should fix the function and comment issues reported.
That escaping tipp was partly working.
If you e-mail me your import file (click on my user ID, top left) I'd be happy to take a closer look at this.
P.S. is there a way to set up multiple String delimiters ?
Can you post a code example of what you are trying to do :?:

Cheers Jussi

Christian
Posts: 12
Joined: Mon Nov 09, 2015 8:47 am

Re: Functions are not Recognised correctly (FORTH)

Post by Christian » Fri Nov 13, 2015 8:28 am

Good morning Jussi,

Im trying the beta after this Post.

I searched for a e-Mail Adress but could not find another than info@zeusedit.com is this the right one ?
But as i think this File Could help more people than me i will attach it at the Bottom of the Post.

As for the String coding, here are some examples:
( <string> seen as the string text )

Code: Select all

," <string>"
,\" <string>"
,U" <string>"
,U\" <string>"
,Z" <string>"
,Z\" <string>"
C\" <string>"
S\" <string>"
Z" <string>"
Z\" <string>"
." <string>"
As you can see there are many string startings. But all end with a "
What i want to do is similar to the Keywords File, define multiple String start Delimiters together with the general String ending. Targeted as aid for Syntax highliting.


As said this is the .zki File

Code: Select all

;
; Zeus Keyword Information File
; =========================================
;
; This is a keyword information file for the Zeus IDE:
;
;     http://www.zeusedit.com/index.html
;
; This file can be used to create or configure the Keywords section
; of the Zeus document type.
;
; NOTE: To correctly import this file make sure it has a .zki file
;       extension.
;

[Syntax]
CommentStart01=( 
CommentEnd01= )
NestsComments01=No
LineComment01=\ 
CommentStart02={
CommentEnd02=}
NestsComments02=No
LineComment02=
Delimiters=:;
DelimitKeywords=No
IgnoreCase=Yes
Literal=
ManageComments=No
Numbers=(0[xX]*+[0-9A-Fa-f]+[Hh]*)|([0-9]+[.eEi+\-0-9L]*)|([$]+[0-9A-Fa-f]+)|([%]+[0-9]+)
Preprocessor=
Strings=
TripleQuotes=No

[ReservedWords]
++
(.)
-?
-BALANCE
-LOAD
-MAPPED
-ORIGIN
-PROGRASS
-SMUDGE
,REL
:PRUNE
:REMEMBER
!*
!NOW
!REL
!TIME&DATE
?FSTACK
?PART
?PRUNE
?PRUNED
.\"
.DATE
.IMPORTS
.LIBS
.MAP
.PARTS
.PROGRESS
.SPART
.TIME
'MAIN
'SELF
'THIS
(-STYLE
(+STYLE
(DATE)
(FONT
(SFDATE)
(STYLE
(TIME)
(WID-CREATE)
(WINLONGDATE)
(WINSHORTDATE)

\[+ASSEMBLER]
\[+SWITCH
\[C
\[FORTH]
\[MODAL
\[MODELESS
\[OBJECTS
\[OPTIONAL]
\[PREVIOUS]
\[SWITCH
\[U]

{
@+
@DATE
@EXECUTE
@NOW
@REL
@TIME
/ALLOT
/FSTACK
\\
&OF
#STRANDS
#USER
+BALANCE
+ORIGIN
+PROGRESS
+SMUDGE
+TO
+USER
<
<=
<LINK
>
>=
>BODY
>CODE
>f
>fs
>LINK
>NAME
>NUMBER
>PRINT
>THROW
~!+
0<
0<>
0=
0>
0>=
1/N
3DROP
3DUP
ACTIVATE
ADDR
AFTER
AGAIN
API
APPEND
AS
ASSEMBLER
B
BASE
BEGIN
BINARY
BODY>
BUFFER:
BUILDS
BUILDS[]
C]
CALLS
CB:
CC
CC-WORDS
CHART
CHECKITEM
CLASS
CLOSE-PERSONALITY
CODE
CODE>
CONFIG:
CONSTRUCT
COS
COT
COTUNER
CS
CSC
CSTATE
D/M/Y
D>F
DASM
DATE
DDE-END
DDE-INIT
DDE-REQ
DDE-SEND
DECIMAL
DefaultClass
DEFER
DEFER:
DefineClass
DESTROY
DF+!
DFCONSTANT
DFI,
DFI!
DFI@
DFLITERAL
DFVARIABLE
DIALOG
DPL
DUMP
ECXNZ
EDIT
ELSE
EMPTY
END-CLASS
END-CODE
END-PACKAGE
ENG
ENUM
ENUM4
EXPIRED
EXPORT:
F,
F?DUP
F.R
F+!
f>
F>D
F>S
F2*
F2/
F2DUP
FI,
FI!
FI@
FLITERAL
FLUSH
FS,
FS.R
fs>
FUNCTION:
FWITHIN
FYI
G
GET
GET-XY
GILD
GRAYITEM
HALT
HDUMP
HEX
HILO
HIS
HIWORD
HOURS
HWND
ICODE
IDUMP
IF
IMMEDIATE
INCLUDE
INCLUDING
IS
ITEM
KILL
KNOWN-VKEYS
L
L:
L#
LABEL
LIBRARY
LMATRIX
LMD
LOADUSING
LOCATE
LOWORD
LPARAM
M/D/Y
MAKE-FLOOR
MAKE-ROUND
MAKES
MAPS
MAPS"
MEM
MEMBERS
MEMTOP
MENU
MENUITEM
MESSAGE:
MODIFY
MS
MSG
N
N.
NAME>
NAMES
NEVER
NEW
NEWFILE
NEXT-WORD
NH
NOT
NOW
NTH_PARAM
NUMBER
NUMBER?
OBJECTS]
OCTAL
OFF
ON
OPEN-PERSONALITY
OPTIONAL
ORIGIN
OV
PACKAGE
PAD
PART
PAUSE
PE
PLACE
PO
POPPATH
POPUP
PRIVATE
PROGRAM
PROGRAM-SEALED
PROGRESS-NAME
PROGRESS-TEXT
PROTECTED
PUBLIC
PUSHPATH
READONLY
RELEASE
REMEMBER
REPEAT
REQUIRES
RESUME
RUN:
RUNS
S>F
SBLEFT
SBRIGHT
SCI
SEARCH-WORDLIST
SEC
SEE
SENDMSG
SEPARATOR
SERVER
SET-PRECISION
SF+!
SFCONSTANT
SFI,
SFI!
SFI@
SFLITERAL
SFVARIABLE
SILENT
SIN
Sleep
SMATRIX
SMD
STOP
STRING,
SUBCLASS
SUPREME
SUSPEND
SWITCH]
TAN
TASK
TERMINATE
THEN
TIME
TIME&DATE
TIMER
TO
TOPIC
U<
U<=
U>
U>=
UBETWEEN
uCOUNTER
UDUMP
UNCALLED
UNMAP
UNMAPPED
UNMAPS
UNTIL
UNUSED
USING
uTIMER
VERBOSE
WARNING
WATCH
WHERE
WHILE
WINERROR
WORDLIST
WPARAM
ZAPPEND
ZERO
ZPLACE



[ExReservedWords]
Pattern=
IsNested=No

[UserWords1]


[ExUserWords1]
Pattern=
IsNested=No

[UserWords2]


[ExUserWords2]
Pattern=
IsNested=No

[UserWords3]

[ExUserWords3]
Pattern=
IsNested=No

[UserWords4]

[ExUserWords4]
Pattern=
IsNested=No

[UserWords5]

[ExUserWords5]

Pattern=
IsNested=No



Christian
Posts: 12
Joined: Mon Nov 09, 2015 8:47 am

Re: Functions are not Recognised correctly (FORTH)

Post by Christian » Fri Nov 13, 2015 8:50 am

Tried the Beta, but unfortunately it broke the whole Tagging.
I have tried to rebuild the Tags database and on that point there are no more Functions Found.

And there is no change in the comment thing. My current Codepart Problem is:

Code: Select all


00000000 C,C
00000000 C,C
00001000 C,C
00110110 C,C
01000001 C,C
00000000 C,C
00000000 C,C
00000000 C,C  ( ASCII { )

00000000 C,C
00000000 C,C
00000000 C,C
01111111 C,C
00000000 C,C
00000000 C,C
00000000 C,C
00000000 C,C  ( ASCII | )

00000000 C,C
00000000 C,C
01000001 C,C
00110110 C,C
00001000 C,C
00000000 C,C
00000000 C,C
00000000 C,C ( ASCII } )


jussij
Site Admin
Posts: 2512
Joined: Fri Aug 13, 2004 5:10 pm

Re: Functions are not Recognised correctly (FORTH)

Post by jussij » Mon Nov 16, 2015 1:02 am

There is a new Zeus beta version found here:

http://www.zeusedit.com/z300/zeus-beta.zip

IMPORTANT: As always backup your current version.

The version number shown in the About box should be Beta6.

This version should now identify the functions correctly.

This version will also handle the export and import of these types of key words.

Code: Select all

\[+ASSEMBLER]
\[+SWITCH
\[C
\[FORTH]
On export the words will be delimiter and on import they will be fixed.

The export and import should now also handle the case where whitespace makes up the comment strings, something that it was not working previously:

Code: Select all

CommentStart01="( "
CommentEnd01=" )"
LineComment01="\ "
Finally the other issue raise was regarding broken comment blocks.

This case should now be fixed:

Code: Select all

abc ( this is comment )
this is not comment
efg ( this is comment )
this is not comment
But the other case that was raise as follows:

Code: Select all

00000000 C,C  ( this is comment { )
00000000 C,C this should not be but is
00000000 C,C ( ASCII } )
00000000 C,C  \ the start of this line is not comment
This is still broken, for the reason this is code that contains a block comment #2 (i.e. "{ }") inside a block comment #1 and that type of nested commenting is not supported :(

Cheers Jussi

Christian
Posts: 12
Joined: Mon Nov 09, 2015 8:47 am

Re: Functions are not Recognised correctly (FORTH)

Post by Christian » Mon Nov 16, 2015 8:32 am

Good Morning Jussi

Beta Import and Export is working fine.

Other things i noticed. Escaping words also works for the Tagging. ( with / instead of \ )
This wasn't done in the previous tagging build. ( so i say the old engine from 3.97z with the ! recognition was the best so far for me ) Have yo got a Charackterlist for the tagging Engine. So that one can see wich Charakters one could use ?

I am currently running the Beta6 with the ztags.exe from this thread.

Thank you for your work on your editor. I knew it is hard to get a Editor working for Forth as this is hardly a mainstream programming language.

jussij
Site Admin
Posts: 2512
Joined: Fri Aug 13, 2004 5:10 pm

Re: Functions are not Recognised correctly (FORTH)

Post by jussij » Tue Nov 17, 2015 1:42 am

so i say the old engine from 3.97z with the ! recognition was the best so far for me
To roll back to that version just use the xtags.exe from that earlier zip file.

The tagging of Forth functions, as defined by ctags, is very simple. It is nothing more than a regular expression.

So what you are seeing is, that by changing the regexp also changes what gets picked up as a FORTH function :(

So the problem is that regexp is just wrong :(

But to fix this requires you to give me a more accurate definition of what are functions and what are not functions so I can then craft a more accurate regexp.

For example, what are the lines of code that are now being registering as function but are not :?:

On a related issue, Zeus has many tag types available for use, but at this time FORTH only uses three of those.

But if there is a patterns of code that you want identified and have them appear in the Zeus class browser then that is possible.

Once again all that is needed is some example code showing these code patterns and then I can create a regexp to identify those items.

Cheers Jussi

Post Reply
kuchnie warszawa opinie

Who is online

Users browsing this forum: No registered users and 1 guest