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

feat: Parser for jenny #2103

Merged
merged 81 commits into from
Oct 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
7f9bc29
initial project files
st-pasha Oct 13, 2022
480dce6
Added ASCII table
st-pasha Oct 13, 2022
f233839
Lexer wip
st-pasha Oct 13, 2022
bdb2cb7
Moved out Token class
st-pasha Oct 13, 2022
d586c4e
Improve Token class
st-pasha Oct 13, 2022
ffaf1e3
Clean up of the Lexer class
st-pasha Oct 13, 2022
a441b49
rename into tokenize
st-pasha Oct 13, 2022
ed2701f
better error messages
st-pasha Oct 13, 2022
42e67ef
dont abbreviate ascii character names
st-pasha Oct 14, 2022
2d2287b
added Token and ascii tests
st-pasha Oct 14, 2022
24f23db
Token.operator==
st-pasha Oct 14, 2022
219980c
added some tokenizer tests
st-pasha Oct 14, 2022
862684d
tests for modeNodeBody
st-pasha Oct 14, 2022
c3578ab
missing tests for Token
st-pasha Oct 14, 2022
e6afa75
unicode names parser for Token.character
st-pasha Oct 14, 2022
d9d9839
modeNodeBodyLine tests
st-pasha Oct 14, 2022
67ff563
ModeText tests
st-pasha Oct 14, 2022
8aa7218
ModeText tests
st-pasha Oct 14, 2022
4a703a9
expression tests
st-pasha Oct 14, 2022
941bdbc
better token names
st-pasha Oct 14, 2022
a2cfbbf
formatting
st-pasha Oct 14, 2022
5c312c2
more tests for unicode ids
st-pasha Oct 14, 2022
a062eeb
added remaining tests
st-pasha Oct 14, 2022
26bbaf8
line tags and commands
st-pasha Oct 14, 2022
9319026
format
st-pasha Oct 14, 2022
c317f86
Merge branch 'main' into ps.flame-yarn-lexer
st-pasha Oct 14, 2022
5166e29
delete changelog
st-pasha Oct 14, 2022
5111c15
rename as -> asType
st-pasha Oct 14, 2022
cbc3743
rename pos -> position
st-pasha Oct 14, 2022
75425d4
renamed codeUnit -> currentCodeUnit
st-pasha Oct 14, 2022
d55194d
unabbreviate token names
st-pasha Oct 14, 2022
577ea3f
rename pos0 -> position0
st-pasha Oct 14, 2022
4577ab7
update comments
st-pasha Oct 14, 2022
f8cb6ac
Merge branch 'ps.flame-yarn-lexer' into ps.flame-yarn-parser
st-pasha Oct 15, 2022
63cc6eb
basic classes
st-pasha Oct 15, 2022
98b2b37
Parser WIP
st-pasha Oct 15, 2022
faa3a8a
wip
st-pasha Oct 15, 2022
4e25490
literal class
st-pasha Oct 15, 2022
b3843a0
Expression class
st-pasha Oct 15, 2022
c9507ea
wip
st-pasha Oct 15, 2022
c056f9a
Concat Expression
st-pasha Oct 15, 2022
526d9f2
parse hashtag and line condition
st-pasha Oct 15, 2022
c283f7c
command class
st-pasha Oct 15, 2022
8a81035
wip
st-pasha Oct 15, 2022
3b7b0af
rename Expression class
st-pasha Oct 15, 2022
a574641
wip on parser
st-pasha Oct 16, 2022
a959ea5
add some tests for the parser
st-pasha Oct 16, 2022
c8f7712
improve error messages in the parser
st-pasha Oct 16, 2022
eceeceb
do not use templates for TypedExpression<T>
st-pasha Oct 16, 2022
ce9dde6
added a test
st-pasha Oct 16, 2022
a0ac805
renames
st-pasha Oct 16, 2022
978b142
do not allow commands in Dialogue lines
st-pasha Oct 16, 2022
67df20b
more tests
st-pasha Oct 16, 2022
47f764d
even more tests
st-pasha Oct 16, 2022
e59d3de
format
st-pasha Oct 16, 2022
41c7e99
use NameError in more cases
st-pasha Oct 16, 2022
e8a3a55
parse blocks after the options
st-pasha Oct 17, 2022
30b1574
some refactorings
st-pasha Oct 17, 2022
93b6543
if and jump commands
st-pasha Oct 17, 2022
d31b64e
stop command
st-pasha Oct 17, 2022
150599f
wait command
st-pasha Oct 17, 2022
3cad6c4
set command
st-pasha Oct 17, 2022
6a7e55f
remove _DialogueBuilder and _OptionBuilder
st-pasha Oct 17, 2022
c88e742
parser cleanup
st-pasha Oct 18, 2022
4846f40
tests
st-pasha Oct 18, 2022
5aad73e
Merge branch 'main' into ps.flame-yarn-parser
st-pasha Oct 18, 2022
8635143
Merge branch 'main' into ps.flame-yarn-parser
st-pasha Oct 19, 2022
5f44f62
format
st-pasha Oct 19, 2022
c234053
Merge branch 'main' into ps.flame-yarn-parser
st-pasha Oct 21, 2022
02cfb30
disable test
st-pasha Oct 21, 2022
23cde3e
rename files
st-pasha Oct 31, 2022
7789f98
Merge branch 'main' into ps.flame-yarn-parser
st-pasha Oct 31, 2022
26b254c
fix imports
st-pasha Oct 31, 2022
5a15717
rename into jenny
st-pasha Oct 31, 2022
9b70fa0
update readme
st-pasha Oct 31, 2022
b0ab590
sort dependencies
st-pasha Oct 31, 2022
7c03450
update readme for jenny
st-pasha Oct 31, 2022
7fe2766
Merge branch 'main' into ps.flame-yarn-parser
st-pasha Oct 31, 2022
f0fb455
fix lint warning
st-pasha Oct 31, 2022
18d24c8
Merge branch 'main' into ps.flame-yarn-parser
st-pasha Oct 31, 2022
5163785
README for flame_jenny
st-pasha Oct 31, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
File renamed without changes.
9 changes: 9 additions & 0 deletions packages/flame_jenny/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# flame_jenny

