-
-
Notifications
You must be signed in to change notification settings - Fork 377
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
Config navigation syntax. #6719
Config navigation syntax. #6719
Conversation
8c12473
to
a2455d0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does the navigation work if some line has a dot in it already?
like
options:
a.b:
c: hi
if I wanted to get the c: line using the script navigation could I do that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My initial thoughts. I think this could work as a default module at org.skriptlang.skript.common.config
. Syntax documentation also needs work (fill out examples!)
88f2061
to
1235d8d
Compare
* Create Script type. * Support script string/name conversion. * Script expression. * Add script lang entry. * Tests for script expression & names. * Support all scripts expression. * Script effects & tests. * Create dummy Script handle for disabled scripts. * Script reflection feature flag. * Restrict literal parsing to commands & parse. * Test feature flag for resolving name. * Split ExprScripts by feature to support disabled scripts. * Fix ExprName tests for new & old behaviour. * Add tests for disabled script handles. * Apply suggestions from code review Co-authored-by: Patrick Miller <[email protected]> * Improve script loading/unloading safety. * Add feature check for script hotswapping. * Use expression stream. * Conformity for file names and proper loading safety. * Document validity & add condition support. * Add script is loaded condition + tests. * Some changes from code review. * More changes. * Apply suggestions from code review Co-authored-by: Patrick Miller <[email protected]> * Clean up EffScriptFile and rename ExprScripts variations. * Finish code review changes. * Clean up script loader stuff. * Fix conflicts. * Suggested changes. * Apply suggestions from code review Co-authored-by: Patrick Miller <[email protected]> * Finished. --------- Co-authored-by: Patrick Miller <[email protected]> Co-authored-by: sovdee <[email protected]>
Co-authored-by: Patrick Miller <[email protected]>
Co-authored-by: sovdee <[email protected]>
aff86a7
to
ea4f67c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a few things
Co-authored-by: Patrick Miller <[email protected]>
0eb6988
to
e101b83
Compare
f69abdb
into
SkriptLang:feature/script-reflection
Description
Rudimentary config reading & navigation.
Additions
This adds:
- The types for a
Config
and aNode
:-
Config
s are the key-value structures used internally by script configuration (and code) files-
Node
s are lines in a config, potentially entries (key: value
) or sections (key:)
- A getter for the loaded Skript
config.sk
- Navigators for nodes in the node tree (node "..." of X, nodes of X)
- Type-based value parsers for nodes
- Downstream converters for (skript* ->) config -> node
Syntax
What does this actually do?
It allows you to read a Config node tree and its values.
This does not add support for editing config files or structures.
Caveat: Scripts
Internally,
Script
s are loaded asConfig
s. This contains a fun little experimentalScript -> Config
converter, which means that, technically, script files are also navigable.The output of the above would be:
This would normally be something I would never include, but because it just happens to be supported (by coincidence more than intention) I'm personally okay with leaving it accessible, I think people could make some really cool things with it (even self-programming scripts with the follow-up PR) and I don't think it's very damaging by itself.
That said, I recognise it's probably a bit scary for some people so I don't mind what happens to it too much.
This is part of a series of linked stages around config and script management.
Related Issues: requires #6702