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

Add support for #base and #include directives #5

Open
kerristrasz opened this issue Jun 26, 2024 · 0 comments
Open

Add support for #base and #include directives #5

kerristrasz opened this issue Jun 26, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@kerristrasz
Copy link
Owner

The #base and #include directives allow for keys to be included from other files on the filesystem, like so:

#base "another/file.vdf"

"Options"
{
    // ...
}

In the grammar, there is nothing special about #base and #include. They are normal keys. However, when the file is parsed by Valve's implementations, the included files will be merged with the source file (the exact strategy depends on which is used).

It would be nice to provide actual support for directives beyond simply permitting it in the grammar. However, it's a bit difficult to know how this would work. The parser would need to access the file system during parsing, which not every user may want. This should probably be customizable.

@kerristrasz kerristrasz self-assigned this Jun 28, 2024
@kerristrasz kerristrasz added the enhancement New feature or request label Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant