Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Language schema #2

Open
yvvki opened this issue Oct 5, 2023 · 4 comments
Open

Language schema #2

yvvki opened this issue Oct 5, 2023 · 4 comments
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed
Milestone

Comments

@yvvki
Copy link
Owner

yvvki commented Oct 5, 2023

Rusted Warfare uses non-standard specification of INI/TOML file. We need to accommodate this by creating our own syntax highlighter language schema.

Here's the list of modified and/or added specification derived from INI:
Note that all of these are assumptions based on what I observed while working on a Rusted Warfare mod and from analyzing the official Rusted Warfare Modding Reference.

Rusted Warfare Schema

Key and value pair are separated with : instead of =.

- key = value
+ key: value

Value Type

Type Description Example
string Array of ASCII characters lorem ipsum
string(s) Array of strings separated by commas (and optionally space?) foo, bar
int One or more numbers 69
float Same as int or using decimal point (.) 0.69
bool Either true or false true
...
@yvvki yvvki added enhancement New feature or request help wanted Extra attention is needed labels Oct 5, 2023
@yvvki yvvki added this to the 1.0 MVP milestone Oct 5, 2023
@yvvki yvvki self-assigned this Oct 5, 2023
@yvvki
Copy link
Owner Author

yvvki commented Oct 5, 2023

If anybody knows what exactly are these specification (ie. from a Java library), please help by replying here with information about it.

@yvvki
Copy link
Owner Author

yvvki commented Jan 3, 2024

Basic syntax highlighting has been implemented in VSCode extension (v0.1.0) via TextMate language.

@yvvki yvvki changed the title Syntax highlighting Rusted Warfare schema Jan 3, 2024
@yvvki yvvki changed the title Rusted Warfare schema Language schema Jan 3, 2024
@yvvki yvvki moved this from Backlog to Ready in Rusted Warfare Modding Tool Jan 3, 2024
@EssentailStrategy
Copy link

If anybody knows what exactly are these specification (ie. from a Java library), please help by replying here with information about it.

Here's a basic ledger, If you want to create your own syntax highlighter language schema, you might want to check out some existing tools or libraries that support INI/TOML, such as highlight.js, Pygments, or Prism. Hmu if you need anything else 👍

[Using # or ; for comments]
[Using = or : for key-value assignments]
[Using [section] or [[section]] for sections]
[Using + or - to append or remove values from arrays].
[Using @ to reference other files or sections]
Using ! to execute commands or scripts[2]
[Using $ to access variables or constants]
[Using * to create aliases or shortcuts]
[Using ? to create conditional statements]
[Using & to create bitwise operations]
[Using ~ to create random values]
[Using ^ to create exponential values]
[Using % to create modulo values]
[Using / to create division values]
[Using | to create logical OR values]
[Using & to create logical AND values]
[Using ! to create logical NOT values]
[Using > to create greater than values]
[Using < to create less than values]
[Using = to create equal to values]
[Using != to create not equal to values]
[Using >= to create greater than or equal to values]
[Using <= to create less than or equal to values]

@yvvki
Copy link
Owner Author

yvvki commented Jan 3, 2024

Here's a basic ledger, If you want to create your own syntax highlighter language schema, you might want to check out some existing tools or libraries that support INI/TOML, such as highlight.js, Pygments, or Prism. Hmu if you need anything else 👍

Thank you for your help, I have implemented schema template for VSCode already here:
https://github.com/yvvki/rusted-warfare-vscode/blob/main/syntaxes/rw.tmLanguage.json

But it only replaced the equals with colon, I'll implement the rest after figuring out how to tokenize these (and implement the language server, see yvvki/rusted-warfare-vscode#2 😅)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
Status: Ready
Development

No branches or pull requests

2 participants