Created
December 19, 2012 08:40
-
-
Save chomwitt/4335335 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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