Skip to content

Commit

Permalink
Release 3.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
huderlem committed Aug 16, 2024
1 parent 839e8db commit ab7aa38
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
Nothing, yet.

## [3.4.0] - 2024-08-15
- Add support for AutoVar commands.
- AutoVar commands can be used in place of the `var` operator to streamline comparisons.
- AutoVar commands are defined in a new config file `command_config.json`.
- Fix missing semicon character in FireRed/LeafGreen font config

## [3.3.0] - 2024-01-15
- Add ability to configure number of lines used by `format()`. For example, this is useful if the text is intended to render in, a 3-line textbox (instead of the usual 2).
- Additionally, `format()` now accepts named parameters, and `numLines` has been included in `font_config.json`.
Expand Down Expand Up @@ -157,7 +163,8 @@ Nothing, yet.
## [1.0.0] - 2019-08-27
Initial Release

[Unreleased]: https://github.com/huderlem/poryscript/compare/3.3.0...HEAD
[Unreleased]: https://github.com/huderlem/poryscript/compare/3.4.0...HEAD
[3.4.0]: https://github.com/huderlem/poryscript/compare/3.3.0...3.4.0
[3.3.0]: https://github.com/huderlem/poryscript/compare/3.2.0...3.3.0
[3.2.0]: https://github.com/huderlem/poryscript/compare/3.1.0...3.2.0
[3.1.0]: https://github.com/huderlem/poryscript/compare/3.0.3...3.1.0
Expand Down
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ Poryscript is a command-line program. It reads an input script and outputs the
```
> ./poryscript -h
Usage of poryscript:
-cc string
command config JSON file (default "command_config.json")
-f string
set default font id (leave empty to use default defined in font config file)
-fc string
Expand All @@ -79,10 +81,11 @@ Convert a `.pory` script to a compiled `.inc` script, which can be directly incl
```

To automatically convert your Poryscript scripts when compiling a decomp project, perform these two steps:
1. Create a new `tools/poryscript/` directory, and add the `poryscript` command-line executable tool to it. Also copy `font_config.json` to the same location.
1. Create a new `tools/poryscript/` directory, and add the `poryscript` command-line executable tool to it. Also copy `command_config.json` and `font_config.json` to the same location.
```
# For example, on Windows, place the files here.
pokeemerald/tools/poryscript/poryscript.exe
pokeemerald/tools/poryscript/command_config.json
pokeemerald/tools/poryscript/font_config.json
```
It's also a good idea to add `tools/poryscript` to your `.gitignore` before your next commit.
Expand Down Expand Up @@ -262,12 +265,12 @@ The `while` statement can also be written as an infinite loop by omitting the bo
`break` can be used to break out of a loop, like many programming languages. Similary, `continue` returns to the start of the loop.
### Conditional Operators
The condition operators have strict rules about what conditions they accept. The operand on the left side of the condition must be a `flag()`, `var()`, or `defeated()` check. They each have a different set of valid comparison operators, described below.
The condition operators have strict rules about what conditions they accept. The operand on the left side of the condition must be a `flag()`, `var()`, `defeated()`, or [AutoVar](#autovar-commands) check. They each have a different set of valid comparison operators, described below.
| Type | Valid Operators |
| ---- | --------------- |
| `flag` | `==` |
| `var` | `==`, `!=`, `>`, `>=`, `<`, `<=` |
| `var` or [AutoVar](#autovar-commands) | `==`, `!=`, `>`, `>=`, `<`, `<=` |
| `defeated` | `==` |
All operators support implicit truthiness, which means you don't have to specify any of the above operators in a condition. Below are some examples of equivalent conditions:
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"github.com/huderlem/poryscript/parser"
)

const version = "3.3.0"
const version = "3.4.0"

type mapOption map[string]string

Expand Down
4 changes: 2 additions & 2 deletions parser/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ func New(l *lexer.Lexer, commandConfig CommandConfig, fontConfigFilepath, defaul
}

// New creates a new Poryscript AST Parser.
func NewLintParser(l *lexer.Lexer) *Parser {
p := New(l, CommandConfig{}, "", "", 0, nil)
func NewLintParser(l *lexer.Lexer, commandConfig CommandConfig) *Parser {
p := New(l, commandConfig, "", "", 0, nil)
p.enableEnvironmentErrors = false
return p
}
Expand Down

0 comments on commit ab7aa38

Please sign in to comment.