(store, pea)
| 82 | }; |
| 83 | |
| 84 | var all_ws = function(store, pea) { // pea == post extended attribute, tpea = same for types |
| 85 | var t = { type: "whitespace", value: "" }; |
| 86 | while (true) { |
| 87 | var w = ws(); |
| 88 | if (!w) break; |
| 89 | t.value += w.value; |
| 90 | } |
| 91 | if (t.value.length > 0) { |
| 92 | if (store) { |
| 93 | var w = t.value, |
| 94 | re = { |
| 95 | "ws": /^([\t\n\r ]+)/, |
| 96 | "line-comment": /^\/\/(.*)\n?/m, |
| 97 | "multiline-comment": /^\/\*((?:.|\n|\r)*?)\*\// |
| 98 | }, |
| 99 | wsTypes = []; |
| 100 | for (var k in re) wsTypes.push(k); |
| 101 | while (w.length) { |
| 102 | var matched = false; |
| 103 | for (var i = 0, n = wsTypes.length; i < n; i++) { |
| 104 | var type = wsTypes[i]; |
| 105 | w = w.replace(re[type], function(tok, m1) { |
| 106 | store.push({ type: type + (pea ? ("-" + pea) : ""), value: m1 }); |
| 107 | matched = true; |
| 108 | return ""; |
| 109 | }); |
| 110 | if (matched) break; |
| 111 | } |
| 112 | if (matched) continue; |
| 113 | throw new Error("Surprising white space construct."); // this shouldn't happen |
| 114 | } |
| 115 | } |
| 116 | return t; |
| 117 | } |
| 118 | }; |
| 119 | |
| 120 | var integer_type = function() { |
| 121 | var ret = ""; |
no test coverage detected