Consistently talk about generating (not building) a parser

redux
David Majda 9 years ago
parent f4504a93fe
commit 45de51a881

@ -140,8 +140,8 @@ Using the Parser
Using the generated parser is simple — just call its `parse` method and pass an Using the generated parser is simple — just call its `parse` method and pass an
input string as a parameter. The method will return a parse result (the exact input string as a parameter. The method will return a parse result (the exact
value depends on the grammar used to build the parser) or throw an exception if value depends on the grammar used to generate the parser) or throw an exception
the input is invalid. The exception will contain `location`, `expected` and if the input is invalid. The exception will contain `location`, `expected` and
`message` properties with more details about the error. `message` properties with more details about the error.
parser.parse("abba"); // returns ["a", "b", "b", "a"] parser.parse("abba"); // returns ["a", "b", "b", "a"]

@ -4,7 +4,7 @@
describe("PEG.js API", function() { describe("PEG.js API", function() {
describe("generate", function() { describe("generate", function() {
it("builds a parser", function() { it("generates a parser", function() {
var parser = peg.generate('start = "a"'); var parser = peg.generate('start = "a"');
expect(typeof parser).toBe("object"); expect(typeof parser).toBe("object");

Loading…
Cancel
Save