XY Script: Color Syntax for EditPadPro

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
tux.

Re: XY Script: Color Syntax for EditPadPro

Post by tux. »

If anyone is interested, I have just started writing an syntax file for the Vim text editor.

Code: Select all

" Vim syntax file
" Language:     XYplorer Script 
" Maintainer:   tux. <der underscore tuxman at arcor dot de>
" Filenames:    *.xys 
" Last change:  July 19 2010

if exists("b:current_syntax") | finish | endif

syn match XYbraces     "[({\[\]})]"
syn match XYlncomment  "\/\/.*"
syn match XYvariable   "\$[A-Za-z0-9-_\.]+"
syn match XYpredefvar  "%[A-Za-z]%+"
syn match XYoperator   "and|or|xor|&&|\|\||like|likei|>|<|>=|<=|!=|=="
syn match XYidentifier "<[A-Za-z0-9]>"
syn region XYstring    start=+"+  skip=+\\"+  end=+"+
syn region XYcomment   start="/\*"  end="\*/" contains=@Spell

syn keyword XYcommands asc assert backupto beep box br break button chr comment compare confirm continue copy copyas copyitem copytext copyto datediff delete download echo end eval exists filetype filter focus formatdate getinfo getkey gettoken global goto hexdump highlight html incr input inputfile inputfolder isunicode load loadsearch loadtree md5 moveto msg new open openwith property quote rand readfile readurl regexreplace rename replace report resolvepath rotate run savesettings selfilter sel self seltab set setkey setting settingp sortby sound status step strlen strpos strrepeat sub substr swapnames tag text timestamp toolbar unset unstep urldecode urlencode utf8decode utf8encode writefile

syn keyword XYconditional  if elseif else
syn keyword XYrepeat	   while
syn match   XYboolean      "true|false"

command -nargs=+ HiLink hi def link <args>

HiLink XYcomment      Comment
HiLink XYlncomment    Comment
HiLink XYcommands     Function
HiLink XYbraces       Function
HiLink XYvariable     Identifier
HiLink XYidentifier   Identifier
HiLink XYpredefvar    Identifier
HiLink XYconditional  Conditional
HiLink XYrepeat       Repeat
HiLink XYboolean      Boolean
HiLink XYoperator     Operator
HiLink XYstring       String

delcommand HiLink

let b:current_syntax = "xyscript"

" vim:wrap
It still fails to detect variables correctly, also some strings are improperly detected. I will improve it when I find the time again.
(Any help is appreciated.)

Put it into your /syntax folder and use :set ft=xys for your scripts to use it...

Pagat
Posts: 306
Joined: 09 Oct 2007 21:23
Location: Austria

Re: XY Script: Color Syntax for EditPadPro

Post by Pagat »

i updated the UltraEdit wordfile:

Code: Select all

/L20"XYplorer Script" Nocase Line Comment = // Block Comment On = /* Block Comment Off = */ String Chars = "' File Extensions = XYS
/Delimiters = ~!^&*()-+=|\/{}[]:;"'` ,	.
/Function String = "%\"*"
/Open Brace Strings =  "{" "(" "["
/Close Brace Strings = "}" ")" "]"
/Open Fold Strings = "{"
/Close Fold Strings = "}"
/C1"Control Structures" STYLE_KEYWORD
break
continue
else elseif end
if
while
/C2"Built-in Variables" STYLE_VARIABLE
<base> <clipboard> <curbase> <curext> <curfolder> <curitem> <curitempath> <curitem_dos> <curname> <curpath> <curpath_s> <curpath_dos> <cursize> <curtab> <curver> <focitem> <items> <item1> <item2> <selitems> <srcbase> <srcext> <srctitle> <srcver> <xyexe> <xydata> <xydrive> <xyini> <xypane> <xypath> <xyscripts> <xyver>
<crlf> <tab>
** <date <datea <datec <datem
false
true
/C3"Environment Variables" STYLE_VARIABLE
%allusersprofile% %appdata% %commonappdatapath% %commonprogramfiles% %computer% %desktop% %desktopreal% %net% %personal% %personalreal% %programfiles% %recycler% %systemdrive% %systemroot% %temp% %tmp% %userprofile% %windir% %winsysdir%
/C4"Variables" STYLE_VARIABLE
** $
/C5"Operators" STYLE_OPERATOR
+ - * / ! == != < <<< > <= => && || ? :
and
or
Like LikeI
not
xor
/C6"Built-in Functions" STYLE_FUNCTION
asc assert
backupto beep box br button
call catalogload chr Comment compare confirm copy copyas copyitem copytext copyto
datediff delete download
echo end eval exists
filetype filter focus format formatbytes formatdate formatlist
get getkey gettoken global goto
hexdump highlight html
incr input inputfile inputfolder inputselect isunicode internetflags
listfolder listpane load loadsearch loadtree
makecoffee md5 moveto msg
new
open openwith
property
quote
rand readfile readurl recase regexreplace rename replace replacelist report resolvepath rotate run
savesettings sel selectitems self selfilter seltab set setkey setting settingp sortby sound status step strlen strpos strrepeat sub substr swapnames sync
tab tag text timestamp toolbar
unset unstep urldecode urlencode utf8decode utf8encode
writefile
/C7"Numeric Functions" STYLE_FUNCTION
** #
/C8"not used"
edit: forgot to update the xy and environment variables... done...
edit2: forgot to add the new boolean operators "not" / "!"... done

