From 08ea5e49d616681ce6a8c16b13b2e0b7a4e20724 Mon Sep 17 00:00:00 2001 From: David Majda Date: Wed, 9 Jun 2010 09:44:33 +0200 Subject: [PATCH] README.md: Fix example code --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9bdd5a4..a4bd77b 100644 --- a/README.md +++ b/README.md @@ -20,8 +20,8 @@ Usage Using PEG.js is easy: var parser = PEG.buildParser("start = ('a' / 'b')+"); - parser.parse("abba") // returns "abba" - parser.parse("abcd") // throws an exception with details about the error + parser.parse("abba"); // returns ["a", "b", "b", "a"] + parser.parse("abcd"); // throws an exception with details about the error Basically, you need to generate a parser from your grammar and then use it to parse the input.