KDL Lexer Missing

All questions regarding lexer highlighting schemes are discussed here...
Post Reply
Random Void User
Posts: 112
Joined: 13.07.2024 21:19

KDL Lexer Missing

Post by Random Void User »

KDL
Specification
KDL is a small, pleasant document language with XML-like node semantics ... to be used both as a serialization format and a configuration language, much like JSON, YAML, or XML.
all numbers can have underscores to help readability
grammar and expected semantics are well-defined and specified
main Alexey
Posts: 2990
Joined: 25.08.2021 18:15

Re: KDL Lexer Missing

Post by main Alexey »

Sublime, VSCode, Kate, vim, Zed, etc - support KDL. so Ok, I may add it, wait.
main Alexey
Posts: 2990
Joined: 25.08.2021 18:15

Re: KDL Lexer Missing

Post by main Alexey »

VSCode page shows that KDL has ~~15K downloads. good, not small count. I found example files at https://github.com/kdl-org/
main Alexey
Posts: 2990
Joined: 25.08.2021 18:15

Re: KDL Lexer Missing

Post by main Alexey »

before the release in addons-manager, I put lexer to git:
https://github.com/CudaText-addons/CudaText-lexers
pre-alfa version is there. more coloring of the first word in the line, is it needed? some keywords need hilighting? I am sure lexer is not OK yet.
main Alexey
Posts: 2990
Joined: 25.08.2021 18:15

Re: KDL Lexer Missing

Post by main Alexey »

updated lexer in git.

I did not yet hilite 'slash-dash comments'. VSCode syntax has 4 rules for them.

edit:
updated lexer, 'slash-dash' must be HL'ted now.
Random Void User
Posts: 112
Joined: 13.07.2024 21:19

Re: KDL Lexer Missing

Post by Random Void User »

An installer question: why KDL does not show in packages.ini file. All other lexers do, just not KDL. I made an install .zip as follows:

Code: Select all

$ ls -1 lexer.KDL
KDL.cuda-lexmap
KDL.lcf
default-config.kdl
install.inf
$ 7z a -tzip ./lexer.KDL.zip ./lexer.KDL
The .zip I then opened in Cud to install. What should I do differently? Thanks
main Alexey
Posts: 2990
Joined: 25.08.2021 18:15

Re: KDL Lexer Missing

Post by main Alexey »

packages.ini will be updated when you will install pkg from addons-manager.
main Alexey
Posts: 2990
Joined: 25.08.2021 18:15

Re: KDL Lexer Missing

Post by main Alexey »

BTW, about your file 'default-config.kdl'. wiki says:

* Zip must contain: install.inf, .lcf file(s), .cuda-lexmap file per each lexer.

You can place file(s) "lexer LexerName.json" into zip archive, per each lexer in zip archive. These JSON files will be installed to the folder "settings_default" of CudaText. Ie, these are lexer-specific configs for lexers. Some lexers do this already: Lua, Pascal, PHP, Ruby, TypeScript.
Post Reply