Skip to content

Instantly share code, notes, and snippets.

@chomwitt
Created December 19, 2012 08:40
Show Gist options
  • Save chomwitt/4335335 to your computer and use it in GitHub Desktop.
Save chomwitt/4335335 to your computer and use it in GitHub Desktop.
<!DOCTYPE HTML>
<html>
<head>
<title>WebTurtle/Parser tests</title>
<meta charset="utf-8">
<SCRIPT language="JavaScript" SRC="js/peg-0.7.0.js"></SCRIPT>
</head>
<body>
<script>
var parser = PEG.buildParser("
start = wtprogram wtprogram = front / back
front='μπροστά' ' ' integer back='πίσω'
integer integer=digits:[0-9]+ { return parseInt(digits.join(''), 10); } ");
var parser = PEG.buildParser(grammar);
result = parser.parse("μπροστά 10");
document.write("<h1>Out with the old - in with the new!</h1>" );
document.write(result );
</script>
</body>
</html>
@chomwitt
Copy link
Author

its :
start = wtprogram
wtprogram = front/back
...

anyway the grammar isnt the issue for me now.
I tried with your fixes but still no result in my browser.
The same for the example below:
https://gist.github.com/4344731

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment