MCPcopy Create free account
hub / github.com/nwutils/nw-sample-apps / tokenDollar

Function tokenDollar

mini-code-edit/cm/mode/shell/shell.js:74–88  ·  view source on GitHub ↗
(stream, state)

Source from the content-addressed store, hash-verified

72 };
73
74 var tokenDollar = function(stream, state) {
75 if (state.tokens.length > 1) stream.eat('$');
76 var ch = stream.next(), hungry = /\w/;
77 if (ch === '{') hungry = /[^}]/;
78 if (ch === '(') {
79 state.tokens[0] = tokenString(')');
80 return tokenize(stream, state);
81 }
82 if (!/\d/.test(ch)) {
83 stream.eatWhile(hungry);
84 stream.eat('}');
85 }
86 state.tokens.shift();
87 return 'def';
88 };
89
90 function tokenize(stream, state) {
91 return (state.tokens[0] || tokenBase) (stream, state);

Callers

nothing calls this directly

Calls 2

tokenStringFunction · 0.70
tokenizeFunction · 0.70

Tested by

no test coverage detected