MCPcopy Create free account
hub / github.com/TruthHun/BookStack / rval

Function rval

static/editor.md/lib/codemirror/mode/erlang/erlang.js:354–386  ·  view source on GitHub ↗
(state,stream,type)

Source from the content-addressed store, hash-verified

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,

Callers 1

tokenizerFunction · 0.85

Calls 2

pushTokenFunction · 0.85
realTokenFunction · 0.85

Tested by

no test coverage detected