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