-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #478 from PolyhedralDev/dev/let-expression
Add let expression support
- Loading branch information
Showing
18 changed files
with
132 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
...on/base/src/main/java/com/dfsek/terra/config/loaders/ExpressionParserOptionsTemplate.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.dfsek.terra.config.loaders; | ||
|
||
import com.dfsek.paralithic.eval.parser.Parser.ParseOptions; | ||
import com.dfsek.tectonic.api.config.template.annotations.Default; | ||
import com.dfsek.tectonic.api.config.template.annotations.Value; | ||
import com.dfsek.tectonic.api.config.template.object.ObjectTemplate; | ||
|
||
|
||
public class ExpressionParserOptionsTemplate implements ObjectTemplate<ParseOptions> { | ||
|
||
private static final ParseOptions DEFAULT_PARSE_OPTIONS = new ParseOptions(); | ||
|
||
@Value("use-let-expressions") | ||
@Default | ||
private boolean useLetExpressions = DEFAULT_PARSE_OPTIONS.useLetExpressions(); | ||
|
||
@Override | ||
public ParseOptions get() { | ||
return new ParseOptions(useLetExpressions); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
...n/base/src/main/java/com/dfsek/terra/config/pack/ConfigPackExpressionOptionsTemplate.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.dfsek.terra.config.pack; | ||
|
||
import com.dfsek.paralithic.eval.parser.Parser.ParseOptions; | ||
import com.dfsek.tectonic.api.config.template.ConfigTemplate; | ||
import com.dfsek.tectonic.api.config.template.annotations.Default; | ||
import com.dfsek.tectonic.api.config.template.annotations.Value; | ||
|
||
|
||
public class ConfigPackExpressionOptionsTemplate implements ConfigTemplate { | ||
@Value("expressions.options") | ||
@Default | ||
private ParseOptions parseOptions = new ParseOptions(); | ||
|
||
public ParseOptions getParseOptions() { | ||
return parseOptions; | ||
} | ||
} |
Oops, something went wrong.