Skip to content

Divy1211/xs-check

Folders and files

NameName
Last commit message
Last commit date

Latest commit

4d7a58b · Mar 22, 2025

History

88 Commits
Jul 30, 2024
Jul 29, 2024
Sep 19, 2024
Aug 25, 2024
Mar 22, 2025
Mar 22, 2025
Sep 19, 2024
Jul 30, 2024
Mar 22, 2025
Mar 22, 2025
Jun 6, 2024
Sep 19, 2024
Sep 19, 2024
Jun 7, 2024

Repository files navigation

XS Check

A linter for AoE2:DE's flavour of XS.

Installation

You may download and use the prebuilt binaries from here

Or instead, if you have rust installed and prefer to build it from source, you can simply run:

cargo install --git https://github.com/Divy1211/xs-check

This is recommended, as it will automatically add the binary to your system's path variable.

Usage

Suppose you have an XS file like so:

test.xs

void test(float f = 0.0) {
    int cp = xsGetContextPlayer();
    xsChatData("cp: %d", cp);
}

void test(float f = 0.0) {
    int b = "Oops";
}

void main() {
    test(1);

    float c = 4 + 5.5;
}

Invoke the binary on the file:

xs-check ./test.xs 

And it will generate an output with all the errors it finds:

test.png

You may also tell it to ignore warnings (errors cannot be ignored) with a comma separated list:

xs-check file.xs --ignores warning1,warning2

The name used to ignore the warning is the same name that is printed in the first line of the warning. Ignoring the DiscardedFn warning may be useful at times

Cool Maths

Note: GitHub does not render all the latex correctly, read these docs here: https://divy1211.github.io/xs-check/

Topic Subtopic
Parsing XS Tokens
Parsing XS Keywords
Parsing XS Grammar
Static Analysis XS Type Checking
Dynamic Analysis XS Operational Semantics
Code Generation XS Maximal Munch