| 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()) { |