Skip to content

Commit 9a93c8f

Browse files
committed
Add a basic test for YS2 functionality, move tests into versioned directories.
1 parent 09c234c commit 9a93c8f

34 files changed

Lines changed: 136 additions & 39 deletions

README.md

Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
An **unofficial** Python interpreter for compiled [Yarn Spinner](https://yarnspinner.dev/) programs. _Documentation incomplete._
44

5-
This library currently supports the compiled story format from Yarn Spinner 1.0. Yarn Spinner 2.0 support is planned, but not currently in place.
5+
This library currently supports the compiled story format from Yarn Spinner 1.0. Yarn Spinner 2.0 support is in progress.
66

77
## Installation
88

@@ -60,10 +60,11 @@ A few gotchas to look out for:
6060
- Make sure to open the compiled story file as a binary file (see the above example, use `open(filename, 'rb')`) in order for it to be properly parsed by the compiled protobuf library.
6161
- Unless you pass `autostart=False` to the runner when creating it, it will automatically start and run to the next choice point.
6262

63-
As of version 2.0, all Yarn Spinner opcodes are currently implemented, as well as Yarn's internal standard library of functions and operators. This may certainly change over time, if new opcodes, functions, or operators are added to the language. The current missing features are:
63+
As of version v0.0.2, all Yarn Spinner 1 opcodes are currently implemented, as well as Yarn Spinner 1's internal standard library of functions and operators. This may certainly change over time, if new opcodes, functions, or operators are added to the language. The current missing features are:
6464

6565
- Inline expressions [(see Yarn docs)](https://yarnspinner.dev/docs/writing/expressions-and-variables/#inline-expressions)
6666
- Localisation tags and Format functions [(see Yarn syntax reference)](https://yarnspinner.dev/docs/syntax/#localisation-tags)
67+
- Full Yarn Spinner 2.0 functionality
6768

6869
## Development
6970

@@ -83,10 +84,45 @@ To make a release:
8384

8485
The source code of the examples are located inside `*.yarn` files. `*.csv` and `*.yarnc` files are generated via the Yarn Spinner compiler. To compile these files, follow the below steps:
8586

86-
1. Install the [Yarn Spinner Console](https://github.com/YarnSpinnerTool/YarnSpinner-Console) program `ysc`. Basic binaries are available on [their releases page](https://github.com/YarnSpinnerTool/YarnSpinner-Console/releases).
87-
2. From the `examples/` directory, run `ysc compile [filename].yarn`. For example, to compile the basic example used in `tests/test_basic.py`, use `ysc compile basic.yarn`.
87+
<details><summary>Yarn Spinner 1</summary>
88+
89+
1. Install the version v0.0.1 of the [Yarn Spinner Console](https://github.com/YarnSpinnerTool/YarnSpinner-Console) program `ysc`. Basic binaries are available on [their releases page](https://github.com/YarnSpinnerTool/YarnSpinner-Console/releases/tag/v0.0.1).
90+
2. From the `examples/yarn1/` directory, compile the examples. For each example, run:
91+
92+
```
93+
ysc compile [filename].yarn
94+
```
95+
96+
- For example, to compile the basic example used in `tests/test_basic.py`, use:
97+
98+
```
99+
ysc compile basic.yarn
100+
```
101+
102+
- This will output `*.csv` and `*.yarnc` files in the current directory, overwriting any files already present with the same name.
103+
104+
</details>
105+
<details open><summary>Yarn Spinner 2</summary>
106+
107+
1. Install the latest version of the [Yarn Spinner Console](https://github.com/YarnSpinnerTool/YarnSpinner-Console) program `ysc`. Basic binaries are available on [their releases page](https://github.com/YarnSpinnerTool/YarnSpinner-Console/releases).
108+
2. From the `examples/yarn2/` directory, compile the examples. For each example, run:
109+
110+
```
111+
ysc compile [filename].yarn -n [filename].yarnc -t [filename].csv
112+
```
113+
114+
- For example, to compile the basic example used in `tests/test_basic.py`, use:
115+
116+
```
117+
ysc compile basic.yarn -n basic.yarnc -t basic.csv
118+
```
119+
88120
- This will output `*.csv` and `*.yarnc` files in the current directory, overwriting any files already present with the same name.
89121

122+
(The long form with multiple CLI arguments used to compile these files is less than ideal. See [YarnSpinnerTool/YarnSpinner-Console#8](https://github.com/YarnSpinnerTool/YarnSpinner-Console/issues/8).)
123+
124+
</details>
125+
90126
Currently `*.csv` and `*.yarnc` files are committed to version control to make it easier to run our test suite. They will likely be gitignored later once we have a better build process for these files.
91127

92128
## License

0 commit comments

Comments
 (0)