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

Function ncomment

static/editor.md/lib/codemirror/mode/haskell/haskell.js:125–147  ·  view source on GitHub ↗
(type, nest)

Source from the content-addressed store, hash-verified

123 }
124
125 function ncomment(type, nest) {
126 if (nest == 0) {
127 return normal;
128 }
129 return function(source, setState) {
130 var currNest = nest;
131 while (!source.eol()) {
132 var ch = source.next();
133 if (ch == '{' && source.eat('-')) {
134 ++currNest;
135 }
136 else if (ch == '-' && source.eat('}')) {
137 --currNest;
138 if (currNest == 0) {
139 setState(normal);
140 return type;
141 }
142 }
143 }
144 setState(ncomment(type, currNest));
145 return type;
146 };
147 }
148
149 function stringLiteral(source, setState) {
150 while (!source.eol()) {

Callers 1

normalFunction · 0.85

Calls 1

setStateFunction · 0.85

Tested by

no test coverage detected