| 204 | } |
| 205 | |
| 206 | function indent(stream, state, type) { |
| 207 | type = type || 'coffee'; |
| 208 | var indentUnit = 0; |
| 209 | if (type === 'coffee') { |
| 210 | for (var i = 0; i < state.scopes.length; i++) { |
| 211 | if (state.scopes[i].type === 'coffee') { |
| 212 | indentUnit = state.scopes[i].offset + conf.indentUnit; |
| 213 | break; |
| 214 | } |
| 215 | } |
| 216 | } else { |
| 217 | indentUnit = stream.column() + stream.current().length; |
| 218 | } |
| 219 | state.scopes.unshift({ |
| 220 | offset: indentUnit, |
| 221 | type: type |
| 222 | }); |
| 223 | } |
| 224 | |
| 225 | function dedent(stream, state) { |
| 226 | if (state.scopes.length == 1) return; |