| 352 | } |
| 353 | |
| 354 | function rval(state,stream,type) { |
| 355 | |
| 356 | // parse stack |
| 357 | pushToken(state,realToken(type,stream)); |
| 358 | |
| 359 | // map erlang token type to CodeMirror style class |
| 360 | // erlang -> CodeMirror tag |
| 361 | switch (type) { |
| 362 | case "atom": return "atom"; |
| 363 | case "attribute": return "attribute"; |
| 364 | case "boolean": return "atom"; |
| 365 | case "builtin": return "builtin"; |
| 366 | case "close_paren": return null; |
| 367 | case "colon": return null; |
| 368 | case "comment": return "comment"; |
| 369 | case "dot": return null; |
| 370 | case "error": return "error"; |
| 371 | case "fun": return "meta"; |
| 372 | case "function": return "tag"; |
| 373 | case "guard": return "property"; |
| 374 | case "keyword": return "keyword"; |
| 375 | case "macro": return "variable-2"; |
| 376 | case "number": return "number"; |
| 377 | case "open_paren": return null; |
| 378 | case "operator": return "operator"; |
| 379 | case "record": return "bracket"; |
| 380 | case "separator": return null; |
| 381 | case "string": return "string"; |
| 382 | case "type": return "def"; |
| 383 | case "variable": return "variable"; |
| 384 | default: return null; |
| 385 | } |
| 386 | } |
| 387 | |
| 388 | function aToken(tok,col,ind,typ) { |
| 389 | return {token: tok, |