The **flame_jenny** library integrates `jenny` (a dialogue framework) into the Flame engine. It
offers a number of components for displaying conversations within a game.

The `jenny` library, inspired by [YarnSpinner], is a framework for embedding dialogues, interactive
conversations, narratives, or step-by-step tutorials.

[YarnSpinner]: https://yarnspinner.dev/
11 changes: 11 additions & 0 deletions packages/flame_jenny/jenny/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Jenny

The **jenny** library supports building *dialogues*, interactive *conversations*, *narratives*,
or non-linear *story-telling*. The dialogue itself is written in a simple text-based Yarn language.
The `jenny` library allows you to load these `yarn` files into a YarnProject and then present this
dialogue to users within a game or an app.

The `jenny` library mimics the features and functionality of the [Yarn Spinner] library for Unity.


[Yarn Spinner]: https://docs.yarnspinner.dev/
2 changes: 2 additions & 0 deletions packages/flame_jenny/jenny/lib/jenny.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export 'src/errors.dart' show SyntaxError, NameError, TypeError;
export 'src/yarn_project.dart' show YarnProject;
29 changes: 29 additions & 0 deletions packages/flame_jenny/jenny/lib/src/errors.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
class SyntaxError implements Exception {
SyntaxError([this.message]);

final String? message;

@override
String toString() => 'SyntaxError: $message';
}

/// This error is emitted when accessing an unknown name, such as: undefined
/// variable name, unknown node title, unrecognized function, unspecified
/// command, etc.
class NameError implements Exception {
NameError([this.message]);

final String? message;

@override
String toString() => 'NameError: $message';
}

class TypeError implements Exception {
TypeError([this.message]);

final String? message;

@override
String toString() => 'TypeError: $message';
}
Loading