Skip to content

Commit b88145e

Browse files
authored
Merge pull request #24 from aneshodza/feature/prepare-release-1.2.1
Make changes for version 1.2.1
2 parents c46bfe5 + a16b7d1 commit b88145e

File tree

3 files changed

+23
-9
lines changed

3 files changed

+23
-9
lines changed

README.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ It only checks for these two things on the node it's currently on (while being i
1313
---
1414

1515
## Usage
16-
**Important:** This just goes over creating an automaton using every configuration option. [Here](./tests/integration_tests/README.md) you can find real use-cases.
16+
**Important:** This just goes over creating an automaton using every configuration option. [Here](./tests/integration_tests/README.md) you can find real use-cases.
1717
Creating a pushdown automaton involves following steps:
1818
1. Creating the automaton instance
1919
2. Creating all the states
@@ -27,8 +27,8 @@ import { PushdownAutomaton, State, TransitionFunction } from 'pushdown-automaton
2727

2828
/*
2929
* 1. Instantiate the pushdown automaton with the input word
30-
* Provide a 2nd parameter to define the initial stack token.
31-
* Normally that's a dollar sign, but here I define it as %
30+
* Provide a 2nd parameter to define the initial stack token.
31+
* Normally that's a dollar sign, but here I define it as %
3232
*/
3333
let automaton: PushdownAutomaton;
3434
automaton = new PushdownAutomaton("test", "%");
@@ -43,10 +43,10 @@ otherState = new State("q1");
4343

4444
/*
4545
* 3. Instantiate transitions
46-
* First parameter is the token to be consumed
47-
* The second parameter is the state where the transition leads to
48-
* The third parameter shows the token to be popped off the stack
49-
* The fourth parameter is an array of things that will be pushed onto the stack
46+
* First parameter is the token to be consumed
47+
* The second parameter is the state where the transition leads to
48+
* The third parameter shows the token to be popped off the stack
49+
* The fourth parameter is an array of things that will be pushed onto the stack
5050
*/
5151
let transitionFunction: Transition;
5252
transitionFunction = new Transition("t", otherState, "$", ["c", "d"]);
@@ -75,6 +75,12 @@ const someFunction = (automaton) => {
7575
// Do some stuff here
7676
}
7777
pushdownAutomaton.addOperation(someFunction);
78+
79+
/*
80+
* 8. Now you can re-run it. But make sure to add a new word, as
81+
* the old one was consumed by the automaton
82+
*/
83+
pushdownAutomaton.run("some new word");
7884
```
7985

8086
#### Return values of `run()`

docs/CHANGELOG.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,15 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## [1.2.0] - 2024-04-20
8+
## [1.2.1] - 2024-04-25
9+
### Fixed
10+
- Re-runs now work properly.
11+
12+
### Added
13+
- An optional parameter to `run()`, which sets the `inputWord` before running the automaton.
14+
- Added integration tests by showing real automatons and their usage.
15+
16+
## [1.2.0] - 2024-04-24
917
### Fixed
1018
- Properly fix the building CI. There was a confucion between cjs and esm, which has now been resolved.
1119
- The termination message import (or lack thereof) was messing when using the library.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "pushdown-automaton",
3-
"version": "1.2.0",
3+
"version": "1.2.1",
44
"description": "A library that allows you to create a deterministic pushdown automaton",
55
"main": "out/index.js",
66
"types": "out/index.d.ts",

0 commit comments

Comments
 (0)