1
0
Fork 0
mirror of https://github.com/Reuh/anselme.git synced 2025-10-27 16:49:31 +00:00
Commit graph

25 commits

Author SHA1 Message Date
43a745a7a9 Final test batch and associated fixes 2023-12-31 19:41:14 +01:00
5dd971ff8f Move anselme code into its own directory 2023-12-29 18:47:36 +01:00
82ce53be83 First test batch and associated fixes
The test runner is also nicer to use.
2023-12-28 17:03:54 +01:00
53c1c764ba Add testing framework
More tests will arrive shortly...
2023-12-28 13:03:56 +01:00
fe351b5ca4 Anselme v2.0.0-alpha rewrite
Woke up and felt like changing a couple things. It's actually been worked on for a while, little at a time...

The goal was to make the language and implementation much simpler. Well I don't know if it really ended up being simpler but it sure is more robust.

Main changes:
* proper first class functions and closures supports! proper scoping rules! no more namespace shenanigans!
* everything is an expression, no more statements! make the implementation both simpler and more complex, but it's much more consistent now! the syntax has massively changed as a result though.
* much more organized and easy to modify codebase: one file for each AST node, no more random fields or behavior set by some random node exceptionally, everything should now follow the same API defined in ast.abstract.Node

Every foundational feature should be implemented right now. The vast majority of things that were possible in v2 are possible now; some things aren't, but that's usually because v2 is a bit more sane.
The main missing things before a proper release are tests and documentation. There's a few other things that might be implemented later, see the ideas.md file.
2023-12-22 13:25:28 +01:00
2ff494d108 Clean implementation of 👁️ and no longer increment 🏁 on checkpoint execution (redundant with 👁️) 2023-03-02 15:49:15 +09:00
5e441886c0 Add anonymous functions 2022-09-28 14:56:31 +09:00
7b756ad092 Update README, bump version 2022-09-13 19:34:34 +09:00
16d0bb8d7a Fix LuaJIT compatibility 2021-12-11 01:38:18 +01:00
04c6683de8 Proper checkpointing of mutable values 2021-12-06 18:34:58 +01:00
0f89307d5f Cache read values in local state, handle mutable variables properly 2021-12-02 23:57:25 +01:00
f2e74c94c9 Changed a few things
* Integrated # and ~ decorators into the expression system. Created associated operators.
* # and ~ decorators only affect their current line. That's more useful...
* Fix our priority system to evaluate left-to-right instead of right-to-left (if there was a reason why I did it this way initially, I don't remember it so ¯\_(ツ)_/¯)
* a lotta internal changes

Various other small adjustments, see the diff of REFERENCE.md for details.
2021-11-28 01:43:54 +01:00
7433d27da5 Don't expose private event fields to user in choices 2021-11-27 13:10:36 +01:00
7105b445ef Handle events in text interpolation; capture text events in choice lines; improve test script 2021-11-26 21:26:41 +01:00
d42c35facd Change versioning to separate language/API/save; allow executing blocks directly; add version to game config 2021-06-05 17:19:42 +02:00
61e3143e9e Add alias() to define alias after definition; add frFR language file 2021-06-05 01:30:40 +02:00
64bc85741a Changed a few things
- Bumped to 0.15.0
- Add boot script
- Change variable definition syntax, using a = to distinguish more cleary between identifier and value
- Variables initial values are evaluated on first use instead of at parsing time
- Error on variable redefinition. Means you should make sure to load saves after your scripts.
- Improve string parsing, support for escape codes
- Remove support for number literals with empty decimal part (42. for 42.0) as there's no distinction in Anselme and it conflicts with .function call suffix
- Changed priority of : pair operator
- Add type type, and type annotations to variables and function parameters
- Change Lua function system to use regular Anselme functions
  - Defining a function from Lua is now way simpler and require providing a full Anselme function signature
- Change Anselme function system
  - Dynamic dispatch, based on arity, type annotation and parameter names. Will select the most specific function at runtime.
  - Define way to overload most operators
  - Allow custom type to text formatters
  - Allow assignment to custom functions
  - Index operator ( renamed to ()
  - Functions with parameters each have their own private namespace (scoping ersatz)
  - Internal: "custom"-mode operators now have their own expression AST type instead of cluttering the function system
- Remove static type checker as it is barely useful with new function system. May or may not rewrite one in the future.
- Improve error messages here and there
- Internal: cleaning
2021-06-03 15:29:25 +02:00
17751c5c59 Rename checkpoint variable, add reached variable for checkpoints 2021-04-23 17:39:51 +02:00
0171d92352 Decorator system simplification, removed paragraph decorators, added function decorators 2021-04-23 17:13:39 +02:00
5c3e9d2c5d Preserve tags in choices children 2021-04-12 01:58:10 +02:00
51e8c82181 Improve alias system 2021-04-08 16:34:33 +02:00
b0d7a0bfb5 Check identifier pattern in more cases while parsing 2021-04-08 13:22:26 +02:00
e1b0b17fc6 Remove temporary test script 2021-04-04 20:33:15 +02:00
a6c4eee4b3 Show source file in error messages 2020-09-18 23:59:22 +02:00
b233d7fa1e Rewrite 2020-05-24 20:31:09 +02:00