Skip to content

Commit

Permalink
release 1.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike_Device committed Jan 22, 2017
2 parents 065f97f + 3dbb681 commit eed3a39
Show file tree
Hide file tree
Showing 5 changed files with 136 additions and 133 deletions.
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Grammar is represented as array of objects. Each object describes one rule. Rule
## Output
First and follow sets are represented as array of objects. Keys are nonterminals and values are sets (first or follow) for these nonterminals.

Predict sets are represented as array of arrays. Each array may contain terminals and end mark (`\u0000`)
Predict sets are represented as array of objects. Keys are rule's number and values are sets. Each set may contain terminals and end mark (`\u0000`)

## Output examples
**First set**
Expand All @@ -62,11 +62,12 @@ Predict sets are represented as array of arrays. Each array may contain terminal

**Predict sets**
```
[
['a'], // first rule
['b'], // second rule
['\u0000'] // third rule
]
{
1: ['a'], // first rule
2: ['b'], // second rule
3: ['\u0000'] // third rule
}
```

## License
MIT
4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,9 @@
}
});

return predictSets;
return _(predictSets).indexBy(function(val, key) {
return key + 1;
});
};

return {Grammar: Grammar};
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "first-follow",
"version": "1.1.0",
"version": "1.2.0",
"description": "Calculator for finding first, follow and predict sets by the grammar",
"main": "index.js",
"scripts": {
Expand Down
Loading

0 comments on commit eed3a39

Please sign in to comment.