Created
November 23, 2009 07:32
-
-
Save drewlesueur/240947 to your computer and use it in GitHub Desktop.
parser
This file contains 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
<script> | |
// a little for each thing | |
function each(arr, func) { | |
for (var key in arr) { | |
func(key,arr[key]) | |
} | |
} | |
function is_alpha(str) { | |
return "abcdefghijklmnopqrstuvwxyz" | |
} | |
function parse(str) { | |
var arr = str.split('') //turn string into an array | |
var state = "start" | |
var total = []; | |
var curval = ""; | |
each(arr,function(key,value){ | |
if (value == "(") { | |
state = "(" | |
} | |
if (state == "(") { | |
if () | |
} | |
}) | |
} | |
/* | |
['set' 'x' "'30"] | |
*/ | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment