C#, Inno Script, Autohotkey lexers

All questions regarding lexer highlighting schemes are discussed here...
ANewUser
Posts: 50
Joined: 25.01.2020 12:15

C#, Inno Script, Autohotkey lexers

Post by ANewUser »

Hello!

I have found some additional issues.
C#: accented characters in names (namespace, class, ...)
Autohotkey: not highlighted keywords (for, global, static, class, try/catch/finally, ...)
Inno Script: "; comment" not highlighted when it is not at beginning of the line, the preprocessor line continuation ("<space>\" at line end) is not recognized (from the help file: "By ending lines with ISPP's line spanning symbol preceded with a space, you can split long lines.")
https://i.imgur.com/ZoB3tLa.png
https://i.imgur.com/RhvbxV6.png
https://i.imgur.com/3pO4hca.png

Is it OK, if I will post issues when I find them? I have to examine a lot of source code (C++, Pascal, Python, JavaScript, Lua, PHP, Powershell, and many others) and a decided to use CudaText for the task.

Thank you for your fast replies!
Alexey
Posts: 1633
Joined: 05.10.2012 22:10

Post by Alexey »

Autohotkey: Did you list all missed words? need the full list.

Yes, post ALL issues you will find (i am not sure i can fix all). Also you can post here https://github.com/Alexey-T/CudaText/issues
Alexey
Posts: 1633
Joined: 05.10.2012 22:10

Post by Alexey »

C#, AHK, Inno Setup: just fixed them and updated in addons. Pls test, thanks. (Still need all keywords for AHK)
ANewUser
Posts: 50
Joined: 25.01.2020 12:15

Post by ANewUser »

Thanks!

I will create a list of Autohotkey tokens based on the https://www.autohotkey.com/docs/commands/index.htm.
It must be completed with the built-in variables and operators (https://www.autohotkey.com/docs/Variables.htm).
Alexey
Posts: 1633
Joined: 05.10.2012 22:10

Post by Alexey »

Then give 3 lists, i will make 2 or 3 styles for them (keyword + 1-2 special).
ANewUser
Posts: 50
Joined: 25.01.2020 12:15

Post by ANewUser »

Code: Select all

the built-in variables (edited, there were duplicates in the list):
A_AhkPath
A_AhkVersion
A_AppData
A_AppDataCommon
A_Args
A_AutoTrim
A_BatchLines
A_CaretX
A_CaretY
A_ComputerName
A_ComSpec
A_ControlDelay
A_CoordModeCaret
A_CoordModeMenu
A_CoordModeMouse
A_CoordModePixel
A_CoordModeToolTip
A_Cursor
A_DD
A_DDD
A_DDDD
A_DefaultGui
A_DefaultListView
A_DefaultMouseSpeed
A_DefaultTreeView
A_Desktop
A_DesktopCommon
A_DetectHiddenText
A_DetectHiddenWindows
A_EndChar
A_EventInfo
A_ExitReason
A_FileEncoding
A_FormatFloat
A_FormatInteger
A_Gui
A_GuiControl
A_GuiControlEvent
A_GuiEvent
A_GuiHeight
A_GuiWidth
A_GuiX
A_GuiY
A_Hour
A_IconFile
A_IconHidden
A_IconNumber
A_IconTip
A_Index
A_IPAddress1
A_IPAddress2
A_IPAddress3
A_IPAddress4
A_Is
A_IsAdmin
A_IsCompiled
A_IsCritical
A_IsPaused
A_IsSuspended
A_IsUnicode
A_KeyDelay
A_KeyDelayPlay
A_KeyDuration
A_KeyDurationPlay
A_Language
A_LastError
A_LineFile
A_LineNumber
A_ListLines
A_MDay
A_Min
A_MM
A_MMM
A_MMMM
A_Mon
A_MouseDelay
A_MouseDelayPlay
A_MSec
A_MyDocuments
A_Now
A_NowUTC
A_NumBatchLines
A_OSType
A_OSVersion
A_PriorHotkey
A_PriorKey
A_ProgramFiles
A_Programs
A_ProgramsCommon
A_PtrSize
A_RegView
A_ScreenDPI
A_ScreenHeight
A_ScreenWidth
A_ScriptDir
A_ScriptFullPath
A_ScriptHwnd
A_ScriptName
A_Sec
A_SendLevel
A_SendMode
A_Space
A_StartMenu
A_StartMenuCommon
A_Startup
A_StartupCommon
A_StoreCapsLockMode
A_StringCaseSense
A_Tab
A_Temp
A_ThisFunc
A_ThisHotkey
A_ThisLabel
A_ThisMenu
A_ThisMenuItem
A_ThisMenuItemPos
A_TickCount
A_TimeIdle
A_TimeIdleKeyboard
A_TimeIdleMouse
A_TimeIdlePhysical
A_TimeSincePriorHotkey
A_TimeSinceThisHotkey
A_TitleMatchMode
A_TitleMatchModeSpeed
A_UserName
A_WDay
A_WinDelay
A_WinDir
A_WorkingDir
A_YDay
A_Year
A_YWeek
A_YYYY

there variables are valid in an loop-statement {...}:
A_Index

A_LoopFileName
A_LoopFileExt
A_LoopFileFullPath
A_LoopFilePath
A_LoopFileLongPath
A_LoopFileShortPath
A_LoopFileShortName
A_LoopFileDir
A_LoopFileTimeModified
A_LoopFileTimeCreated
A_LoopFileTimeAccessed
A_LoopFileAttrib
A_LoopFileSize
A_LoopFileSizeKB
A_LoopFileSizeMB

A_LoopRegName
A_LoopRegType
A_LoopRegKey
A_LoopRegSubKey
A_LoopRegTimeModified

A_LoopReadLine

A_LoopField

not in A_* form:
ErrorLevel
Clipboard
ClipboardAll

command line parameters (%a-number-from-0%):
%0%
%1%
%2%
...

variable names can contain letters, numbers, non-ascii characters, and the following four characters: _ # @ $
the maximum length of names is 253

operators and specials, some comments in (...):
? : (ternary, "bool ? if-true : if-false")
% ("%variable-ref%", "%<space-or-tab>some-expression")
. (dot the concatenation or object-access operator, "expr-1 . expr-2", "object.object-member")
new (like "var := new class-name")
++ -- **
~ ^ | & << >>
- + * / //
! not || or && and
~= = == <> != < > <= >=
:= += -= *= /= //= .= ^= |= &= <<= >>=
, (comma)
` (backtick the escape character, ex.: "a line`nthe next line", ...)

labels:
<label-name>: (like "some_label:", the name name can contain any character other than space, tab, comma and the escape)
Last edited by ANewUser on 20.02.2020 12:54, edited 1 time in total.
ANewUser
Posts: 50
Joined: 25.01.2020 12:15

Post by ANewUser »

functions, statements, directives:

Code: Select all

the functions:
==============
Object()
Array()

FileExist()
GetKeyState()
InStr()
RegExMatch()
RegExReplace()
StrLen()
StrReplace()
StrSplit()
SubStr()
WinActive()
WinExist()

Asc()
Chr()
DllCall()
Exception()
FileOpen()
Format()
Func()
GetKeyName()
GetKeyVK()
GetKeySC()
Hotstring()
IL_Create()
IL_Add()
IL_Destroy()
InputHook()
IsByRef()
IsFunc()
IsLabel()
IsObject()
LoadPicture()
LV_Add()
LV_Insert()
LV_Modify()
LV_Delete()
LV_ModifyCol()
LV_InsertCol()
LV_DeleteCol()
LV_GetCount()
LV_GetNext()
LV_GetText()
LV_SetImageList()
MenuGetHandle()
MenuGetName()
NumGet()
NumPut()
ObjAddRef()
ObjRelease()
ObjBindMethod()
ObjGetBase()
ObjRawGet()
ObjRawSet()
ObjSetBase()

ObjClone()
ObjCount()
ObjDelete()
ObjGetAddress()
ObjGetCapacity()
ObjHasKey()
ObjInsert()
ObjInsertAt()
ObjLength()
ObjMaxIndex()
ObjMinIndex()
ObjNewEnum()
ObjPop()
ObjPush()
ObjRemove()
ObjRemoveAt()
ObjSetCapacity()

OnError()
OnMessage()
Ord()
SB_SetText()
SB_SetParts()
SB_SetIcon()
SB_SetProgress()
StrGet()
StrPut()
RegisterCallback()
Trim()
LTrim()
RTrim()
TV_Add()
TV_Modify()
TV_Delete()
TV_GetSelection()
TV_GetCount()
TV_GetParent()
TV_GetChild()
TV_GetPrev()
TV_GetNext()
TV_GetText()
TV_Get()
TV_SetImageList()
VarSetCapacity()

Abs()
Ceil()
Exp()
Floor()
Log()
Ln()
Max()
Min()
Mod()
Round()
Sqrt()
Sin()
Cos()
Tan()
ASin()
ACos()
ATan()

ComObjActive()
ComObjArray()
ComObjConnect()
ComObjCreate()
ComObject()
ComObjEnwrap()
ComObjUnwrap()
ComObjError()
ComObjFlags()
ComObjGet()
ComObjMissing()
ComObjParameter()
ComObjQuery()
ComObjType()
ComObjValue()

the statements:
===============
AutoTrim
BlockInput
Break
Catch
Click
ClipWait
Continue
Control
ControlClick
ControlFocus
ControlGet
ControlGetFocus
ControlGetPos
ControlGetText
ControlMove
ControlSend
ControlSendRaw
ControlSetText
CoordMode
DetectHiddenText
DetectHiddenWindows
Drive
DriveGet
DriveSpaceFree
Edit
Else
EnvAdd
EnvDiv
EnvGet
EnvMult
EnvSet
EnvSub
EnvUpdate
Exit
ExitApp
FileAppend
FileCopy
FileCopyDir
FileCreateDir
FileCreateShortcut
FileDelete
FileEncoding
FileInstall
FileGetAttrib
FileGetShortcut
FileGetSize
FileGetTime
FileGetVersion
FileMove
FileMoveDir
FileRead
FileReadLine
FileRecycle
FileRecycleEmpty
FileRemoveDir
FileSelectFile
FileSelectFolder
FileSetAttrib
FileSetTime
Finally
For
FormatTime
GetKeyState
Gosub
Goto
GroupActivate
GroupAdd
GroupClose
GroupDeactivate
Gui
GuiControl
GuiControlGet
Hotkey
If
IfEqual
IfNotEqual
IfExist
IfNotExist
IfGreater
IfGreaterOrEqual
IfLess
IfLessOrEqual
IfMsgBox
ImageSearch
IniDelete
IniRead
IniWrite
Input
InputBox
KeyHistory
KeyWait
ListHotkeys
ListLines
ListVars
Loop
Menu
MouseClick
MouseClickDrag
MouseGetPos
MouseMove
MsgBox
OutputDebug
Pause
PixelGetColor
PixelSearch
PostMessage
Process
Progress
Random
RegDelete
RegRead
RegWrite
Reload
Return
Run
RunAs
RunWait
SendEvent
SendLevel
SendMessage
SendMode
SetBatchLines
SetCapsLockState
SetControlDelay
SetDefaultMouseSpeed
SetEnv
SetFormat
SetKeyDelay
SetMouseDelay
SetNumLockState
SetScrollLockState
SetRegView
SetStoreCapsLockMode
SetTimer
SetTitleMatchMode
SetWinDelay
SetWorkingDir
Shutdown
Sleep
Sort
SoundBeep
SoundGet
SoundGetWaveVolume
SoundPlay
SoundSet
SoundSetWaveVolume
SplashImage
SplashTextOn
SplashTextOff
SplitPath
StatusBarGetText
StatusBarWait
StringCaseSense
StringLeft
StringLen
StringLower
StringReplace
StringRight
StringSplit
StringTrimLeft
StringTrimRight
StringUpper
Suspend
Switch
SysGet
Thread
Throw
ToolTip
Transform
TrayTip
Try
Until
UrlDownloadToFile
While-loop
WinActivate
WinActivateBottom
WinClose
WinGetActiveStats
WinGetActiveTitle
WinGetClass
WinGet
WinGetPos
WinGetText
WinGetTitle
WinHide
WinKill
WinMaximize
WinMenuSelectItem
WinMinimize
WinMinimizeAll
WinMinimizeAllUndo
WinMove
WinRestore
WinSet
WinSetTitle
WinShow
WinWait
WinWaitActive
WinWaitClose
WinWaitNotActive

the directives:
===============
#ClipboardTimeout
#CommentFlag
#Delimiter
#DerefChar
#ErrorStdOut
#EscapeChar
#HotkeyInterval
#HotkeyModifierTimeout
#Hotstring
#If
#IfTimeout
#IfWinActive 
#IfWinNotActive 
#IfWinExist 
#IfWinNotExist
#Include 
#IncludeAgain
#InputLevel
#InstallKeybdHook
#InstallMouseHook
#KeyHistory
#LTrim
#MaxHotkeysPerInterval
#MaxMem
#MaxThreads
#MaxThreadsBuffer
#MaxThreadsPerHotkey
#MenuMaskKey
#NoEnv
#NoTrayIcon
#Persistent
#SingleInstance
#UseHook
#Warn
#WinActivateForce
Last edited by ANewUser on 07.02.2020 13:12, edited 1 time in total.
Alexey
Posts: 1633
Joined: 05.10.2012 22:10

Post by Alexey »

Updated AHK lexer (in Cud and SynWrite), fixed all your notes, pls test.
Alexey
Posts: 1633
Joined: 05.10.2012 22:10

Post by Alexey »

Updated AHK lex again, for your 2nd keyword post.
GetKeyState is in 2 lists! i don't detect "()" so i just added it to single list.
Alexey
Posts: 1633
Joined: 05.10.2012 22:10

Post by Alexey »

Don't edit posts above so i will not miss them.
Post Reply