EnjoyRC
Posts: 101
Joined: 08 Nov 2010 21:54

Re: XY Script: Color Syntax for EditPadPro

Post by EnjoyRC »

Thank you so much for your time and efforts to make the UltraEdit Wordfile.

Pagat
Posts: 306
Joined: 09 Oct 2007 21:23
Location: Austria

Re: XY Script: Color Syntax for EditPadPro

Post by Pagat »

added UnLike, UnLikeI operators and hash function to UltraEdit wordfile:

Code: Select all

/L20"XYplorer Script" Nocase Line Comment = // Block Comment On = /* Block Comment Off = */ String Chars = "' File Extensions = XYS
/Delimiters = ~!^&*()-+=|\/{}[]:;"'` ,	.
/Function String = "%\"*"
/Open Brace Strings =  "{" "(" "["
/Close Brace Strings = "}" ")" "]"
/Open Fold Strings = "{"
/Close Fold Strings = "}"
/C1"Control Structures" STYLE_KEYWORD
break
continue
else elseif end
if
while
/C2"Built-in Variables" STYLE_VARIABLE
<base> <clipboard> <curbase> <curext> <curfolder> <curitem> <curitempath> <curitem_dos> <curname> <curpath> <curpath_s> <curpath_dos> <cursize> <curtab> <curver> <focitem> <items> <item1> <item2> <selitems> <srcbase> <srcext> <srctitle> <srcver> <xyexe> <xydata> <xydrive> <xyini> <xypane> <xypath> <xyscripts> <xyver>
<crlf> <tab>
** <date <datea <datec <datem
false
true
/C3"Environment Variables" STYLE_VARIABLE
%allusersprofile% %appdata% %commonappdatapath% %commonprogramfiles% %computer% %desktop% %desktopreal% %net% %personal% %personalreal% %programfiles% %recycler% %systemdrive% %systemroot% %temp% %tmp% %userprofile% %windir% %winsysdir%
/C4"Variables" STYLE_VARIABLE
** $
/C5"Operators" STYLE_OPERATOR
+ - * / ! == != < <<< > <= => && || ? :
and
or
Like LikeI
not
UnLike UnLikeI
xor
/C6"Built-in Functions" STYLE_FUNCTION
asc assert
backupto beep box br button
call catalogload chr Comment compare confirm copy copyas copyitem copytext copyto
datediff delete download
echo end eval exists
filetype filter focus format formatbytes formatdate formatlist
get getkey gettoken global goto
hash hexdump highlight html
incr input inputfile inputfolder inputselect isunicode internetflags
listfolder listpane load loadsearch loadtree
makecoffee md5 moveto msg
new
open openwith
property
quote
rand readfile readurl recase regexreplace rename replace replacelist report resolvepath rotate run
savesettings sel selectitems self selfilter seltab set setkey setting settingp sortby sound status step strlen strpos strrepeat sub substr swapnames sync
tab tag text timestamp toolbar
unset unstep urldecode urlencode utf8decode utf8encode
writefile
/C7"Numeric Functions" STYLE_FUNCTION
** #
/C8"not used"

Post Reply