MCPcopy Create free account
hub / github.com/ronreiter/interactive-tutorials / ncomment

Function ncomment

static/js/codemirror/mode/haskell/haskell.js:110–132  ·  view source on GitHub ↗
(type, nest)

Source from the content-addressed store, hash-verified

108 }
109
110 function ncomment(type, nest) {
111 if (nest == 0) {
112 return normal;
113 }
114 return function(source, setState) {
115 var currNest = nest;
116 while (!source.eol()) {
117 var ch = source.next();
118 if (ch == '{' && source.eat('-')) {
119 ++currNest;
120 }
121 else if (ch == '-' && source.eat('}')) {
122 --currNest;
123 if (currNest == 0) {
124 setState(normal);
125 return type;
126 }
127 }
128 }
129 setState(ncomment(type, currNest));
130 return type;
131 };
132 }
133
134 function stringLiteral(source, setState) {
135 while (!source.eol()) {

Callers 1

normalFunction · 0.85

Calls 2

setStateFunction · 0.50
nextMethod · 0.45

Tested by

no test coverage detected