(scope, str, pos)
| 241 | } |
| 242 | |
| 243 | function parseType(scope, str, pos) { |
| 244 | var type, union = false, madeUp = false; |
| 245 | for (;;) { |
| 246 | var inner = parseTypeAtom(scope, str, pos); |
| 247 | if (!inner) return null; |
| 248 | madeUp = madeUp || inner.madeUp; |
| 249 | if (union) inner.type.propagate(union); |
| 250 | else type = inner.type; |
| 251 | pos = skipSpace(str, inner.end); |
| 252 | if (str.charAt(pos) != "|") break; |
| 253 | pos++; |
| 254 | if (!union) { |
| 255 | union = new infer.AVal; |
| 256 | type.propagate(union); |
| 257 | type = union; |
| 258 | } |
| 259 | } |
| 260 | var isOptional = false; |
| 261 | if (str.charAt(pos) == "=") { |
| 262 | ++pos; |
| 263 | isOptional = true; |
| 264 | } |
| 265 | return {type: type, end: pos, isOptional: isOptional, madeUp: madeUp}; |
| 266 | } |
| 267 | |
| 268 | function parseTypeInner(scope, str, pos) { |
| 269 | pos = skipSpace(str, pos); |
no test coverage detected
searching dependent graphs…