Skip to content

Instantly share code, notes, and snippets.

@jdavidw13
jdavidw13 / gist:2156565
Created March 22, 2012 06:03 — forked from Zirak/gist:1761880
A parser for DnD dice rolls, with support for min/max rolls.
//infix operator-precedence parser
//also supports a d operator - a dice roll
var parsePrecedence = (function () {
//we don't care about whitespace. well, most whitespace
var whitespace = {
' ' : true,
'\t' : true
};