(stream,state)
| 101 | // tokenizer |
| 102 | |
| 103 | function tokenizer(stream,state) { |
| 104 | // in multi-line string |
| 105 | if (state.in_string) { |
| 106 | state.in_string = (!doubleQuote(stream)); |
| 107 | return rval(state,stream,"string"); |
| 108 | } |
| 109 | |
| 110 | // in multi-line atom |
| 111 | if (state.in_atom) { |
| 112 | state.in_atom = (!singleQuote(stream)); |
| 113 | return rval(state,stream,"atom"); |
| 114 | } |
| 115 | |
| 116 | // whitespace |
| 117 | if (stream.eatSpace()) { |
| 118 | return rval(state,stream,"whitespace"); |
| 119 | } |
| 120 | |
| 121 | // attributes and type specs |
| 122 | if (!peekToken(state) && |
| 123 | stream.match(/-\s*[a-zß-öø-ÿ][\wØ-ÞÀ-Öß-öø-ÿ]*/)) { |
| 124 | if (is_member(stream.current(),typeWords)) { |
| 125 | return rval(state,stream,"type"); |
| 126 | }else{ |
| 127 | return rval(state,stream,"attribute"); |
| 128 | } |
| 129 | } |
| 130 | |
| 131 | var ch = stream.next(); |
| 132 | |
| 133 | // comment |
| 134 | if (ch == '%') { |
| 135 | stream.skipToEnd(); |
| 136 | return rval(state,stream,"comment"); |
| 137 | } |
| 138 | |
| 139 | // colon |
| 140 | if (ch == ":") { |
| 141 | return rval(state,stream,"colon"); |
| 142 | } |
| 143 | |
| 144 | // macro |
| 145 | if (ch == '?') { |
| 146 | stream.eatSpace(); |
| 147 | stream.eatWhile(anumRE); |
| 148 | return rval(state,stream,"macro"); |
| 149 | } |
| 150 | |
| 151 | // record |
| 152 | if (ch == "#") { |
| 153 | stream.eatSpace(); |
| 154 | stream.eatWhile(anumRE); |
| 155 | return rval(state,stream,"record"); |
| 156 | } |
| 157 | |
| 158 | // dollar escape |
| 159 | if (ch == "$") { |
| 160 | if (stream.next() == "\\" && !stream.match(escapesRE)) { |
no test coverage detected