function isalpha(s){ return /^[a-z]+$/i.test(s); } function isdigit(s){ return /^\d+$/.test(s); } var keyword = { "end": 0, "begin": 0, "if": 0, "then": 0, "elif": 0, "else": 0, "while": 0, "do": 0, "for": 0, "in": 0, "is": 0, "break": 0, "continue": 0, "try": 0, "catch": 0, "global": 0, "public": 0, "not": 0, "and": 0, "or": 0, "table": 0, "of": 0, "raise": 0, "yield": 0, "return": 0, "true": 0, "false": 0, "null": 0, "goto": 0, "label": 0, "use": 0, "assert": 0, "function": 0, "fn": 0, "let": 0, "mut": 0 }; function syntax(s){ var id,s2,st,c; s2=""; var i=0; while(i"; }else{ s2+=id; } }else if(isdigit(c)){ st=""; while(i"; }else if(c=='"'){ st="\""; i++; while(i"; s2+=st; }else if(c=="'"){ st="'"; i++; while(i"; i++; }else if(c=='(' || c==')' || c=='[' || c==']' || c=='{' || c=='}'){ s2+=""+c+""; i++; }else if(c=='+' || c=='-' || c=='*' || c=='/' || c=='|' || c=='.' || c=='=' || c=='!' || c==':' || c=='%' || c=='^' || c=='$' ){ s2+=""+c+""; i++; }else{ s2+=c; i++; } } return s2; } function main(){ var a = document.getElementsByClassName("moss"); for(var i=0; i