| </style></head><body><div id="coverage"><h1 id="overview">Coverage</h1><div id="menu"><li><a href="#overview">overview</a></li><li><span class="cov high">95</span><a href="#webidl2.js"><span class="basename">webidl2.js</span></a></li><a id="logo" href="http://visionmedia.github.com/mocha/">m</a></div><div id="stats" class="high"><div class="percentage">95%</div><div class="sloc">572</div><div class="hits">548</div><div class="misses">24</div></div><div id="files"><div class="file"><h2 id="webidl2.js">webidl2.js</h2><div id="stats" class="high"><div class="percentage">95%</div><div class="sloc">572</div><div class="hits">548</div><div class="misses">24</div></div><table id="source"><thead><tr><th>Line</th><th>Hits</th><th>Source</th></tr></thead><tbody><tr><td class="line">1</td><td class="hits"></td><td class="source"> </td></tr><tr><td class="line">2</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"> <td class="line">3</td><td class="hits">1</td><td class="source"><span class="k">(</span><span class="k">function</span> <span class="k">()</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">4</td><td class="hits">1</td><td class="source"> <span class="k">var</span> tokenise <span class="k">=</span> <span class="k">function</span> <span class="k">(</span>str<span class="k">)</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">5</td><td class="hits">47</td><td class="source"> <span class="k">var</span> tokens <span class="k">=</span> <span class="k">[]</span></td></tr><tr><td class="line">6</td><td class="hits"></td><td class="source"> <span class="k">,</span> re <span class="k">=</span> <span class="k">{</span></td></tr><tr><td class="line">7</td><td class="hits"></td><td class="source"> <span class="s">"float"</span><span class="k">:</span> <span class="s">/^-?(([0-9]+\.[0-9]*|[0-9]*\.[0-9]+)([Ee][-+]?[0-9]+)?|[0-9]+[Ee][-+]?[0-9]+)/</span></td></tr><tr><td class="line">8</td><td class="hits"></td><td class="source"> <span class="k">,</span> <span class="s">"integer"</span><span class="k">:</span> <span class="s">/^-?(0([Xx][0-9A-Fa-f]+|[0-7]*)|[1-9][0-9]*)/</span></td></tr><tr><td class="line">9</td><td class="hits"></td><td class="source"> <span class="k">,</span> <span class="s">"identifier"</span><span class="k">:</span> <span class="s">/^[A-Z_a-z][0-9A-Z_a-z]*/</span></td></tr><tr><td class="line">10</td><td class="hits"></td><td class="source"> <span class="k">,</span> <span class="s">"string"</span><span class="k">:</span> <span class="s">/^"[^"]*"/</span></td></tr><tr><td class="line">11</td><td class="hits"></td><td class="source"> <span class="k">,</span> <span class="s">"whitespace"</span><span class="k">:</span> <span class="s">/^(?:[\t\n\r ]+|[\t\n\r ]*((\/\/.*|\/\*(.|\n|\r)*?\*\/)[\t\n\r ]*))+/</span></td></tr><tr><td class="line">12</td><td class="hits"></td><td class="source"> <span class="k">,</span> <span class="s">"other"</span><span class="k">:</span> <span class="s">/^[^\t\n\r 0-9A-Z_a-z]/</span></td></tr><tr><td class="line">13</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr><td class="line">14</td><td class="hits"></td><td class="source"> <span class="k">,</span> types <span class="k">=</span> <span class="k">[]</span></td></tr><tr><td class="line">15</td><td class="hits"></td><td class="source"> <span class="k">;</span></td></tr><tr class="hit"> <td class="line">16</td><td class="hits">329</td><td class="source"> <span class="k">for</span> <span class="k">(</span><span class="k">var</span> k <span class="k">in</span> re<span class="k">)</span> types<span class="k">.</span>push<span class="k">(</span>k<span class="k">);</span></td></tr><tr class="hit"> <td class="line">17</td><td class="hits">47</td><td class="source"> <span class="k">while</span> <span class="k">(</span>str<span class="k">.</span>length <span class="k">></span> <span class="s">0</span><span class="k">)</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">18</td><td class="hits">2914</td><td class="source"> <span class="k">var</span> matched <span class="k">=</span> <span class="k">false</span><span class="k">;</span></td></tr><tr class="hit"> <td class="line">19</td><td class="hits">2914</td><td class="source"> <span class="k">for</span> <span class="k">(</span><span class="k">var</span> i <span class="k">=</span> <span class="s">0</span><span class="k">,</span> n <span class="k">=</span> types<span class="k">.</span>length<span class="k">;</span> i <span class="k"><</span> n<span class="k">;</span> i<span class="k">++)</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">20</td><td class="hits">13325</td><td class="source"> <span class="k">var</span> type <span class="k">=</span> types<span class="k">[</span>i<span class="k">];</span></td></tr><tr class="hit"> <td class="line">21</td><td class="hits">13325</td><td class="source"> str <span class="k">=</span> str<span class="k">.</span>replace<span class="k">(</span>re<span class="k">[</span>type<span class="k">],</span> <span class="k">function</span> <span class="k">(</span>tok<span class="k">)</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">22</td><td class="hits">2914</td><td class="source"> tokens<span class="k">.</span>push<span class="k">(</span><span class="k">{</span> type<span class="k">:</span> type<span class="k">,</span> value<span class="k">:</span> tok <span class="k">}</span><span class="k">);</span></td></tr><tr class="hit"> <td class="line">23</td><td class="hits">2914</td><td class="source"> matched <span class="k">=</span> <span class="k">true</span><span class="k">;</span></td></tr><tr class="hit"> <td class="line">24</td><td class="hits">2914</td><td class="source"> <span class="k">return</span> <span class="s">""</span><span class="k">;</span></td></tr><tr><td class="line">25</td><td class="hits"></td><td class="source"> <span class="k">}</span><span class="k">);</span></td></tr><tr class="hit"> <td class="line">26</td><td class="hits">16239</td><td class="source"> <span class="k">if</span> <span class="k">(</span>matched<span class="k">)</span> <span class="k">break</span><span class="k">;</span></td></tr><tr><td class="line">27</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr class="hit"> <td class="line">28</td><td class="hits">5828</td><td class="source"> <span class="k">if</span> <span class="k">(</span>matched<span class="k">)</span> <span class="k">continue</span><span class="k">;</span></td></tr><tr class="miss"> <td class="line">29</td><td class="hits">0</td><td class="source"> <span class="k">throw</span> <span class="k">new</span> Error<span class="k">(</span><span class="s">"Token stream not progressing"</span><span class="k">);</span></td></tr><tr><td class="line">30</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr class="hit"> <td class="line">31</td><td class="hits">47</td><td class="source"> <span class="k">return</span> tokens<span class="k">;</span></td></tr><tr><td class="line">32</td><td class="hits"></td><td class="source"> <span class="k">}</span><span class="k">;</span></td></tr><tr><td class="line">33</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"> <td class="line">34</td><td class="hits">1</td><td class="source"> <span class="k">var</span> parse <span class="k">=</span> <span class="k">function</span> <span class="k">(</span>tokens<span class="k">)</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">35</td><td class="hits">47</td><td class="source"> <span class="k">var</span> line <span class="k">=</span> <span class="s">1</span><span class="k">;</span></td></tr><tr class="hit"> <td class="line">36</td><td class="hits">47</td><td class="source"> tokens <span class="k">=</span> tokens<span class="k">.</span>slice<span class="k">();</span></td></tr><tr><td class="line">37</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"> <td class="line">38</td><td class="hits">47</td><td class="source"> <span class="k">var</span> FLOAT <span class="k">=</span> <span class="s">"float"</span></td></tr><tr><td class="line">39</td><td class="hits"></td><td class="source"> <span class="k">,</span> INT <span class="k">=</span> <span class="s">"integer"</span></td></tr><tr><td class="line">40</td><td class="hits"></td><td class="source"> <span class="k">,</span> ID <span class="k">=</span> <span class="s">"identifier"</span></td></tr><tr><td class="line">41</td><td class="hits"></td><td class="source"> <span class="k">,</span> STR <span class="k">=</span> <span class="s">"string"</span></td></tr><tr><td class="line">42</td><td class="hits"></td><td class="source"> <span class="k">,</span> OTHER <span class="k">=</span> <span class="s">"other"</span></td></tr><tr><td class="line">43</td><td class="hits"></td><td class="source"> <span class="k">;</span></td></tr><tr><td class="line">44</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"> <td class="line">45</td><td class="hits">47</td><td class="source"> <span class="k">var</span> WebIDLParseError <span class="k">=</span> <span class="k">function</span> <span class="k">(</span>str<span class="k">,</span> line<span class="k">,</span> input<span class="k">,</span> tokens<span class="k">)</span> <span class="k">{</span></td></tr><tr class="miss"> <td class="line">46</td><td class="hits">0</td><td class="source"> <span class="k">this</span><span class="k">.</span>message <span class="k">=</span> str<span class="k">;</span></td></tr><tr class="miss"> <td class="line">47</td><td class="hits">0</td><td class="source"> <span class="k">this</span><span class="k">.</span>line <span class="k">=</span> line<span class="k">;</span></td></tr><tr class="miss"> <td class="line">48</td><td class="hits">0</td><td class="source"> <span class="k">this</span><span class="k">.</span>input <span class="k">=</span> input<span class="k">;</span></td></tr><tr class="miss"> <td class="line">49</td><td class="hits">0</td><td class="source"> <span class="k">this</span><span class="k">.</span>tokens <span class="k">=</span> tokens<span class="k">;</span></td></tr><tr><td class="line">50</td><td class="hits"></td><td class="source"> <span class="k">}</span><span class="k">;</span></td></tr><tr class="hit"> <td class="line">51</td><td class="hits">47</td><td class="source"> WebIDLParseError<span class="k">.</span>prototype<span class="k">.</span>toString <span class="k">=</span> <span class="k">function</span> <span class="k">()</span> <span class="k">{</span></td></tr><tr class="miss"> <td class="line">52</td><td class="hits">0</td><td class="source"> <span class="k">return</span> <span class="k">this</span><span class="k">.</span>message <span class="k">+</span> <span class="s">", line "</span> <span class="k">+</span> <span class="k">this</span><span class="k">.</span>line <span class="k">+</span> <span class="s">" (tokens: '"</span> <span class="k">+</span> <span class="k">this</span><span class="k">.</span>input <span class="k">+</span> <span class="s">"')</span><span class="t">\n</span><span class="s">"</span> <span class="k">+</span></td></tr><tr><td class="line">53</td><td class="hits"></td><td class="source"> JSON<span class="k">.</span>stringify<span class="k">(</span><span class="k">this</span><span class="k">.</span>tokens<span class="k">,</span> <span class="k">null</span><span class="k">,</span> <span class="s">4</span><span class="k">);</span></td></tr><tr><td class="line">54</td><td class="hits"></td><td class="source"> <span class="k">}</span><span class="k">;</span></td></tr><tr><td class="line">55</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"> <td class="line">56</td><td class="hits">47</td><td class="source"> <span class="k">var</span> error <span class="k">=</span> <span class="k">function</span> <span class="k">(</span>str<span class="k">)</span> <span class="k">{</span></td></tr><tr class="miss"> <td class="line">57</td><td class="hits">0</td><td class="source"> <span class="k">var</span> tok <span class="k">=</span> <span class="s">""</span><span class="k">,</span> numTokens <span class="k">=</span> <span class="s">0</span><span class="k">,</span> maxTokens <span class="k">=</span> <span class="s">5</span><span class="k">;</span></td></tr><tr class="miss"> <td class="line">58</td><td class="hits">0</td><td class="source"> <span class="k">while</span> <span class="k">(</span>numTokens <span class="k"><</span> maxTokens <span class="k">&&</span> tokens<span class="k">.</span>length <span class="k">></span> numTokens<span class="k">)</span> <span class="k">{</span></td></tr><tr class="miss"> <td class="line">59</td><td class="hits">0</td><td class="source"> tok <span class="k">+=</span> tokens<span class="k">[</span>numTokens<span class="k">].</span>value<span class="k">;</span></td></tr><tr class="miss"> <td class="line">60</td><td class="hits">0</td><td class="source"> numTokens<span class="k">++;</span></td></tr><tr><td class="line">61</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr class="miss"> <td class="line">62</td><td class="hits">0</td><td class="source"> <span class="k">throw</span> <span class="k">new</span> WebIDLParseError<span class="k">(</span>str<span class="k">,</span> line<span class="k">,</span> tok<span class="k">,</span> tokens<span class="k">.</span>slice<span class="k">(</span><span class="s">0</span><span class="k">,</span> <span class="s">5</span><span class="k">));</span></td></tr><tr><td class="line">63</td><td class="hits"></td><td class="source"> <span class="k">}</span><span class="k">;</span></td></tr><tr><td class="line">64</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"> <td class="line">65</td><td class="hits">47</td><td class="source"> <span class="k">var</span> last_token <span class="k">=</span> <span class="k">null</span><span class="k">;</span></td></tr><tr><td class="line">66</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"> <td class="line">67</td><td class="hits">47</td><td class="source"> <span class="k">var</span> consume <span class="k">=</span> <span class="k">function</span> <span class="k">(</span>type<span class="k">,</span> value<span class="k">)</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">68</td><td class="hits">8778</td><td class="source"> <span class="k">if</span> <span class="k">(!</span>tokens<span class="k">.</span>length <span class="k">||</span> tokens<span class="k">[</span><span class="s">0</span><span class="k">].</span>type <span class="k">!==</span> type<span class="k">)</span> <span class="k">return</span><span class="k">;</span></td></tr><tr class="hit"> <td class="line">69</td><td class="hits">5470</td><td class="source"> <span class="k">if</span> <span class="k">(</span><span class="k">typeof</span> value <span class="k">===</span> <span class="s">"undefined"</span> <span class="k">||</span> tokens<span class="k">[</span><span class="s">0</span><span class="k">].</span>value <span class="k">===</span> value<span class="k">)</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">70</td><td class="hits">1738</td><td class="source"> last_token <span class="k">=</span> tokens<span class="k">.</span>shift<span class="k">();</span></td></tr><tr class="hit"> <td class="line">71</td><td class="hits">1738</td><td class="source"> <span class="k">return</span> last_token<span class="k">;</span></td></tr><tr><td class="line">72</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr><td class="line">73</td><td class="hits"></td><td class="source"> <span class="k">}</span><span class="k">;</span></td></tr><tr><td class="line">74</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"> <td class="line">75</td><td class="hits">47</td><td class="source"> <span class="k">var</span> ws <span class="k">=</span> <span class="k">function</span> <span class="k">()</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">76</td><td class="hits">6961</td><td class="source"> <span class="k">if</span> <span class="k">(!</span>tokens<span class="k">.</span>length<span class="k">)</span> <span class="k">return</span><span class="k">;</span></td></tr><tr><td class="line">77</td><td class="hits"></td><td class="source"> <span class="c">// console.log("tokens.length", tokens.length, tokens[0]);</span></td></tr><tr class="hit"> <td class="line">78</td><td class="hits">6115</td><td class="source"> <span class="k">if</span> <span class="k">(</span>tokens<span class="k">[</span><span class="s">0</span><span class="k">].</span>type <span class="k">===</span> <span class="s">"whitespace"</span><span class="k">)</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">79</td><td class="hits">1172</td><td class="source"> <span class="k">var</span> t <span class="k">=</span> tokens<span class="k">.</span>shift<span class="k">();</span></td></tr><tr class="hit"> <td class="line">80</td><td class="hits">2294</td><td class="source"> t<span class="k">.</span>value<span class="k">.</span>replace<span class="k">(</span><span class="s">/\n/g</span><span class="k">,</span> <span class="k">function</span> <span class="k">(</span>m<span class="k">)</span> <span class="k">{</span> line<span class="k">++;</span> <span class="k">return</span> m<span class="k">;</span> <span class="k">}</span><span class="k">);</span></td></tr><tr class="hit"> <td class="line">81</td><td class="hits">1172</td><td class="source"> <span class="k">return</span> t<span class="k">;</span></td></tr><tr><td class="line">82</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr><td class="line">83</td><td class="hits"></td><td class="source"> <span class="k">}</span><span class="k">;</span></td></tr><tr><td class="line">84</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"> <td class="line">85</td><td class="hits">47</td><td class="source"> <span class="k">var</span> all_ws <span class="k">=</span> <span class="k">function</span> <span class="k">()</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">86</td><td class="hits">5366</td><td class="source"> <span class="k">var</span> t <span class="k">=</span> <span class="k">{</span> type<span class="k">:</span> <span class="s">"whitespace"</span><span class="k">,</span> value<span class="k">:</span> <span class="s">""</span> <span class="k">}</span><span class="k">;</span></td></tr><tr class="hit"> <td class="line">87</td><td class="hits">5366</td><td class="source"> <span class="k">while</span> <span class="k">(</span><span class="k">true</span><span class="k">)</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">88</td><td class="hits">6538</td><td class="source"> <span class="k">var</span> w <span class="k">=</span> ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">89</td><td class="hits">11904</td><td class="source"> <span class="k">if</span> <span class="k">(!</span>w<span class="k">)</span> <span class="k">break</span><span class="k">;</span></td></tr><tr class="hit"> <td class="line">90</td><td class="hits">1172</td><td class="source"> t<span class="k">.</span>value <span class="k">+=</span> w<span class="k">.</span>value<span class="k">;</span></td></tr><tr><td class="line">91</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr class="hit"> <td class="line">92</td><td class="hits">6538</td><td class="source"> <span class="k">if</span> <span class="k">(</span>t<span class="k">.</span>value<span class="k">.</span>length <span class="k">></span> <span class="s">0</span><span class="k">)</span> <span class="k">return</span> t<span class="k">;</span></td></tr><tr><td class="line">93</td><td class="hits"></td><td class="source"> <span class="k">}</span><span class="k">;</span></td></tr><tr><td class="line">94</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"> <td class="line">95</td><td class="hits">47</td><td class="source"> <span class="k">var</span> integer_type <span class="k">=</span> <span class="k">function</span> <span class="k">()</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">96</td><td class="hits">273</td><td class="source"> <span class="k">var</span> ret <span class="k">=</span> <span class="s">""</span><span class="k">;</span></td></tr><tr class="hit"> <td class="line">97</td><td class="hits">273</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">98</td><td class="hits">312</td><td class="source"> <span class="k">if</span> <span class="k">(</span>consume<span class="k">(</span>ID<span class="k">,</span> <span class="s">"unsigned"</span><span class="k">))</span> ret <span class="k">=</span> <span class="s">"unsigned "</span><span class="k">;</span></td></tr><tr class="hit"> <td class="line">99</td><td class="hits">273</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">100</td><td class="hits">287</td><td class="source"> <span class="k">if</span> <span class="k">(</span>consume<span class="k">(</span>ID<span class="k">,</span> <span class="s">"short"</span><span class="k">))</span> <span class="k">return</span> ret <span class="k">+</span> <span class="s">"short"</span><span class="k">;</span></td></tr><tr class="hit"> <td class="line">101</td><td class="hits">259</td><td class="source"> <span class="k">if</span> <span class="k">(</span>consume<span class="k">(</span>ID<span class="k">,</span> <span class="s">"long"</span><span class="k">))</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">102</td><td class="hits">41</td><td class="source"> ret <span class="k">+=</span> <span class="s">"long"</span><span class="k">;</span></td></tr><tr class="hit"> <td class="line">103</td><td class="hits">41</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">104</td><td class="hits">43</td><td class="source"> <span class="k">if</span> <span class="k">(</span>consume<span class="k">(</span>ID<span class="k">,</span> <span class="s">"long"</span><span class="k">))</span> <span class="k">return</span> ret <span class="k">+</span> <span class="s">" long"</span><span class="k">;</span></td></tr><tr class="hit"> <td class="line">105</td><td class="hits">39</td><td class="source"> <span class="k">return</span> ret<span class="k">;</span></td></tr><tr><td class="line">106</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr class="hit"> <td class="line">107</td><td class="hits">218</td><td class="source"> <span class="k">if</span> <span class="k">(</span>ret<span class="k">)</span> error<span class="k">(</span><span class="s">"Failed to parse integer type"</span><span class="k">);</span></td></tr><tr><td class="line">108</td><td class="hits"></td><td class="source"> <span class="k">}</span><span class="k">;</span></td></tr><tr><td class="line">109</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"> <td class="line">110</td><td class="hits">47</td><td class="source"> <span class="k">var</span> float_type <span class="k">=</span> <span class="k">function</span> <span class="k">()</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">111</td><td class="hits">218</td><td class="source"> <span class="k">var</span> ret <span class="k">=</span> <span class="s">""</span><span class="k">;</span></td></tr><tr class="hit"> <td class="line">112</td><td class="hits">218</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">113</td><td class="hits">222</td><td class="source"> <span class="k">if</span> <span class="k">(</span>consume<span class="k">(</span>ID<span class="k">,</span> <span class="s">"unrestricted"</span><span class="k">))</span> ret <span class="k">=</span> <span class="s">"unrestricted "</span><span class="k">;</span></td></tr><tr class="hit"> <td class="line">114</td><td class="hits">218</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">115</td><td class="hits">257</td><td class="source"> <span class="k">if</span> <span class="k">(</span>consume<span class="k">(</span>ID<span class="k">,</span> <span class="s">"float"</span><span class="k">))</span> <span class="k">return</span> ret <span class="k">+</span> <span class="s">"float"</span><span class="k">;</span></td></tr><tr class="hit"> <td class="line">116</td><td class="hits">182</td><td class="source"> <span class="k">if</span> <span class="k">(</span>consume<span class="k">(</span>ID<span class="k">,</span> <span class="s">"double"</span><span class="k">))</span> <span class="k">return</span> ret <span class="k">+</span> <span class="s">"double"</span><span class="k">;</span></td></tr><tr class="hit"> <td class="line">117</td><td class="hits">176</td><td class="source"> <span class="k">if</span> <span class="k">(</span>ret<span class="k">)</span> error<span class="k">(</span><span class="s">"Failed to parse float type"</span><span class="k">);</span></td></tr><tr><td class="line">118</td><td class="hits"></td><td class="source"> <span class="k">}</span><span class="k">;</span></td></tr><tr><td class="line">119</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"> <td class="line">120</td><td class="hits">47</td><td class="source"> <span class="k">var</span> primitive_type <span class="k">=</span> <span class="k">function</span> <span class="k">()</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">121</td><td class="hits">273</td><td class="source"> <span class="k">var</span> num_type <span class="k">=</span> integer_type<span class="k">()</span> <span class="k">||</span> float_type<span class="k">();</span></td></tr><tr class="hit"> <td class="line">122</td><td class="hits">370</td><td class="source"> <span class="k">if</span> <span class="k">(</span>num_type<span class="k">)</span> <span class="k">return</span> num_type<span class="k">;</span></td></tr><tr class="hit"> <td class="line">123</td><td class="hits">176</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">124</td><td class="hits">186</td><td class="source"> <span class="k">if</span> <span class="k">(</span>consume<span class="k">(</span>ID<span class="k">,</span> <span class="s">"boolean"</span><span class="k">))</span> <span class="k">return</span> <span class="s">"boolean"</span><span class="k">;</span></td></tr><tr class="hit"> <td class="line">125</td><td class="hits">167</td><td class="source"> <span class="k">if</span> <span class="k">(</span>consume<span class="k">(</span>ID<span class="k">,</span> <span class="s">"byte"</span><span class="k">))</span> <span class="k">return</span> <span class="s">"byte"</span><span class="k">;</span></td></tr><tr class="hit"> <td class="line">126</td><td class="hits">168</td><td class="source"> <span class="k">if</span> <span class="k">(</span>consume<span class="k">(</span>ID<span class="k">,</span> <span class="s">"octet"</span><span class="k">))</span> <span class="k">return</span> <span class="s">"octet"</span><span class="k">;</span></td></tr><tr><td class="line">127</td><td class="hits"></td><td class="source"> <span class="k">}</span><span class="k">;</span></td></tr><tr><td class="line">128</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"> <td class="line">129</td><td class="hits">47</td><td class="source"> <span class="k">var</span> const_value <span class="k">=</span> <span class="k">function</span> <span class="k">()</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">130</td><td class="hits">17</td><td class="source"> <span class="k">if</span> <span class="k">(</span>consume<span class="k">(</span>ID<span class="k">,</span> <span class="s">"true"</span><span class="k">))</span> <span class="k">return</span> <span class="k">true</span><span class="k">;</span></td></tr><tr class="hit"> <td class="line">131</td><td class="hits">19</td><td class="source"> <span class="k">if</span> <span class="k">(</span>consume<span class="k">(</span>ID<span class="k">,</span> <span class="s">"false"</span><span class="k">))</span> <span class="k">return</span> <span class="k">false</span><span class="k">;</span></td></tr><tr class="hit"> <td class="line">132</td><td class="hits">17</td><td class="source"> <span class="k">if</span> <span class="k">(</span>consume<span class="k">(</span>ID<span class="k">,</span> <span class="s">"null"</span><span class="k">))</span> <span class="k">return</span> <span class="k">null</span><span class="k">;</span></td></tr><tr class="hit"> <td class="line">133</td><td class="hits">14</td><td class="source"> <span class="k">if</span> <span class="k">(</span>consume<span class="k">(</span>ID<span class="k">,</span> <span class="s">"Infinity"</span><span class="k">))</span> <span class="k">return</span> Infinity<span class="k">;</span></td></tr><tr class="hit"> <td class="line">134</td><td class="hits">13</td><td class="source"> <span class="k">if</span> <span class="k">(</span>consume<span class="k">(</span>ID<span class="k">,</span> <span class="s">"NaN"</span><span class="k">))</span> <span class="k">return</span> NaN<span class="k">;</span></td></tr><tr class="hit"> <td class="line">135</td><td class="hits">11</td><td class="source"> <span class="k">var</span> ret <span class="k">=</span> consume<span class="k">(</span>FLOAT<span class="k">)</span> <span class="k">||</span> consume<span class="k">(</span>INT<span class="k">);</span></td></tr><tr class="hit"> <td class="line">136</td><td class="hits">19</td><td class="source"> <span class="k">if</span> <span class="k">(</span>ret<span class="k">)</span> <span class="k">return</span> <span class="s">1</span> <span class="k">*</span> ret<span class="k">.</span>value<span class="k">;</span></td></tr><tr class="hit"> <td class="line">137</td><td class="hits">3</td><td class="source"> <span class="k">var</span> tok <span class="k">=</span> consume<span class="k">(</span>OTHER<span class="k">,</span> <span class="s">"-"</span><span class="k">);</span></td></tr><tr class="hit"> <td class="line">138</td><td class="hits">3</td><td class="source"> <span class="k">if</span> <span class="k">(</span>tok<span class="k">)</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">139</td><td class="hits">2</td><td class="source"> <span class="k">if</span> <span class="k">(</span>consume<span class="k">(</span>ID<span class="k">,</span> <span class="s">"Infinity"</span><span class="k">))</span> <span class="k">return</span> <span class="k">-</span>Infinity<span class="k">;</span></td></tr><tr class="miss"> <td class="line">140</td><td class="hits">0</td><td class="source"> <span class="k">else</span> tokens<span class="k">.</span>unshift<span class="k">(</span>tok<span class="k">);</span></td></tr><tr><td class="line">141</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr><td class="line">142</td><td class="hits"></td><td class="source"> <span class="k">}</span><span class="k">;</span></td></tr><tr><td class="line">143</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"> <td class="line">144</td><td class="hits">47</td><td class="source"> <span class="k">var</span> type_suffix <span class="k">=</span> <span class="k">function</span> <span class="k">(</span>obj<span class="k">)</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">145</td><td class="hits">249</td><td class="source"> <span class="k">while</span> <span class="k">(</span><span class="k">true</span><span class="k">)</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">146</td><td class="hits">263</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">147</td><td class="hits">263</td><td class="source"> <span class="k">if</span> <span class="k">(</span>consume<span class="k">(</span>OTHER<span class="k">,</span> <span class="s">"?"</span><span class="k">))</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">148</td><td class="hits">11</td><td class="source"> <span class="k">if</span> <span class="k">(</span>obj<span class="k">.</span>nullable<span class="k">)</span> error<span class="k">(</span><span class="s">"Can't nullable more than once"</span><span class="k">);</span></td></tr><tr class="hit"> <td class="line">149</td><td class="hits">11</td><td class="source"> obj<span class="k">.</span>nullable <span class="k">=</span> <span class="k">true</span><span class="k">;</span></td></tr><tr><td class="line">150</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr class="hit"> <td class="line">151</td><td class="hits">252</td><td class="source"> <span class="k">else</span> <span class="k">if</span> <span class="k">(</span>consume<span class="k">(</span>OTHER<span class="k">,</span> <span class="s">"["</span><span class="k">))</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">152</td><td class="hits">3</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">153</td><td class="hits">3</td><td class="source"> consume<span class="k">(</span>OTHER<span class="k">,</span> <span class="s">"]"</span><span class="k">)</span> <span class="k">||</span> error<span class="k">(</span><span class="s">"Unterminated array type"</span><span class="k">);</span></td></tr><tr class="hit"> <td class="line">154</td><td class="hits">5</td><td class="source"> <span class="k">if</span> <span class="k">(!</span>obj<span class="k">.</span>array<span class="k">)</span> obj<span class="k">.</span>array <span class="k">=</span> <span class="s">1</span><span class="k">;</span></td></tr><tr class="hit"> <td class="line">155</td><td class="hits">1</td><td class="source"> <span class="k">else</span> obj<span class="k">.</span>array<span class="k">++;</span></td></tr><tr><td class="line">156</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr class="hit"> <td class="line">157</td><td class="hits">249</td><td class="source"> <span class="k">else</span> <span class="k">return</span><span class="k">;</span></td></tr><tr><td class="line">158</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr><td class="line">159</td><td class="hits"></td><td class="source"> <span class="k">}</span><span class="k">;</span></td></tr><tr><td class="line">160</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"> <td class="line">161</td><td class="hits">47</td><td class="source"> <span class="k">var</span> single_type <span class="k">=</span> <span class="k">function</span> <span class="k">()</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">162</td><td class="hits">261</td><td class="source"> <span class="k">var</span> prim <span class="k">=</span> primitive_type<span class="k">()</span></td></tr><tr><td class="line">163</td><td class="hits"></td><td class="source"> <span class="k">,</span> ret <span class="k">=</span> <span class="k">{</span> sequence<span class="k">:</span> <span class="k">false</span><span class="k">,</span> nullable<span class="k">:</span> <span class="k">false</span><span class="k">,</span> array<span class="k">:</span> <span class="k">false</span><span class="k">,</span> union<span class="k">:</span> <span class="k">false</span> <span class="k">}</span></td></tr><tr><td class="line">164</td><td class="hits"></td><td class="source"> <span class="k">;</span></td></tr><tr class="hit"> <td class="line">165</td><td class="hits">261</td><td class="source"> <span class="k">if</span> <span class="k">(</span>prim<span class="k">)</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">166</td><td class="hits">99</td><td class="source"> ret<span class="k">.</span>idlType <span class="k">=</span> prim<span class="k">;</span></td></tr><tr><td class="line">167</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr class="hit"> <td class="line">168</td><td class="hits">162</td><td class="source"> <span class="k">else</span> <span class="k">if</span> <span class="k">(</span>consume<span class="k">(</span>ID<span class="k">,</span> <span class="s">"sequence"</span><span class="k">))</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">169</td><td class="hits">4</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">170</td><td class="hits">4</td><td class="source"> <span class="k">if</span> <span class="k">(!</span>consume<span class="k">(</span>OTHER<span class="k">,</span> <span class="s">"<"</span><span class="k">))</span> <span class="k">{</span></td></tr><tr class="miss"> <td class="line">171</td><td class="hits">0</td><td class="source"> ret<span class="k">.</span>idlType <span class="k">=</span> <span class="s">"sequence"</span><span class="k">;</span></td></tr><tr><td class="line">172</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr><td class="line">173</td><td class="hits"></td><td class="source"> <span class="k">else</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">174</td><td class="hits">4</td><td class="source"> ret<span class="k">.</span>sequence <span class="k">=</span> <span class="k">true</span><span class="k">;</span></td></tr><tr class="hit"> <td class="line">175</td><td class="hits">4</td><td class="source"> ret<span class="k">.</span>idlType <span class="k">=</span> type<span class="k">()</span> <span class="k">||</span> error<span class="k">(</span><span class="s">"Error parsing sequence type"</span><span class="k">);</span></td></tr><tr class="hit"> <td class="line">176</td><td class="hits">4</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">177</td><td class="hits">4</td><td class="source"> <span class="k">if</span> <span class="k">(!</span>consume<span class="k">(</span>OTHER<span class="k">,</span> <span class="s">">"</span><span class="k">))</span> error<span class="k">(</span><span class="s">"Unterminated sequence"</span><span class="k">);</span></td></tr><tr class="hit"> <td class="line">178</td><td class="hits">4</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">179</td><td class="hits">5</td><td class="source"> <span class="k">if</span> <span class="k">(</span>consume<span class="k">(</span>OTHER<span class="k">,</span> <span class="s">"?"</span><span class="k">))</span> ret<span class="k">.</span>nullable <span class="k">=</span> <span class="k">true</span><span class="k">;</span></td></tr><tr class="hit"> <td class="line">180</td><td class="hits">4</td><td class="source"> <span class="k">return</span> ret<span class="k">;</span></td></tr><tr><td class="line">181</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr><td class="line">182</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr><td class="line">183</td><td class="hits"></td><td class="source"> <span class="k">else</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">184</td><td class="hits">158</td><td class="source"> <span class="k">var</span> name <span class="k">=</span> consume<span class="k">(</span>ID<span class="k">);</span></td></tr><tr class="hit"> <td class="line">185</td><td class="hits">169</td><td class="source"> <span class="k">if</span> <span class="k">(!</span>name<span class="k">)</span> <span class="k">return</span><span class="k">;</span></td></tr><tr class="hit"> <td class="line">186</td><td class="hits">147</td><td class="source"> ret<span class="k">.</span>idlType <span class="k">=</span> name<span class="k">.</span>value<span class="k">;</span></td></tr><tr><td class="line">187</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr class="hit"> <td class="line">188</td><td class="hits">246</td><td class="source"> type_suffix<span class="k">(</span>ret<span class="k">);</span></td></tr><tr class="hit"> <td class="line">189</td><td class="hits">246</td><td class="source"> <span class="k">if</span> <span class="k">(</span>ret<span class="k">.</span>nullable <span class="k">&&</span> ret<span class="k">.</span>idlType <span class="k">===</span> <span class="s">"any"</span><span class="k">)</span> error<span class="k">(</span><span class="s">"Type any cannot be made nullable"</span><span class="k">);</span></td></tr><tr class="hit"> <td class="line">190</td><td class="hits">246</td><td class="source"> <span class="k">return</span> ret<span class="k">;</span></td></tr><tr><td class="line">191</td><td class="hits"></td><td class="source"> <span class="k">}</span><span class="k">;</span></td></tr><tr><td class="line">192</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"> <td class="line">193</td><td class="hits">47</td><td class="source"> <span class="k">var</span> union_type <span class="k">=</span> <span class="k">function</span> <span class="k">()</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">194</td><td class="hits">11</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">195</td><td class="hits">19</td><td class="source"> <span class="k">if</span> <span class="k">(!</span>consume<span class="k">(</span>OTHER<span class="k">,</span> <span class="s">"("</span><span class="k">))</span> <span class="k">return</span><span class="k">;</span></td></tr><tr class="hit"> <td class="line">196</td><td class="hits">3</td><td class="source"> <span class="k">var</span> ret <span class="k">=</span> <span class="k">{</span> sequence<span class="k">:</span> <span class="k">false</span><span class="k">,</span> nullable<span class="k">:</span> <span class="k">false</span><span class="k">,</span> array<span class="k">:</span> <span class="k">false</span><span class="k">,</span> union<span class="k">:</span> <span class="k">true</span><span class="k">,</span> idlType<span class="k">:</span> <span class="k">[]</span> <span class="k">}</span><span class="k">;</span></td></tr><tr class="hit"> <td class="line">197</td><td class="hits">3</td><td class="source"> <span class="k">var</span> fst <span class="k">=</span> type<span class="k">()</span> <span class="k">||</span> error<span class="k">(</span><span class="s">"Union type with no content"</span><span class="k">);</span></td></tr><tr class="hit"> <td class="line">198</td><td class="hits">3</td><td class="source"> ret<span class="k">.</span>idlType<span class="k">.</span>push<span class="k">(</span>fst<span class="k">);</span></td></tr><tr class="hit"> <td class="line">199</td><td class="hits">3</td><td class="source"> <span class="k">while</span> <span class="k">(</span><span class="k">true</span><span class="k">)</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">200</td><td class="hits">7</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">201</td><td class="hits">10</td><td class="source"> <span class="k">if</span> <span class="k">(!</span>consume<span class="k">(</span>ID<span class="k">,</span> <span class="s">"or"</span><span class="k">))</span> <span class="k">break</span><span class="k">;</span></td></tr><tr class="hit"> <td class="line">202</td><td class="hits">4</td><td class="source"> <span class="k">var</span> typ <span class="k">=</span> type<span class="k">()</span> <span class="k">||</span> error<span class="k">(</span><span class="s">"No type after 'or' in union type"</span><span class="k">);</span></td></tr><tr class="hit"> <td class="line">203</td><td class="hits">4</td><td class="source"> ret<span class="k">.</span>idlType<span class="k">.</span>push<span class="k">(</span>typ<span class="k">);</span></td></tr><tr><td class="line">204</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr class="hit"> <td class="line">205</td><td class="hits">3</td><td class="source"> <span class="k">if</span> <span class="k">(!</span>consume<span class="k">(</span>OTHER<span class="k">,</span> <span class="s">")"</span><span class="k">))</span> error<span class="k">(</span><span class="s">"Unterminated union type"</span><span class="k">);</span></td></tr><tr class="hit"> <td class="line">206</td><td class="hits">3</td><td class="source"> type_suffix<span class="k">(</span>ret<span class="k">);</span></td></tr><tr class="hit"> <td class="line">207</td><td class="hits">3</td><td class="source"> <span class="k">return</span> ret<span class="k">;</span></td></tr><tr><td class="line">208</td><td class="hits"></td><td class="source"> <span class="k">}</span><span class="k">;</span></td></tr><tr><td class="line">209</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"> <td class="line">210</td><td class="hits">47</td><td class="source"> <span class="k">var</span> type <span class="k">=</span> <span class="k">function</span> <span class="k">()</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">211</td><td class="hits">261</td><td class="source"> <span class="k">return</span> single_type<span class="k">()</span> <span class="k">||</span> union_type<span class="k">();</span></td></tr><tr><td class="line">212</td><td class="hits"></td><td class="source"> <span class="k">}</span><span class="k">;</span></td></tr><tr><td class="line">213</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"> <td class="line">214</td><td class="hits">47</td><td class="source"> <span class="k">var</span> argument <span class="k">=</span> <span class="k">function</span> <span class="k">()</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">215</td><td class="hits">79</td><td class="source"> <span class="k">var</span> ret <span class="k">=</span> <span class="k">{</span> optional<span class="k">:</span> <span class="k">false</span><span class="k">,</span> variadic<span class="k">:</span> <span class="k">false</span> <span class="k">}</span><span class="k">;</span></td></tr><tr class="hit"> <td class="line">216</td><td class="hits">79</td><td class="source"> ret<span class="k">.</span>extAttrs <span class="k">=</span> extended_attrs<span class="k">();</span></td></tr><tr class="hit"> <td class="line">217</td><td class="hits">79</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">218</td><td class="hits">79</td><td class="source"> <span class="k">if</span> <span class="k">(</span>consume<span class="k">(</span>ID<span class="k">,</span> <span class="s">"optional"</span><span class="k">))</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">219</td><td class="hits">2</td><td class="source"> ret<span class="k">.</span>optional <span class="k">=</span> <span class="k">true</span><span class="k">;</span></td></tr><tr class="hit"> <td class="line">220</td><td class="hits">2</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr><td class="line">221</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr class="hit"> <td class="line">222</td><td class="hits">79</td><td class="source"> ret<span class="k">.</span>type <span class="k">=</span> type<span class="k">();</span></td></tr><tr class="hit"> <td class="line">223</td><td class="hits">87</td><td class="source"> <span class="k">if</span> <span class="k">(!</span>ret<span class="k">.</span>type<span class="k">)</span> <span class="k">return</span><span class="k">;</span></td></tr><tr class="hit"> <td class="line">224</td><td class="hits">71</td><td class="source"> <span class="k">if</span> <span class="k">(!</span>ret<span class="k">.</span>optional<span class="k">)</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">225</td><td class="hits">69</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">226</td><td class="hits">69</td><td class="source"> <span class="k">if</span> <span class="k">(</span>tokens<span class="k">.</span>length <span class="k">>=</span> <span class="s">3</span> <span class="k">&&</span></td></tr><tr><td class="line">227</td><td class="hits"></td><td class="source"> tokens<span class="k">[</span><span class="s">0</span><span class="k">].</span>type <span class="k">===</span> <span class="s">"other"</span> <span class="k">&&</span> tokens<span class="k">[</span><span class="s">0</span><span class="k">].</span>value <span class="k">===</span> <span class="s">"."</span> <span class="k">&&</span></td></tr><tr><td class="line">228</td><td class="hits"></td><td class="source"> tokens<span class="k">[</span><span class="s">1</span><span class="k">].</span>type <span class="k">===</span> <span class="s">"other"</span> <span class="k">&&</span> tokens<span class="k">[</span><span class="s">1</span><span class="k">].</span>value <span class="k">===</span> <span class="s">"."</span> <span class="k">&&</span></td></tr><tr><td class="line">229</td><td class="hits"></td><td class="source"> tokens<span class="k">[</span><span class="s">2</span><span class="k">].</span>type <span class="k">===</span> <span class="s">"other"</span> <span class="k">&&</span> tokens<span class="k">[</span><span class="s">2</span><span class="k">].</span>value <span class="k">===</span> <span class="s">"."</span></td></tr><tr><td class="line">230</td><td class="hits"></td><td class="source"> <span class="k">)</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">231</td><td class="hits">4</td><td class="source"> tokens<span class="k">.</span>shift<span class="k">();</span></td></tr><tr class="hit"> <td class="line">232</td><td class="hits">4</td><td class="source"> tokens<span class="k">.</span>shift<span class="k">();</span></td></tr><tr class="hit"> <td class="line">233</td><td class="hits">4</td><td class="source"> tokens<span class="k">.</span>shift<span class="k">();</span></td></tr><tr class="hit"> <td class="line">234</td><td class="hits">4</td><td class="source"> ret<span class="k">.</span>variadic <span class="k">=</span> <span class="k">true</span><span class="k">;</span></td></tr><tr><td class="line">235</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr><td class="line">236</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr class="hit"> <td class="line">237</td><td class="hits">71</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">238</td><td class="hits">71</td><td class="source"> <span class="k">var</span> name <span class="k">=</span> consume<span class="k">(</span>ID<span class="k">)</span> <span class="k">||</span> error<span class="k">(</span><span class="s">"No name in argument"</span><span class="k">);</span></td></tr><tr class="hit"> <td class="line">239</td><td class="hits">71</td><td class="source"> ret<span class="k">.</span>name <span class="k">=</span> name<span class="k">.</span>value<span class="k">;</span></td></tr><tr class="hit"> <td class="line">240</td><td class="hits">71</td><td class="source"> <span class="k">if</span> <span class="k">(</span>ret<span class="k">.</span>optional<span class="k">)</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">241</td><td class="hits">2</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">242</td><td class="hits">2</td><td class="source"> ret<span class="k">[</span><span class="s">"default"</span><span class="k">]</span> <span class="k">=</span> default_<span class="k">();</span></td></tr><tr><td class="line">243</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr class="hit"> <td class="line">244</td><td class="hits">71</td><td class="source"> <span class="k">return</span> ret<span class="k">;</span></td></tr><tr><td class="line">245</td><td class="hits"></td><td class="source"> <span class="k">}</span><span class="k">;</span></td></tr><tr><td class="line">246</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"> <td class="line">247</td><td class="hits">47</td><td class="source"> <span class="k">var</span> argument_list <span class="k">=</span> <span class="k">function</span> <span class="k">()</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">248</td><td class="hits">59</td><td class="source"> <span class="k">var</span> arg <span class="k">=</span> argument<span class="k">(),</span> ret <span class="k">=</span> <span class="k">[];</span></td></tr><tr class="hit"> <td class="line">249</td><td class="hits">67</td><td class="source"> <span class="k">if</span> <span class="k">(!</span>arg<span class="k">)</span> <span class="k">return</span> ret<span class="k">;</span></td></tr><tr class="hit"> <td class="line">250</td><td class="hits">51</td><td class="source"> ret<span class="k">.</span>push<span class="k">(</span>arg<span class="k">);</span></td></tr><tr class="hit"> <td class="line">251</td><td class="hits">51</td><td class="source"> <span class="k">while</span> <span class="k">(</span><span class="k">true</span><span class="k">)</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">252</td><td class="hits">71</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">253</td><td class="hits">122</td><td class="source"> <span class="k">if</span> <span class="k">(!</span>consume<span class="k">(</span>OTHER<span class="k">,</span> <span class="s">","</span><span class="k">))</span> <span class="k">return</span> ret<span class="k">;</span></td></tr><tr class="hit"> <td class="line">254</td><td class="hits">20</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">255</td><td class="hits">20</td><td class="source"> <span class="k">var</span> nxt <span class="k">=</span> argument<span class="k">()</span> <span class="k">||</span> error<span class="k">(</span><span class="s">"Trailing comma in arguments list"</span><span class="k">);</span></td></tr><tr class="hit"> <td class="line">256</td><td class="hits">20</td><td class="source"> ret<span class="k">.</span>push<span class="k">(</span>nxt<span class="k">);</span></td></tr><tr><td class="line">257</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr><td class="line">258</td><td class="hits"></td><td class="source"> <span class="k">}</span><span class="k">;</span></td></tr><tr><td class="line">259</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"> <td class="line">260</td><td class="hits">47</td><td class="source"> <span class="k">var</span> simple_extended_attr <span class="k">=</span> <span class="k">function</span> <span class="k">()</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">261</td><td class="hits">17</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">262</td><td class="hits">17</td><td class="source"> <span class="k">var</span> name <span class="k">=</span> consume<span class="k">(</span>ID<span class="k">);</span></td></tr><tr class="hit"> <td class="line">263</td><td class="hits">17</td><td class="source"> <span class="k">if</span> <span class="k">(!</span>name<span class="k">)</span> <span class="k">return</span><span class="k">;</span></td></tr><tr class="hit"> <td class="line">264</td><td class="hits">17</td><td class="source"> <span class="k">var</span> ret <span class="k">=</span> <span class="k">{</span></td></tr><tr><td class="line">265</td><td class="hits"></td><td class="source"> name<span class="k">:</span> name<span class="k">.</span>value</td></tr><tr><td class="line">266</td><td class="hits"></td><td class="source"> <span class="k">,</span> <span class="s">"arguments"</span><span class="k">:</span> <span class="k">null</span></td></tr><tr><td class="line">267</td><td class="hits"></td><td class="source"> <span class="k">}</span><span class="k">;</span></td></tr><tr class="hit"> <td class="line">268</td><td class="hits">17</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">269</td><td class="hits">17</td><td class="source"> <span class="k">var</span> eq <span class="k">=</span> consume<span class="k">(</span>OTHER<span class="k">,</span> <span class="s">"="</span><span class="k">);</span></td></tr><tr class="hit"> <td class="line">270</td><td class="hits">17</td><td class="source"> <span class="k">if</span> <span class="k">(</span>eq<span class="k">)</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">271</td><td class="hits">5</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">272</td><td class="hits">5</td><td class="source"> ret<span class="k">.</span>rhs <span class="k">=</span> consume<span class="k">(</span>ID<span class="k">);</span></td></tr><tr class="hit"> <td class="line">273</td><td class="hits">5</td><td class="source"> <span class="k">if</span> <span class="k">(!</span>ret<span class="k">.</span>rhs<span class="k">)</span> <span class="k">return</span> error<span class="k">(</span><span class="s">"No right hand side to extended attribute assignment"</span><span class="k">);</span></td></tr><tr><td class="line">274</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr class="hit"> <td class="line">275</td><td class="hits">17</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">276</td><td class="hits">17</td><td class="source"> <span class="k">if</span> <span class="k">(</span>consume<span class="k">(</span>OTHER<span class="k">,</span> <span class="s">"("</span><span class="k">))</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">277</td><td class="hits">2</td><td class="source"> ret<span class="k">[</span><span class="s">"arguments"</span><span class="k">]</span> <span class="k">=</span> argument_list<span class="k">();</span></td></tr><tr class="hit"> <td class="line">278</td><td class="hits">2</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">279</td><td class="hits">2</td><td class="source"> consume<span class="k">(</span>OTHER<span class="k">,</span> <span class="s">")"</span><span class="k">)</span> <span class="k">||</span> error<span class="k">(</span><span class="s">"Unclosed argument in extended attribute"</span><span class="k">);</span></td></tr><tr><td class="line">280</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr class="hit"> <td class="line">281</td><td class="hits">17</td><td class="source"> <span class="k">return</span> ret<span class="k">;</span></td></tr><tr><td class="line">282</td><td class="hits"></td><td class="source"> <span class="k">}</span><span class="k">;</span></td></tr><tr><td class="line">283</td><td class="hits"></td><td class="source"> </td></tr><tr><td class="line">284</td><td class="hits"></td><td class="source"> <span class="c">// Note: we parse something simpler than the official syntax. It's all that ever</span></td></tr><tr><td class="line">285</td><td class="hits"></td><td class="source"> <span class="c">// seems to be used</span></td></tr><tr class="hit"> <td class="line">286</td><td class="hits">47</td><td class="source"> <span class="k">var</span> extended_attrs <span class="k">=</span> <span class="k">function</span> <span class="k">()</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">287</td><td class="hits">415</td><td class="source"> <span class="k">var</span> eas <span class="k">=</span> <span class="k">[];</span></td></tr><tr class="hit"> <td class="line">288</td><td class="hits">415</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">289</td><td class="hits">815</td><td class="source"> <span class="k">if</span> <span class="k">(!</span>consume<span class="k">(</span>OTHER<span class="k">,</span> <span class="s">"["</span><span class="k">))</span> <span class="k">return</span> eas<span class="k">;</span></td></tr><tr class="hit"> <td class="line">290</td><td class="hits">15</td><td class="source"> eas<span class="k">[</span><span class="s">0</span><span class="k">]</span> <span class="k">=</span> simple_extended_attr<span class="k">()</span> <span class="k">||</span> error<span class="k">(</span><span class="s">"Extended attribute with not content"</span><span class="k">);</span></td></tr><tr class="hit"> <td class="line">291</td><td class="hits">15</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">292</td><td class="hits">15</td><td class="source"> <span class="k">while</span> <span class="k">(</span>consume<span class="k">(</span>OTHER<span class="k">,</span> <span class="s">","</span><span class="k">))</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">293</td><td class="hits">2</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">294</td><td class="hits">2</td><td class="source"> eas<span class="k">.</span>push<span class="k">(</span>simple_extended_attr<span class="k">()</span> <span class="k">||</span> error<span class="k">(</span><span class="s">"Trailing comma in extended attribute"</span><span class="k">));</span></td></tr><tr class="hit"> <td class="line">295</td><td class="hits">2</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr><td class="line">296</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr class="hit"> <td class="line">297</td><td class="hits">15</td><td class="source"> consume<span class="k">(</span>OTHER<span class="k">,</span> <span class="s">"]"</span><span class="k">)</span> <span class="k">||</span> error<span class="k">(</span><span class="s">"No end of extended attribute"</span><span class="k">);</span></td></tr><tr class="hit"> <td class="line">298</td><td class="hits">15</td><td class="source"> <span class="k">return</span> eas<span class="k">;</span></td></tr><tr><td class="line">299</td><td class="hits"></td><td class="source"> <span class="k">}</span><span class="k">;</span></td></tr><tr><td class="line">300</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"> <td class="line">301</td><td class="hits">47</td><td class="source"> <span class="k">var</span> default_ <span class="k">=</span> <span class="k">function</span> <span class="k">()</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">302</td><td class="hits">11</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">303</td><td class="hits">11</td><td class="source"> <span class="k">if</span> <span class="k">(</span>consume<span class="k">(</span>OTHER<span class="k">,</span> <span class="s">"="</span><span class="k">))</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">304</td><td class="hits">5</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">305</td><td class="hits">5</td><td class="source"> <span class="k">var</span> def <span class="k">=</span> const_value<span class="k">();</span></td></tr><tr class="hit"> <td class="line">306</td><td class="hits">5</td><td class="source"> <span class="k">if</span> <span class="k">(</span><span class="k">typeof</span> def <span class="k">!==</span> <span class="s">"undefined"</span><span class="k">)</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">307</td><td class="hits">3</td><td class="source"> <span class="k">return</span> def<span class="k">;</span></td></tr><tr><td class="line">308</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr><td class="line">309</td><td class="hits"></td><td class="source"> <span class="k">else</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">310</td><td class="hits">2</td><td class="source"> <span class="k">var</span> str <span class="k">=</span> consume<span class="k">(</span>STR<span class="k">)</span> <span class="k">||</span> error<span class="k">(</span><span class="s">"No value for default"</span><span class="k">);</span></td></tr><tr class="hit"> <td class="line">311</td><td class="hits">2</td><td class="source"> <span class="k">return</span> str<span class="k">;</span></td></tr><tr><td class="line">312</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr><td class="line">313</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr><td class="line">314</td><td class="hits"></td><td class="source"> <span class="k">}</span><span class="k">;</span></td></tr><tr><td class="line">315</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"> <td class="line">316</td><td class="hits">47</td><td class="source"> <span class="k">var</span> const_ <span class="k">=</span> <span class="k">function</span> <span class="k">()</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">317</td><td class="hits">180</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">318</td><td class="hits">348</td><td class="source"> <span class="k">if</span> <span class="k">(!</span>consume<span class="k">(</span>ID<span class="k">,</span> <span class="s">"const"</span><span class="k">))</span> <span class="k">return</span><span class="k">;</span></td></tr><tr class="hit"> <td class="line">319</td><td class="hits">12</td><td class="source"> <span class="k">var</span> ret <span class="k">=</span> <span class="k">{</span> type<span class="k">:</span> <span class="s">"const"</span><span class="k">,</span> nullable<span class="k">:</span> <span class="k">false</span> <span class="k">}</span><span class="k">;</span></td></tr><tr class="hit"> <td class="line">320</td><td class="hits">12</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">321</td><td class="hits">12</td><td class="source"> <span class="k">var</span> typ <span class="k">=</span> primitive_type<span class="k">();</span></td></tr><tr class="hit"> <td class="line">322</td><td class="hits">12</td><td class="source"> <span class="k">if</span> <span class="k">(!</span>typ<span class="k">)</span> <span class="k">{</span></td></tr><tr class="miss"> <td class="line">323</td><td class="hits">0</td><td class="source"> typ <span class="k">=</span> consume<span class="k">(</span>ID<span class="k">)</span> <span class="k">||</span> error<span class="k">(</span><span class="s">"No type for const"</span><span class="k">);</span></td></tr><tr class="miss"> <td class="line">324</td><td class="hits">0</td><td class="source"> typ <span class="k">=</span> typ<span class="k">.</span>value<span class="k">;</span></td></tr><tr><td class="line">325</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr class="hit"> <td class="line">326</td><td class="hits">12</td><td class="source"> ret<span class="k">.</span>idlType <span class="k">=</span> typ<span class="k">;</span></td></tr><tr class="hit"> <td class="line">327</td><td class="hits">12</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">328</td><td class="hits">12</td><td class="source"> <span class="k">if</span> <span class="k">(</span>consume<span class="k">(</span>OTHER<span class="k">,</span> <span class="s">"?"</span><span class="k">))</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">329</td><td class="hits">1</td><td class="source"> ret<span class="k">.</span>nullable <span class="k">=</span> <span class="k">true</span><span class="k">;</span></td></tr><tr class="hit"> <td class="line">330</td><td class="hits">1</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr><td class="line">331</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr class="hit"> <td class="line">332</td><td class="hits">12</td><td class="source"> <span class="k">var</span> name <span class="k">=</span> consume<span class="k">(</span>ID<span class="k">)</span> <span class="k">||</span> error<span class="k">(</span><span class="s">"No name for const"</span><span class="k">);</span></td></tr><tr class="hit"> <td class="line">333</td><td class="hits">12</td><td class="source"> ret<span class="k">.</span>name <span class="k">=</span> name<span class="k">.</span>value<span class="k">;</span></td></tr><tr class="hit"> <td class="line">334</td><td class="hits">12</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">335</td><td class="hits">12</td><td class="source"> consume<span class="k">(</span>OTHER<span class="k">,</span> <span class="s">"="</span><span class="k">)</span> <span class="k">||</span> error<span class="k">(</span><span class="s">"No value assignment for const"</span><span class="k">);</span></td></tr><tr class="hit"> <td class="line">336</td><td class="hits">12</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">337</td><td class="hits">12</td><td class="source"> <span class="k">var</span> cnt <span class="k">=</span> const_value<span class="k">();</span></td></tr><tr class="hit"> <td class="line">338</td><td class="hits">24</td><td class="source"> <span class="k">if</span> <span class="k">(</span><span class="k">typeof</span> cnt <span class="k">!==</span> <span class="s">"undefined"</span><span class="k">)</span> ret<span class="k">.</span>value <span class="k">=</span> cnt<span class="k">;</span></td></tr><tr class="miss"> <td class="line">339</td><td class="hits">0</td><td class="source"> <span class="k">else</span> error<span class="k">(</span><span class="s">"No value for const"</span><span class="k">);</span></td></tr><tr class="hit"> <td class="line">340</td><td class="hits">12</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">341</td><td class="hits">12</td><td class="source"> consume<span class="k">(</span>OTHER<span class="k">,</span> <span class="s">";"</span><span class="k">)</span> <span class="k">||</span> error<span class="k">(</span><span class="s">"Unterminated const"</span><span class="k">);</span></td></tr><tr class="hit"> <td class="line">342</td><td class="hits">12</td><td class="source"> <span class="k">return</span> ret<span class="k">;</span></td></tr><tr><td class="line">343</td><td class="hits"></td><td class="source"> <span class="k">}</span><span class="k">;</span></td></tr><tr><td class="line">344</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"> <td class="line">345</td><td class="hits">47</td><td class="source"> <span class="k">var</span> inheritance <span class="k">=</span> <span class="k">function</span> <span class="k">()</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">346</td><td class="hits">89</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">347</td><td class="hits">89</td><td class="source"> <span class="k">if</span> <span class="k">(</span>consume<span class="k">(</span>OTHER<span class="k">,</span> <span class="s">":"</span><span class="k">))</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">348</td><td class="hits">9</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">349</td><td class="hits">9</td><td class="source"> <span class="k">var</span> inh <span class="k">=</span> consume<span class="k">(</span>ID<span class="k">)</span> <span class="k">||</span> error <span class="k">(</span><span class="s">"No type in inheritance"</span><span class="k">);</span></td></tr><tr class="hit"> <td class="line">350</td><td class="hits">9</td><td class="source"> <span class="k">return</span> inh<span class="k">.</span>value<span class="k">;</span></td></tr><tr><td class="line">351</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr><td class="line">352</td><td class="hits"></td><td class="source"> <span class="k">}</span><span class="k">;</span></td></tr><tr><td class="line">353</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"> <td class="line">354</td><td class="hits">47</td><td class="source"> <span class="k">var</span> operation_rest <span class="k">=</span> <span class="k">function</span> <span class="k">(</span>ret<span class="k">)</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">355</td><td class="hits">56</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">356</td><td class="hits">57</td><td class="source"> <span class="k">if</span> <span class="k">(!</span>ret<span class="k">)</span> ret <span class="k">=</span> <span class="k">{}</span><span class="k">;</span></td></tr><tr class="hit"> <td class="line">357</td><td class="hits">56</td><td class="source"> <span class="k">var</span> name <span class="k">=</span> consume<span class="k">(</span>ID<span class="k">);</span></td></tr><tr class="hit"> <td class="line">358</td><td class="hits">56</td><td class="source"> ret<span class="k">.</span>name <span class="k">=</span> name <span class="k">?</span> name<span class="k">.</span>value <span class="k">:</span> <span class="k">null</span><span class="k">;</span></td></tr><tr class="hit"> <td class="line">359</td><td class="hits">56</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">360</td><td class="hits">56</td><td class="source"> consume<span class="k">(</span>OTHER<span class="k">,</span> <span class="s">"("</span><span class="k">)</span> <span class="k">||</span> error<span class="k">(</span><span class="s">"Invalid operation"</span><span class="k">);</span></td></tr><tr class="hit"> <td class="line">361</td><td class="hits">56</td><td class="source"> ret<span class="k">[</span><span class="s">"arguments"</span><span class="k">]</span> <span class="k">=</span> argument_list<span class="k">();</span></td></tr><tr class="hit"> <td class="line">362</td><td class="hits">56</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">363</td><td class="hits">56</td><td class="source"> consume<span class="k">(</span>OTHER<span class="k">,</span> <span class="s">")"</span><span class="k">)</span> <span class="k">||</span> error<span class="k">(</span><span class="s">"Unterminated operation"</span><span class="k">);</span></td></tr><tr class="hit"> <td class="line">364</td><td class="hits">56</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">365</td><td class="hits">56</td><td class="source"> consume<span class="k">(</span>OTHER<span class="k">,</span> <span class="s">";"</span><span class="k">)</span> <span class="k">||</span> error<span class="k">(</span><span class="s">"Unterminated operation"</span><span class="k">);</span></td></tr><tr class="hit"> <td class="line">366</td><td class="hits">56</td><td class="source"> <span class="k">return</span> ret<span class="k">;</span></td></tr><tr><td class="line">367</td><td class="hits"></td><td class="source"> <span class="k">}</span><span class="k">;</span></td></tr><tr><td class="line">368</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"> <td class="line">369</td><td class="hits">47</td><td class="source"> <span class="k">var</span> callback <span class="k">=</span> <span class="k">function</span> <span class="k">()</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">370</td><td class="hits">144</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">371</td><td class="hits">144</td><td class="source"> <span class="k">var</span> ret<span class="k">;</span></td></tr><tr class="hit"> <td class="line">372</td><td class="hits">286</td><td class="source"> <span class="k">if</span> <span class="k">(!</span>consume<span class="k">(</span>ID<span class="k">,</span> <span class="s">"callback"</span><span class="k">))</span> <span class="k">return</span><span class="k">;</span></td></tr><tr class="hit"> <td class="line">373</td><td class="hits">2</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">374</td><td class="hits">2</td><td class="source"> <span class="k">var</span> tok <span class="k">=</span> consume<span class="k">(</span>ID<span class="k">,</span> <span class="s">"interface"</span><span class="k">);</span></td></tr><tr class="hit"> <td class="line">375</td><td class="hits">2</td><td class="source"> <span class="k">if</span> <span class="k">(</span>tok<span class="k">)</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">376</td><td class="hits">1</td><td class="source"> tokens<span class="k">.</span>unshift<span class="k">(</span>tok<span class="k">);</span></td></tr><tr class="hit"> <td class="line">377</td><td class="hits">1</td><td class="source"> ret <span class="k">=</span> interface_<span class="k">();</span></td></tr><tr class="hit"> <td class="line">378</td><td class="hits">1</td><td class="source"> ret<span class="k">.</span>type <span class="k">=</span> <span class="s">"callback interface"</span><span class="k">;</span></td></tr><tr class="hit"> <td class="line">379</td><td class="hits">1</td><td class="source"> <span class="k">return</span> ret<span class="k">;</span></td></tr><tr><td class="line">380</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr class="hit"> <td class="line">381</td><td class="hits">1</td><td class="source"> <span class="k">var</span> name <span class="k">=</span> consume<span class="k">(</span>ID<span class="k">)</span> <span class="k">||</span> error<span class="k">(</span><span class="s">"No name for callback"</span><span class="k">);</span></td></tr><tr class="hit"> <td class="line">382</td><td class="hits">1</td><td class="source"> ret <span class="k">=</span> <span class="k">{</span> type<span class="k">:</span> <span class="s">"callback"</span><span class="k">,</span> name<span class="k">:</span> name<span class="k">.</span>value <span class="k">}</span><span class="k">;</span></td></tr><tr class="hit"> <td class="line">383</td><td class="hits">1</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">384</td><td class="hits">1</td><td class="source"> consume<span class="k">(</span>OTHER<span class="k">,</span> <span class="s">"="</span><span class="k">)</span> <span class="k">||</span> error<span class="k">(</span><span class="s">"No assignment in callback"</span><span class="k">);</span></td></tr><tr class="hit"> <td class="line">385</td><td class="hits">1</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">386</td><td class="hits">1</td><td class="source"> ret<span class="k">.</span>idlType <span class="k">=</span> return_type<span class="k">();</span></td></tr><tr class="hit"> <td class="line">387</td><td class="hits">1</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">388</td><td class="hits">1</td><td class="source"> consume<span class="k">(</span>OTHER<span class="k">,</span> <span class="s">"("</span><span class="k">)</span> <span class="k">||</span> error<span class="k">(</span><span class="s">"No arguments in callback"</span><span class="k">);</span></td></tr><tr class="hit"> <td class="line">389</td><td class="hits">1</td><td class="source"> ret<span class="k">[</span><span class="s">"arguments"</span><span class="k">]</span> <span class="k">=</span> argument_list<span class="k">();</span></td></tr><tr class="hit"> <td class="line">390</td><td class="hits">1</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">391</td><td class="hits">1</td><td class="source"> consume<span class="k">(</span>OTHER<span class="k">,</span> <span class="s">")"</span><span class="k">)</span> <span class="k">||</span> error<span class="k">(</span><span class="s">"Unterminated callback"</span><span class="k">);</span></td></tr><tr class="hit"> <td class="line">392</td><td class="hits">1</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">393</td><td class="hits">1</td><td class="source"> consume<span class="k">(</span>OTHER<span class="k">,</span> <span class="s">";"</span><span class="k">)</span> <span class="k">||</span> error<span class="k">(</span><span class="s">"Unterminated callback"</span><span class="k">);</span></td></tr><tr class="hit"> <td class="line">394</td><td class="hits">1</td><td class="source"> <span class="k">return</span> ret<span class="k">;</span></td></tr><tr><td class="line">395</td><td class="hits"></td><td class="source"> <span class="k">}</span><span class="k">;</span></td></tr><tr><td class="line">396</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"> <td class="line">397</td><td class="hits">47</td><td class="source"> <span class="k">var</span> attribute <span class="k">=</span> <span class="k">function</span> <span class="k">()</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">398</td><td class="hits">154</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">399</td><td class="hits">154</td><td class="source"> <span class="k">var</span> grabbed <span class="k">=</span> <span class="k">[]</span></td></tr><tr><td class="line">400</td><td class="hits"></td><td class="source"> <span class="k">,</span> ret <span class="k">=</span> <span class="k">{</span></td></tr><tr><td class="line">401</td><td class="hits"></td><td class="source"> type<span class="k">:</span> <span class="s">"attribute"</span></td></tr><tr><td class="line">402</td><td class="hits"></td><td class="source"> <span class="k">,</span> <span class="s">"static"</span><span class="k">:</span> <span class="k">false</span></td></tr><tr><td class="line">403</td><td class="hits"></td><td class="source"> <span class="k">,</span> stringifier<span class="k">:</span> <span class="k">false</span></td></tr><tr><td class="line">404</td><td class="hits"></td><td class="source"> <span class="k">,</span> inherit<span class="k">:</span> <span class="k">false</span></td></tr><tr><td class="line">405</td><td class="hits"></td><td class="source"> <span class="k">,</span> readonly<span class="k">:</span> <span class="k">false</span></td></tr><tr><td class="line">406</td><td class="hits"></td><td class="source"> <span class="k">}</span><span class="k">;</span></td></tr><tr class="hit"> <td class="line">407</td><td class="hits">154</td><td class="source"> <span class="k">if</span> <span class="k">(</span>consume<span class="k">(</span>ID<span class="k">,</span> <span class="s">"static"</span><span class="k">))</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">408</td><td class="hits">2</td><td class="source"> ret<span class="k">[</span><span class="s">"static"</span><span class="k">]</span> <span class="k">=</span> <span class="k">true</span><span class="k">;</span></td></tr><tr class="hit"> <td class="line">409</td><td class="hits">2</td><td class="source"> grabbed<span class="k">.</span>push<span class="k">(</span>last_token<span class="k">);</span></td></tr><tr><td class="line">410</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr class="hit"> <td class="line">411</td><td class="hits">152</td><td class="source"> <span class="k">else</span> <span class="k">if</span> <span class="k">(</span>consume<span class="k">(</span>ID<span class="k">,</span> <span class="s">"stringifier"</span><span class="k">))</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">412</td><td class="hits">4</td><td class="source"> ret<span class="k">.</span>stringifier <span class="k">=</span> <span class="k">true</span><span class="k">;</span></td></tr><tr class="hit"> <td class="line">413</td><td class="hits">4</td><td class="source"> grabbed<span class="k">.</span>push<span class="k">(</span>last_token<span class="k">);</span></td></tr><tr><td class="line">414</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr class="hit"> <td class="line">415</td><td class="hits">154</td><td class="source"> <span class="k">var</span> w <span class="k">=</span> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">416</td><td class="hits">159</td><td class="source"> <span class="k">if</span> <span class="k">(</span>w<span class="k">)</span> grabbed<span class="k">.</span>push<span class="k">(</span>w<span class="k">);</span></td></tr><tr class="hit"> <td class="line">417</td><td class="hits">154</td><td class="source"> <span class="k">if</span> <span class="k">(</span>consume<span class="k">(</span>ID<span class="k">,</span> <span class="s">"inherit"</span><span class="k">))</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">418</td><td class="hits">1</td><td class="source"> <span class="k">if</span> <span class="k">(</span>ret<span class="k">[</span><span class="s">"static"</span><span class="k">]</span> <span class="k">||</span> ret<span class="k">.</span>stringifier<span class="k">)</span> error<span class="k">(</span><span class="s">"Cannot have a static or stringifier inherit"</span><span class="k">);</span></td></tr><tr class="hit"> <td class="line">419</td><td class="hits">1</td><td class="source"> ret<span class="k">.</span>inherit <span class="k">=</span> <span class="k">true</span><span class="k">;</span></td></tr><tr class="hit"> <td class="line">420</td><td class="hits">1</td><td class="source"> grabbed<span class="k">.</span>push<span class="k">(</span>last_token<span class="k">);</span></td></tr><tr class="hit"> <td class="line">421</td><td class="hits">1</td><td class="source"> <span class="k">var</span> w <span class="k">=</span> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">422</td><td class="hits">2</td><td class="source"> <span class="k">if</span> <span class="k">(</span>w<span class="k">)</span> grabbed<span class="k">.</span>push<span class="k">(</span>w<span class="k">);</span></td></tr><tr><td class="line">423</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr class="hit"> <td class="line">424</td><td class="hits">154</td><td class="source"> <span class="k">if</span> <span class="k">(</span>consume<span class="k">(</span>ID<span class="k">,</span> <span class="s">"readonly"</span><span class="k">))</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">425</td><td class="hits">32</td><td class="source"> ret<span class="k">.</span>readonly <span class="k">=</span> <span class="k">true</span><span class="k">;</span></td></tr><tr class="hit"> <td class="line">426</td><td class="hits">32</td><td class="source"> grabbed<span class="k">.</span>push<span class="k">(</span>last_token<span class="k">);</span></td></tr><tr class="hit"> <td class="line">427</td><td class="hits">32</td><td class="source"> <span class="k">var</span> w <span class="k">=</span> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">428</td><td class="hits">64</td><td class="source"> <span class="k">if</span> <span class="k">(</span>w<span class="k">)</span> grabbed<span class="k">.</span>push<span class="k">(</span>w<span class="k">);</span></td></tr><tr><td class="line">429</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr class="hit"> <td class="line">430</td><td class="hits">154</td><td class="source"> <span class="k">if</span> <span class="k">(!</span>consume<span class="k">(</span>ID<span class="k">,</span> <span class="s">"attribute"</span><span class="k">))</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">431</td><td class="hits">60</td><td class="source"> tokens <span class="k">=</span> grabbed<span class="k">.</span>concat<span class="k">(</span>tokens<span class="k">);</span></td></tr><tr class="hit"> <td class="line">432</td><td class="hits">60</td><td class="source"> <span class="k">return</span><span class="k">;</span></td></tr><tr><td class="line">433</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr class="hit"> <td class="line">434</td><td class="hits">94</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">435</td><td class="hits">94</td><td class="source"> ret<span class="k">.</span>idlType <span class="k">=</span> type<span class="k">()</span> <span class="k">||</span> error<span class="k">(</span><span class="s">"No type in attribute"</span><span class="k">);</span></td></tr><tr class="hit"> <td class="line">436</td><td class="hits">94</td><td class="source"> <span class="k">if</span> <span class="k">(</span>ret<span class="k">.</span>idlType<span class="k">.</span>sequence<span class="k">)</span> error<span class="k">(</span><span class="s">"Attributes cannot accept sequence types"</span><span class="k">);</span></td></tr><tr class="hit"> <td class="line">437</td><td class="hits">94</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">438</td><td class="hits">94</td><td class="source"> <span class="k">var</span> name <span class="k">=</span> consume<span class="k">(</span>ID<span class="k">)</span> <span class="k">||</span> error<span class="k">(</span><span class="s">"No name in attribute"</span><span class="k">);</span></td></tr><tr class="hit"> <td class="line">439</td><td class="hits">94</td><td class="source"> ret<span class="k">.</span>name <span class="k">=</span> name<span class="k">.</span>value<span class="k">;</span></td></tr><tr class="hit"> <td class="line">440</td><td class="hits">94</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">441</td><td class="hits">94</td><td class="source"> consume<span class="k">(</span>OTHER<span class="k">,</span> <span class="s">";"</span><span class="k">)</span> <span class="k">||</span> error<span class="k">(</span><span class="s">"Unterminated attribute"</span><span class="k">);</span></td></tr><tr class="hit"> <td class="line">442</td><td class="hits">94</td><td class="source"> <span class="k">return</span> ret<span class="k">;</span></td></tr><tr><td class="line">443</td><td class="hits"></td><td class="source"> <span class="k">}</span><span class="k">;</span></td></tr><tr><td class="line">444</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"> <td class="line">445</td><td class="hits">47</td><td class="source"> <span class="k">var</span> return_type <span class="k">=</span> <span class="k">function</span> <span class="k">()</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">446</td><td class="hits">61</td><td class="source"> <span class="k">var</span> typ <span class="k">=</span> type<span class="k">();</span></td></tr><tr class="hit"> <td class="line">447</td><td class="hits">61</td><td class="source"> <span class="k">if</span> <span class="k">(!</span>typ<span class="k">)</span> <span class="k">{</span></td></tr><tr class="miss"> <td class="line">448</td><td class="hits">0</td><td class="source"> <span class="k">if</span> <span class="k">(</span>consume<span class="k">(</span>ID<span class="k">,</span> <span class="s">"void"</span><span class="k">))</span> <span class="k">{</span></td></tr><tr class="miss"> <td class="line">449</td><td class="hits">0</td><td class="source"> <span class="k">return</span> <span class="s">"void"</span><span class="k">;</span></td></tr><tr><td class="line">450</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr class="miss"> <td class="line">451</td><td class="hits">0</td><td class="source"> <span class="k">else</span> error<span class="k">(</span><span class="s">"No return type"</span><span class="k">);</span></td></tr><tr><td class="line">452</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr class="hit"> <td class="line">453</td><td class="hits">61</td><td class="source"> <span class="k">return</span> typ<span class="k">;</span></td></tr><tr><td class="line">454</td><td class="hits"></td><td class="source"> <span class="k">}</span><span class="k">;</span></td></tr><tr><td class="line">455</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"> <td class="line">456</td><td class="hits">47</td><td class="source"> <span class="k">var</span> operation <span class="k">=</span> <span class="k">function</span> <span class="k">()</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">457</td><td class="hits">60</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">458</td><td class="hits">60</td><td class="source"> <span class="k">var</span> ret <span class="k">=</span> <span class="k">{</span></td></tr><tr><td class="line">459</td><td class="hits"></td><td class="source"> type<span class="k">:</span> <span class="s">"operation"</span></td></tr><tr><td class="line">460</td><td class="hits"></td><td class="source"> <span class="k">,</span> getter<span class="k">:</span> <span class="k">false</span></td></tr><tr><td class="line">461</td><td class="hits"></td><td class="source"> <span class="k">,</span> setter<span class="k">:</span> <span class="k">false</span></td></tr><tr><td class="line">462</td><td class="hits"></td><td class="source"> <span class="k">,</span> creator<span class="k">:</span> <span class="k">false</span></td></tr><tr><td class="line">463</td><td class="hits"></td><td class="source"> <span class="k">,</span> deleter<span class="k">:</span> <span class="k">false</span></td></tr><tr><td class="line">464</td><td class="hits"></td><td class="source"> <span class="k">,</span> legacycaller<span class="k">:</span> <span class="k">false</span></td></tr><tr><td class="line">465</td><td class="hits"></td><td class="source"> <span class="k">,</span> <span class="s">"static"</span><span class="k">:</span> <span class="k">false</span></td></tr><tr><td class="line">466</td><td class="hits"></td><td class="source"> <span class="k">,</span> stringifier<span class="k">:</span> <span class="k">false</span></td></tr><tr><td class="line">467</td><td class="hits"></td><td class="source"> <span class="k">}</span><span class="k">;</span></td></tr><tr class="hit"> <td class="line">468</td><td class="hits">60</td><td class="source"> <span class="k">while</span> <span class="k">(</span><span class="k">true</span><span class="k">)</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">469</td><td class="hits">78</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">470</td><td class="hits">87</td><td class="source"> <span class="k">if</span> <span class="k">(</span>consume<span class="k">(</span>ID<span class="k">,</span> <span class="s">"getter"</span><span class="k">))</span> ret<span class="k">.</span>getter <span class="k">=</span> <span class="k">true</span><span class="k">;</span></td></tr><tr class="hit"> <td class="line">471</td><td class="hits">74</td><td class="source"> <span class="k">else</span> <span class="k">if</span> <span class="k">(</span>consume<span class="k">(</span>ID<span class="k">,</span> <span class="s">"setter"</span><span class="k">))</span> ret<span class="k">.</span>setter <span class="k">=</span> <span class="k">true</span><span class="k">;</span></td></tr><tr class="hit"> <td class="line">472</td><td class="hits">65</td><td class="source"> <span class="k">else</span> <span class="k">if</span> <span class="k">(</span>consume<span class="k">(</span>ID<span class="k">,</span> <span class="s">"creator"</span><span class="k">))</span> ret<span class="k">.</span>creator <span class="k">=</span> <span class="k">true</span><span class="k">;</span></td></tr><tr class="hit"> <td class="line">473</td><td class="hits">65</td><td class="source"> <span class="k">else</span> <span class="k">if</span> <span class="k">(</span>consume<span class="k">(</span>ID<span class="k">,</span> <span class="s">"deleter"</span><span class="k">))</span> ret<span class="k">.</span>deleter <span class="k">=</span> <span class="k">true</span><span class="k">;</span></td></tr><tr class="hit"> <td class="line">474</td><td class="hits">62</td><td class="source"> <span class="k">else</span> <span class="k">if</span> <span class="k">(</span>consume<span class="k">(</span>ID<span class="k">,</span> <span class="s">"legacycaller"</span><span class="k">))</span> ret<span class="k">.</span>legacycaller <span class="k">=</span> <span class="k">true</span><span class="k">;</span></td></tr><tr class="hit"> <td class="line">475</td><td class="hits">60</td><td class="source"> <span class="k">else</span> <span class="k">break</span><span class="k">;</span></td></tr><tr><td class="line">476</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr class="hit"> <td class="line">477</td><td class="hits">60</td><td class="source"> <span class="k">if</span> <span class="k">(</span>ret<span class="k">.</span>getter <span class="k">||</span> ret<span class="k">.</span>setter <span class="k">||</span> ret<span class="k">.</span>creator <span class="k">||</span> ret<span class="k">.</span>deleter <span class="k">||</span> ret<span class="k">.</span>legacycaller<span class="k">)</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">478</td><td class="hits">17</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">479</td><td class="hits">17</td><td class="source"> ret<span class="k">.</span>idlType <span class="k">=</span> return_type<span class="k">();</span></td></tr><tr class="hit"> <td class="line">480</td><td class="hits">17</td><td class="source"> operation_rest<span class="k">(</span>ret<span class="k">);</span></td></tr><tr class="hit"> <td class="line">481</td><td class="hits">17</td><td class="source"> <span class="k">return</span> ret<span class="k">;</span></td></tr><tr><td class="line">482</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr class="hit"> <td class="line">483</td><td class="hits">43</td><td class="source"> <span class="k">if</span> <span class="k">(</span>consume<span class="k">(</span>ID<span class="k">,</span> <span class="s">"static"</span><span class="k">))</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">484</td><td class="hits">1</td><td class="source"> ret<span class="k">[</span><span class="s">"static"</span><span class="k">]</span> <span class="k">=</span> <span class="k">true</span><span class="k">;</span></td></tr><tr class="hit"> <td class="line">485</td><td class="hits">1</td><td class="source"> ret<span class="k">.</span>idlType <span class="k">=</span> return_type<span class="k">();</span></td></tr><tr class="hit"> <td class="line">486</td><td class="hits">1</td><td class="source"> operation_rest<span class="k">(</span>ret<span class="k">);</span></td></tr><tr class="hit"> <td class="line">487</td><td class="hits">1</td><td class="source"> <span class="k">return</span> ret<span class="k">;</span></td></tr><tr><td class="line">488</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr class="hit"> <td class="line">489</td><td class="hits">42</td><td class="source"> <span class="k">else</span> <span class="k">if</span> <span class="k">(</span>consume<span class="k">(</span>ID<span class="k">,</span> <span class="s">"stringifier"</span><span class="k">))</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">490</td><td class="hits">3</td><td class="source"> ret<span class="k">.</span>stringifier <span class="k">=</span> <span class="k">true</span><span class="k">;</span></td></tr><tr class="hit"> <td class="line">491</td><td class="hits">3</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">492</td><td class="hits">4</td><td class="source"> <span class="k">if</span> <span class="k">(</span>consume<span class="k">(</span>OTHER<span class="k">,</span> <span class="s">";"</span><span class="k">))</span> <span class="k">return</span> ret<span class="k">;</span></td></tr><tr class="hit"> <td class="line">493</td><td class="hits">2</td><td class="source"> ret<span class="k">.</span>idlType <span class="k">=</span> return_type<span class="k">();</span></td></tr><tr class="hit"> <td class="line">494</td><td class="hits">2</td><td class="source"> operation_rest<span class="k">(</span>ret<span class="k">);</span></td></tr><tr class="hit"> <td class="line">495</td><td class="hits">2</td><td class="source"> <span class="k">return</span> ret<span class="k">;</span></td></tr><tr><td class="line">496</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr class="hit"> <td class="line">497</td><td class="hits">39</td><td class="source"> ret<span class="k">.</span>idlType <span class="k">=</span> return_type<span class="k">();</span></td></tr><tr class="hit"> <td class="line">498</td><td class="hits">39</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">499</td><td class="hits">39</td><td class="source"> <span class="k">if</span> <span class="k">(</span>consume<span class="k">(</span>ID<span class="k">,</span> <span class="s">"iterator"</span><span class="k">))</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">500</td><td class="hits">4</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">501</td><td class="hits">4</td><td class="source"> ret<span class="k">.</span>type <span class="k">=</span> <span class="s">"iterator"</span><span class="k">;</span></td></tr><tr class="hit"> <td class="line">502</td><td class="hits">4</td><td class="source"> <span class="k">if</span> <span class="k">(</span>consume<span class="k">(</span>ID<span class="k">,</span> <span class="s">"object"</span><span class="k">))</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">503</td><td class="hits">1</td><td class="source"> ret<span class="k">.</span>iteratorObject <span class="k">=</span> <span class="s">"object"</span><span class="k">;</span></td></tr><tr><td class="line">504</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr class="hit"> <td class="line">505</td><td class="hits">3</td><td class="source"> <span class="k">else</span> <span class="k">if</span> <span class="k">(</span>consume<span class="k">(</span>OTHER<span class="k">,</span> <span class="s">"="</span><span class="k">))</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">506</td><td class="hits">2</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">507</td><td class="hits">2</td><td class="source"> <span class="k">var</span> name <span class="k">=</span> consume<span class="k">(</span>ID<span class="k">)</span> <span class="k">||</span> error<span class="k">(</span><span class="s">"No right hand side in iterator"</span><span class="k">);</span></td></tr><tr class="hit"> <td class="line">508</td><td class="hits">2</td><td class="source"> ret<span class="k">.</span>iteratorObject <span class="k">=</span> name<span class="k">.</span>value<span class="k">;</span></td></tr><tr><td class="line">509</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr class="hit"> <td class="line">510</td><td class="hits">4</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">511</td><td class="hits">4</td><td class="source"> consume<span class="k">(</span>OTHER<span class="k">,</span> <span class="s">";"</span><span class="k">)</span> <span class="k">||</span> error<span class="k">(</span><span class="s">"Unterminated iterator"</span><span class="k">);</span></td></tr><tr class="hit"> <td class="line">512</td><td class="hits">4</td><td class="source"> <span class="k">return</span> ret<span class="k">;</span></td></tr><tr><td class="line">513</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr><td class="line">514</td><td class="hits"></td><td class="source"> <span class="k">else</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">515</td><td class="hits">35</td><td class="source"> operation_rest<span class="k">(</span>ret<span class="k">);</span></td></tr><tr class="hit"> <td class="line">516</td><td class="hits">35</td><td class="source"> <span class="k">return</span> ret<span class="k">;</span></td></tr><tr><td class="line">517</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr><td class="line">518</td><td class="hits"></td><td class="source"> <span class="k">}</span><span class="k">;</span></td></tr><tr><td class="line">519</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"> <td class="line">520</td><td class="hits">47</td><td class="source"> <span class="k">var</span> identifiers <span class="k">=</span> <span class="k">function</span> <span class="k">(</span>arr<span class="k">)</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">521</td><td class="hits">5</td><td class="source"> <span class="k">while</span> <span class="k">(</span><span class="k">true</span><span class="k">)</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">522</td><td class="hits">11</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">523</td><td class="hits">11</td><td class="source"> <span class="k">if</span> <span class="k">(</span>consume<span class="k">(</span>OTHER<span class="k">,</span> <span class="s">","</span><span class="k">))</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">524</td><td class="hits">6</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">525</td><td class="hits">6</td><td class="source"> <span class="k">var</span> name <span class="k">=</span> consume<span class="k">(</span>ID<span class="k">)</span> <span class="k">||</span> error<span class="k">(</span><span class="s">"Trailing comma in identifiers list"</span><span class="k">);</span></td></tr><tr class="hit"> <td class="line">526</td><td class="hits">6</td><td class="source"> arr<span class="k">.</span>push<span class="k">(</span>name<span class="k">.</span>value<span class="k">);</span></td></tr><tr><td class="line">527</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr class="hit"> <td class="line">528</td><td class="hits">5</td><td class="source"> <span class="k">else</span> <span class="k">break</span><span class="k">;</span></td></tr><tr><td class="line">529</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr><td class="line">530</td><td class="hits"></td><td class="source"> <span class="k">}</span><span class="k">;</span></td></tr><tr><td class="line">531</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"> <td class="line">532</td><td class="hits">47</td><td class="source"> <span class="k">var</span> serialiser <span class="k">=</span> <span class="k">function</span> <span class="k">()</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">533</td><td class="hits">164</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">534</td><td class="hits">318</td><td class="source"> <span class="k">if</span> <span class="k">(!</span>consume<span class="k">(</span>ID<span class="k">,</span> <span class="s">"serializer"</span><span class="k">))</span> <span class="k">return</span><span class="k">;</span></td></tr><tr class="hit"> <td class="line">535</td><td class="hits">10</td><td class="source"> <span class="k">var</span> ret <span class="k">=</span> <span class="k">{</span> type<span class="k">:</span> <span class="s">"serializer"</span> <span class="k">}</span><span class="k">;</span></td></tr><tr class="hit"> <td class="line">536</td><td class="hits">10</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">537</td><td class="hits">10</td><td class="source"> <span class="k">if</span> <span class="k">(</span>consume<span class="k">(</span>OTHER<span class="k">,</span> <span class="s">"="</span><span class="k">))</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">538</td><td class="hits">8</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">539</td><td class="hits">8</td><td class="source"> <span class="k">if</span> <span class="k">(</span>consume<span class="k">(</span>OTHER<span class="k">,</span> <span class="s">"{"</span><span class="k">))</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">540</td><td class="hits">5</td><td class="source"> ret<span class="k">.</span>patternMap <span class="k">=</span> <span class="k">true</span><span class="k">;</span></td></tr><tr class="hit"> <td class="line">541</td><td class="hits">5</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">542</td><td class="hits">5</td><td class="source"> <span class="k">var</span> id <span class="k">=</span> consume<span class="k">(</span>ID<span class="k">);</span></td></tr><tr class="hit"> <td class="line">543</td><td class="hits">5</td><td class="source"> <span class="k">if</span> <span class="k">(</span>id <span class="k">&&</span> id<span class="k">.</span>value <span class="k">===</span> <span class="s">"getter"</span><span class="k">)</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">544</td><td class="hits">1</td><td class="source"> ret<span class="k">.</span>names <span class="k">=</span> <span class="k">[</span><span class="s">"getter"</span><span class="k">];</span></td></tr><tr><td class="line">545</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr class="hit"> <td class="line">546</td><td class="hits">4</td><td class="source"> <span class="k">else</span> <span class="k">if</span> <span class="k">(</span>id <span class="k">&&</span> id<span class="k">.</span>value <span class="k">===</span> <span class="s">"inherit"</span><span class="k">)</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">547</td><td class="hits">2</td><td class="source"> ret<span class="k">.</span>names <span class="k">=</span> <span class="k">[</span><span class="s">"inherit"</span><span class="k">];</span></td></tr><tr class="hit"> <td class="line">548</td><td class="hits">2</td><td class="source"> identifiers<span class="k">(</span>ret<span class="k">.</span>names<span class="k">);</span></td></tr><tr><td class="line">549</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr class="hit"> <td class="line">550</td><td class="hits">2</td><td class="source"> <span class="k">else</span> <span class="k">if</span> <span class="k">(</span>id<span class="k">)</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">551</td><td class="hits">2</td><td class="source"> ret<span class="k">.</span>names <span class="k">=</span> <span class="k">[</span>id<span class="k">.</span>value<span class="k">];</span></td></tr><tr class="hit"> <td class="line">552</td><td class="hits">2</td><td class="source"> identifiers<span class="k">(</span>ret<span class="k">.</span>names<span class="k">);</span></td></tr><tr><td class="line">553</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr><td class="line">554</td><td class="hits"></td><td class="source"> <span class="k">else</span> <span class="k">{</span></td></tr><tr class="miss"> <td class="line">555</td><td class="hits">0</td><td class="source"> ret<span class="k">.</span>names <span class="k">=</span> <span class="k">[];</span></td></tr><tr><td class="line">556</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr class="hit"> <td class="line">557</td><td class="hits">5</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">558</td><td class="hits">5</td><td class="source"> consume<span class="k">(</span>OTHER<span class="k">,</span> <span class="s">"}"</span><span class="k">)</span> <span class="k">||</span> error<span class="k">(</span><span class="s">"Unterminated serializer pattern map"</span><span class="k">);</span></td></tr><tr><td class="line">559</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr class="hit"> <td class="line">560</td><td class="hits">3</td><td class="source"> <span class="k">else</span> <span class="k">if</span> <span class="k">(</span>consume<span class="k">(</span>OTHER<span class="k">,</span> <span class="s">"["</span><span class="k">))</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">561</td><td class="hits">2</td><td class="source"> ret<span class="k">.</span>patternList <span class="k">=</span> <span class="k">true</span><span class="k">;</span></td></tr><tr class="hit"> <td class="line">562</td><td class="hits">2</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">563</td><td class="hits">2</td><td class="source"> <span class="k">var</span> id <span class="k">=</span> consume<span class="k">(</span>ID<span class="k">);</span></td></tr><tr class="hit"> <td class="line">564</td><td class="hits">2</td><td class="source"> <span class="k">if</span> <span class="k">(</span>id <span class="k">&&</span> id<span class="k">.</span>value <span class="k">===</span> <span class="s">"getter"</span><span class="k">)</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">565</td><td class="hits">1</td><td class="source"> ret<span class="k">.</span>names <span class="k">=</span> <span class="k">[</span><span class="s">"getter"</span><span class="k">];</span></td></tr><tr><td class="line">566</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr class="hit"> <td class="line">567</td><td class="hits">1</td><td class="source"> <span class="k">else</span> <span class="k">if</span> <span class="k">(</span>id<span class="k">)</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">568</td><td class="hits">1</td><td class="source"> ret<span class="k">.</span>names <span class="k">=</span> <span class="k">[</span>id<span class="k">.</span>value<span class="k">];</span></td></tr><tr class="hit"> <td class="line">569</td><td class="hits">1</td><td class="source"> identifiers<span class="k">(</span>ret<span class="k">.</span>names<span class="k">);</span></td></tr><tr><td class="line">570</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr><td class="line">571</td><td class="hits"></td><td class="source"> <span class="k">else</span> <span class="k">{</span></td></tr><tr class="miss"> <td class="line">572</td><td class="hits">0</td><td class="source"> ret<span class="k">.</span>names <span class="k">=</span> <span class="k">[];</span></td></tr><tr><td class="line">573</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr class="hit"> <td class="line">574</td><td class="hits">2</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">575</td><td class="hits">2</td><td class="source"> consume<span class="k">(</span>OTHER<span class="k">,</span> <span class="s">"]"</span><span class="k">)</span> <span class="k">||</span> error<span class="k">(</span><span class="s">"Unterminated serializer pattern list"</span><span class="k">);</span></td></tr><tr><td class="line">576</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr><td class="line">577</td><td class="hits"></td><td class="source"> <span class="k">else</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">578</td><td class="hits">1</td><td class="source"> <span class="k">var</span> name <span class="k">=</span> consume<span class="k">(</span>ID<span class="k">)</span> <span class="k">||</span> error<span class="k">(</span><span class="s">"Invalid serializer"</span><span class="k">);</span></td></tr><tr class="hit"> <td class="line">579</td><td class="hits">1</td><td class="source"> ret<span class="k">.</span>name <span class="k">=</span> name<span class="k">.</span>value<span class="k">;</span></td></tr><tr><td class="line">580</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr class="hit"> <td class="line">581</td><td class="hits">8</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">582</td><td class="hits">8</td><td class="source"> consume<span class="k">(</span>OTHER<span class="k">,</span> <span class="s">";"</span><span class="k">)</span> <span class="k">||</span> error<span class="k">(</span><span class="s">"Unterminated serializer"</span><span class="k">);</span></td></tr><tr class="hit"> <td class="line">583</td><td class="hits">8</td><td class="source"> <span class="k">return</span> ret<span class="k">;</span></td></tr><tr><td class="line">584</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr class="hit"> <td class="line">585</td><td class="hits">2</td><td class="source"> <span class="k">else</span> <span class="k">if</span> <span class="k">(</span>consume<span class="k">(</span>OTHER<span class="k">,</span> <span class="s">";"</span><span class="k">))</span> <span class="k">{</span></td></tr><tr><td class="line">586</td><td class="hits"></td><td class="source"> <span class="c">// noop, just parsing</span></td></tr><tr><td class="line">587</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr><td class="line">588</td><td class="hits"></td><td class="source"> <span class="k">else</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">589</td><td class="hits">1</td><td class="source"> ret<span class="k">.</span>idlType <span class="k">=</span> return_type<span class="k">();</span></td></tr><tr class="hit"> <td class="line">590</td><td class="hits">1</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">591</td><td class="hits">1</td><td class="source"> ret<span class="k">.</span>operation <span class="k">=</span> operation_rest<span class="k">();</span></td></tr><tr><td class="line">592</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr class="hit"> <td class="line">593</td><td class="hits">2</td><td class="source"> <span class="k">return</span> ret<span class="k">;</span></td></tr><tr><td class="line">594</td><td class="hits"></td><td class="source"> <span class="k">}</span><span class="k">;</span></td></tr><tr><td class="line">595</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"> <td class="line">596</td><td class="hits">47</td><td class="source"> <span class="k">var</span> interface_ <span class="k">=</span> <span class="k">function</span> <span class="k">(</span>isPartial<span class="k">)</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">597</td><td class="hits">144</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">598</td><td class="hits">210</td><td class="source"> <span class="k">if</span> <span class="k">(!</span>consume<span class="k">(</span>ID<span class="k">,</span> <span class="s">"interface"</span><span class="k">))</span> <span class="k">return</span><span class="k">;</span></td></tr><tr class="hit"> <td class="line">599</td><td class="hits">78</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">600</td><td class="hits">78</td><td class="source"> <span class="k">var</span> name <span class="k">=</span> consume<span class="k">(</span>ID<span class="k">)</span> <span class="k">||</span> error<span class="k">(</span><span class="s">"No name for interface"</span><span class="k">);</span></td></tr><tr class="hit"> <td class="line">601</td><td class="hits">78</td><td class="source"> <span class="k">var</span> ret <span class="k">=</span> <span class="k">{</span></td></tr><tr><td class="line">602</td><td class="hits"></td><td class="source"> type<span class="k">:</span> <span class="s">"interface"</span></td></tr><tr><td class="line">603</td><td class="hits"></td><td class="source"> <span class="k">,</span> name<span class="k">:</span> name<span class="k">.</span>value</td></tr><tr><td class="line">604</td><td class="hits"></td><td class="source"> <span class="k">,</span> partial<span class="k">:</span> <span class="k">false</span></td></tr><tr><td class="line">605</td><td class="hits"></td><td class="source"> <span class="k">,</span> members<span class="k">:</span> <span class="k">[]</span></td></tr><tr><td class="line">606</td><td class="hits"></td><td class="source"> <span class="k">}</span><span class="k">;</span></td></tr><tr class="hit"> <td class="line">607</td><td class="hits">155</td><td class="source"> <span class="k">if</span> <span class="k">(!</span>isPartial<span class="k">)</span> ret<span class="k">.</span>inheritance <span class="k">=</span> inheritance<span class="k">()</span> <span class="k">||</span> <span class="k">null</span><span class="k">;</span></td></tr><tr class="hit"> <td class="line">608</td><td class="hits">78</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">609</td><td class="hits">78</td><td class="source"> consume<span class="k">(</span>OTHER<span class="k">,</span> <span class="s">"{"</span><span class="k">)</span> <span class="k">||</span> error<span class="k">(</span><span class="s">"Bodyless interface"</span><span class="k">);</span></td></tr><tr class="hit"> <td class="line">610</td><td class="hits">78</td><td class="source"> <span class="k">while</span> <span class="k">(</span><span class="k">true</span><span class="k">)</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">611</td><td class="hits">251</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">612</td><td class="hits">251</td><td class="source"> <span class="k">if</span> <span class="k">(</span>consume<span class="k">(</span>OTHER<span class="k">,</span> <span class="s">"}"</span><span class="k">))</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">613</td><td class="hits">78</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">614</td><td class="hits">78</td><td class="source"> consume<span class="k">(</span>OTHER<span class="k">,</span> <span class="s">";"</span><span class="k">)</span> <span class="k">||</span> error<span class="k">(</span><span class="s">"Missing semicolon after interface"</span><span class="k">);</span></td></tr><tr class="hit"> <td class="line">615</td><td class="hits">78</td><td class="source"> <span class="k">return</span> ret<span class="k">;</span></td></tr><tr><td class="line">616</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr class="hit"> <td class="line">617</td><td class="hits">173</td><td class="source"> <span class="k">var</span> ea <span class="k">=</span> extended_attrs<span class="k">();</span></td></tr><tr class="hit"> <td class="line">618</td><td class="hits">173</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">619</td><td class="hits">173</td><td class="source"> <span class="k">var</span> cnt <span class="k">=</span> const_<span class="k">();</span></td></tr><tr class="hit"> <td class="line">620</td><td class="hits">173</td><td class="source"> <span class="k">if</span> <span class="k">(</span>cnt<span class="k">)</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">621</td><td class="hits">9</td><td class="source"> cnt<span class="k">.</span>extAttrs <span class="k">=</span> ea<span class="k">;</span></td></tr><tr class="hit"> <td class="line">622</td><td class="hits">9</td><td class="source"> ret<span class="k">.</span>members<span class="k">.</span>push<span class="k">(</span>cnt<span class="k">);</span></td></tr><tr class="hit"> <td class="line">623</td><td class="hits">9</td><td class="source"> <span class="k">continue</span><span class="k">;</span></td></tr><tr><td class="line">624</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr class="hit"> <td class="line">625</td><td class="hits">164</td><td class="source"> <span class="k">var</span> mem <span class="k">=</span> serialiser<span class="k">()</span> <span class="k">||</span> attribute<span class="k">()</span> <span class="k">||</span> operation<span class="k">()</span> <span class="k">||</span> error<span class="k">(</span><span class="s">"Unknown member"</span><span class="k">);</span></td></tr><tr class="hit"> <td class="line">626</td><td class="hits">164</td><td class="source"> mem<span class="k">.</span>extAttrs <span class="k">=</span> ea<span class="k">;</span></td></tr><tr class="hit"> <td class="line">627</td><td class="hits">164</td><td class="source"> ret<span class="k">.</span>members<span class="k">.</span>push<span class="k">(</span>mem<span class="k">);</span></td></tr><tr><td class="line">628</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr><td class="line">629</td><td class="hits"></td><td class="source"> <span class="k">}</span><span class="k">;</span></td></tr><tr><td class="line">630</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"> <td class="line">631</td><td class="hits">47</td><td class="source"> <span class="k">var</span> partial <span class="k">=</span> <span class="k">function</span> <span class="k">()</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">632</td><td class="hits">66</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">633</td><td class="hits">130</td><td class="source"> <span class="k">if</span> <span class="k">(!</span>consume<span class="k">(</span>ID<span class="k">,</span> <span class="s">"partial"</span><span class="k">))</span> <span class="k">return</span><span class="k">;</span></td></tr><tr class="hit"> <td class="line">634</td><td class="hits">2</td><td class="source"> <span class="k">var</span> thing <span class="k">=</span> dictionary<span class="k">(</span><span class="k">true</span><span class="k">)</span> <span class="k">||</span> interface_<span class="k">(</span><span class="k">true</span><span class="k">)</span> <span class="k">||</span> error<span class="k">(</span><span class="s">"Partial doesn't apply to anything"</span><span class="k">);</span></td></tr><tr class="hit"> <td class="line">635</td><td class="hits">2</td><td class="source"> thing<span class="k">.</span>partial <span class="k">=</span> <span class="k">true</span><span class="k">;</span></td></tr><tr class="hit"> <td class="line">636</td><td class="hits">2</td><td class="source"> <span class="k">return</span> thing<span class="k">;</span></td></tr><tr><td class="line">637</td><td class="hits"></td><td class="source"> <span class="k">}</span><span class="k">;</span></td></tr><tr><td class="line">638</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"> <td class="line">639</td><td class="hits">47</td><td class="source"> <span class="k">var</span> dictionary <span class="k">=</span> <span class="k">function</span> <span class="k">(</span>isPartial<span class="k">)</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">640</td><td class="hits">66</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">641</td><td class="hits">128</td><td class="source"> <span class="k">if</span> <span class="k">(!</span>consume<span class="k">(</span>ID<span class="k">,</span> <span class="s">"dictionary"</span><span class="k">))</span> <span class="k">return</span><span class="k">;</span></td></tr><tr class="hit"> <td class="line">642</td><td class="hits">4</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">643</td><td class="hits">4</td><td class="source"> <span class="k">var</span> name <span class="k">=</span> consume<span class="k">(</span>ID<span class="k">)</span> <span class="k">||</span> error<span class="k">(</span><span class="s">"No name for dictionary"</span><span class="k">);</span></td></tr><tr class="hit"> <td class="line">644</td><td class="hits">4</td><td class="source"> <span class="k">var</span> ret <span class="k">=</span> <span class="k">{</span></td></tr><tr><td class="line">645</td><td class="hits"></td><td class="source"> type<span class="k">:</span> <span class="s">"dictionary"</span></td></tr><tr><td class="line">646</td><td class="hits"></td><td class="source"> <span class="k">,</span> name<span class="k">:</span> name<span class="k">.</span>value</td></tr><tr><td class="line">647</td><td class="hits"></td><td class="source"> <span class="k">,</span> partial<span class="k">:</span> <span class="k">false</span></td></tr><tr><td class="line">648</td><td class="hits"></td><td class="source"> <span class="k">,</span> members<span class="k">:</span> <span class="k">[]</span></td></tr><tr><td class="line">649</td><td class="hits"></td><td class="source"> <span class="k">}</span><span class="k">;</span></td></tr><tr class="hit"> <td class="line">650</td><td class="hits">7</td><td class="source"> <span class="k">if</span> <span class="k">(!</span>isPartial<span class="k">)</span> ret<span class="k">.</span>inheritance <span class="k">=</span> inheritance<span class="k">()</span> <span class="k">||</span> <span class="k">null</span><span class="k">;</span></td></tr><tr class="hit"> <td class="line">651</td><td class="hits">4</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">652</td><td class="hits">4</td><td class="source"> consume<span class="k">(</span>OTHER<span class="k">,</span> <span class="s">"{"</span><span class="k">)</span> <span class="k">||</span> error<span class="k">(</span><span class="s">"Bodyless dictionary"</span><span class="k">);</span></td></tr><tr class="hit"> <td class="line">653</td><td class="hits">4</td><td class="source"> <span class="k">while</span> <span class="k">(</span><span class="k">true</span><span class="k">)</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">654</td><td class="hits">13</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">655</td><td class="hits">13</td><td class="source"> <span class="k">if</span> <span class="k">(</span>consume<span class="k">(</span>OTHER<span class="k">,</span> <span class="s">"}"</span><span class="k">))</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">656</td><td class="hits">4</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">657</td><td class="hits">4</td><td class="source"> consume<span class="k">(</span>OTHER<span class="k">,</span> <span class="s">";"</span><span class="k">)</span> <span class="k">||</span> error<span class="k">(</span><span class="s">"Missing semicolon after dictionary"</span><span class="k">);</span></td></tr><tr class="hit"> <td class="line">658</td><td class="hits">4</td><td class="source"> <span class="k">return</span> ret<span class="k">;</span></td></tr><tr><td class="line">659</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr class="hit"> <td class="line">660</td><td class="hits">9</td><td class="source"> <span class="k">var</span> ea <span class="k">=</span> extended_attrs<span class="k">();</span></td></tr><tr class="hit"> <td class="line">661</td><td class="hits">9</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">662</td><td class="hits">9</td><td class="source"> <span class="k">var</span> typ <span class="k">=</span> type<span class="k">()</span> <span class="k">||</span> error<span class="k">(</span><span class="s">"No type for dictionary member"</span><span class="k">);</span></td></tr><tr class="hit"> <td class="line">663</td><td class="hits">9</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">664</td><td class="hits">9</td><td class="source"> <span class="k">var</span> name <span class="k">=</span> consume<span class="k">(</span>ID<span class="k">)</span> <span class="k">||</span> error<span class="k">(</span><span class="s">"No name for dictionary member"</span><span class="k">);</span></td></tr><tr class="hit"> <td class="line">665</td><td class="hits">9</td><td class="source"> ret<span class="k">.</span>members<span class="k">.</span>push<span class="k">(</span><span class="k">{</span></td></tr><tr><td class="line">666</td><td class="hits"></td><td class="source"> type<span class="k">:</span> <span class="s">"field"</span></td></tr><tr><td class="line">667</td><td class="hits"></td><td class="source"> <span class="k">,</span> name<span class="k">:</span> name<span class="k">.</span>value</td></tr><tr><td class="line">668</td><td class="hits"></td><td class="source"> <span class="k">,</span> idlType<span class="k">:</span> typ</td></tr><tr><td class="line">669</td><td class="hits"></td><td class="source"> <span class="k">,</span> extAttrs<span class="k">:</span> ea</td></tr><tr><td class="line">670</td><td class="hits"></td><td class="source"> <span class="k">,</span> <span class="s">"default"</span><span class="k">:</span> default_<span class="k">()</span></td></tr><tr><td class="line">671</td><td class="hits"></td><td class="source"> <span class="k">}</span><span class="k">);</span></td></tr><tr class="hit"> <td class="line">672</td><td class="hits">9</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">673</td><td class="hits">9</td><td class="source"> consume<span class="k">(</span>OTHER<span class="k">,</span> <span class="s">";"</span><span class="k">)</span> <span class="k">||</span> error<span class="k">(</span><span class="s">"Unterminated dictionary member"</span><span class="k">);</span></td></tr><tr><td class="line">674</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr><td class="line">675</td><td class="hits"></td><td class="source"> <span class="k">}</span><span class="k">;</span></td></tr><tr><td class="line">676</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"> <td class="line">677</td><td class="hits">47</td><td class="source"> <span class="k">var</span> exception <span class="k">=</span> <span class="k">function</span> <span class="k">()</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">678</td><td class="hits">61</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">679</td><td class="hits">113</td><td class="source"> <span class="k">if</span> <span class="k">(!</span>consume<span class="k">(</span>ID<span class="k">,</span> <span class="s">"exception"</span><span class="k">))</span> <span class="k">return</span><span class="k">;</span></td></tr><tr class="hit"> <td class="line">680</td><td class="hits">9</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">681</td><td class="hits">9</td><td class="source"> <span class="k">var</span> name <span class="k">=</span> consume<span class="k">(</span>ID<span class="k">)</span> <span class="k">||</span> error<span class="k">(</span><span class="s">"No name for exception"</span><span class="k">);</span></td></tr><tr class="hit"> <td class="line">682</td><td class="hits">9</td><td class="source"> <span class="k">var</span> ret <span class="k">=</span> <span class="k">{</span></td></tr><tr><td class="line">683</td><td class="hits"></td><td class="source"> type<span class="k">:</span> <span class="s">"exception"</span></td></tr><tr><td class="line">684</td><td class="hits"></td><td class="source"> <span class="k">,</span> name<span class="k">:</span> name<span class="k">.</span>value</td></tr><tr><td class="line">685</td><td class="hits"></td><td class="source"> <span class="k">,</span> members<span class="k">:</span> <span class="k">[]</span></td></tr><tr><td class="line">686</td><td class="hits"></td><td class="source"> <span class="k">}</span><span class="k">;</span></td></tr><tr class="hit"> <td class="line">687</td><td class="hits">9</td><td class="source"> ret<span class="k">.</span>inheritance <span class="k">=</span> inheritance<span class="k">()</span> <span class="k">||</span> <span class="k">null</span><span class="k">;</span></td></tr><tr class="hit"> <td class="line">688</td><td class="hits">9</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">689</td><td class="hits">9</td><td class="source"> consume<span class="k">(</span>OTHER<span class="k">,</span> <span class="s">"{"</span><span class="k">)</span> <span class="k">||</span> error<span class="k">(</span><span class="s">"Bodyless exception"</span><span class="k">);</span></td></tr><tr class="hit"> <td class="line">690</td><td class="hits">9</td><td class="source"> <span class="k">while</span> <span class="k">(</span><span class="k">true</span><span class="k">)</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">691</td><td class="hits">16</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">692</td><td class="hits">16</td><td class="source"> <span class="k">if</span> <span class="k">(</span>consume<span class="k">(</span>OTHER<span class="k">,</span> <span class="s">"}"</span><span class="k">))</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">693</td><td class="hits">9</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">694</td><td class="hits">9</td><td class="source"> consume<span class="k">(</span>OTHER<span class="k">,</span> <span class="s">";"</span><span class="k">)</span> <span class="k">||</span> error<span class="k">(</span><span class="s">"Missing semicolon after exception"</span><span class="k">);</span></td></tr><tr class="hit"> <td class="line">695</td><td class="hits">9</td><td class="source"> <span class="k">return</span> ret<span class="k">;</span></td></tr><tr><td class="line">696</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr class="hit"> <td class="line">697</td><td class="hits">7</td><td class="source"> <span class="k">var</span> ea <span class="k">=</span> extended_attrs<span class="k">();</span></td></tr><tr class="hit"> <td class="line">698</td><td class="hits">7</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">699</td><td class="hits">7</td><td class="source"> <span class="k">var</span> cnt <span class="k">=</span> const_<span class="k">();</span></td></tr><tr class="hit"> <td class="line">700</td><td class="hits">7</td><td class="source"> <span class="k">if</span> <span class="k">(</span>cnt<span class="k">)</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">701</td><td class="hits">3</td><td class="source"> cnt<span class="k">.</span>extAttrs <span class="k">=</span> ea<span class="k">;</span></td></tr><tr class="hit"> <td class="line">702</td><td class="hits">3</td><td class="source"> ret<span class="k">.</span>members<span class="k">.</span>push<span class="k">(</span>cnt<span class="k">);</span></td></tr><tr><td class="line">703</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr><td class="line">704</td><td class="hits"></td><td class="source"> <span class="k">else</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">705</td><td class="hits">4</td><td class="source"> <span class="k">var</span> typ <span class="k">=</span> type<span class="k">();</span></td></tr><tr class="hit"> <td class="line">706</td><td class="hits">4</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">707</td><td class="hits">4</td><td class="source"> <span class="k">var</span> name <span class="k">=</span> consume<span class="k">(</span>ID<span class="k">);</span></td></tr><tr class="hit"> <td class="line">708</td><td class="hits">4</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">709</td><td class="hits">4</td><td class="source"> <span class="k">if</span> <span class="k">(!</span>typ <span class="k">||</span> <span class="k">!</span>name <span class="k">||</span> <span class="k">!</span>consume<span class="k">(</span>OTHER<span class="k">,</span> <span class="s">";"</span><span class="k">))</span> error<span class="k">(</span><span class="s">"Unknown member in exception body"</span><span class="k">);</span></td></tr><tr class="hit"> <td class="line">710</td><td class="hits">4</td><td class="source"> ret<span class="k">.</span>members<span class="k">.</span>push<span class="k">(</span><span class="k">{</span></td></tr><tr><td class="line">711</td><td class="hits"></td><td class="source"> type<span class="k">:</span> <span class="s">"field"</span></td></tr><tr><td class="line">712</td><td class="hits"></td><td class="source"> <span class="k">,</span> name<span class="k">:</span> name<span class="k">.</span>value</td></tr><tr><td class="line">713</td><td class="hits"></td><td class="source"> <span class="k">,</span> idlType<span class="k">:</span> typ</td></tr><tr><td class="line">714</td><td class="hits"></td><td class="source"> <span class="k">,</span> extAttrs<span class="k">:</span> ea</td></tr><tr><td class="line">715</td><td class="hits"></td><td class="source"> <span class="k">}</span><span class="k">);</span></td></tr><tr><td class="line">716</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr><td class="line">717</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr><td class="line">718</td><td class="hits"></td><td class="source"> <span class="k">}</span><span class="k">;</span></td></tr><tr><td class="line">719</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"> <td class="line">720</td><td class="hits">47</td><td class="source"> <span class="k">var</span> enum_ <span class="k">=</span> <span class="k">function</span> <span class="k">()</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">721</td><td class="hits">52</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">722</td><td class="hits">103</td><td class="source"> <span class="k">if</span> <span class="k">(!</span>consume<span class="k">(</span>ID<span class="k">,</span> <span class="s">"enum"</span><span class="k">))</span> <span class="k">return</span><span class="k">;</span></td></tr><tr class="hit"> <td class="line">723</td><td class="hits">1</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">724</td><td class="hits">1</td><td class="source"> <span class="k">var</span> name <span class="k">=</span> consume<span class="k">(</span>ID<span class="k">)</span> <span class="k">||</span> error<span class="k">(</span><span class="s">"No name for enum"</span><span class="k">);</span></td></tr><tr class="hit"> <td class="line">725</td><td class="hits">1</td><td class="source"> <span class="k">var</span> ret <span class="k">=</span> <span class="k">{</span></td></tr><tr><td class="line">726</td><td class="hits"></td><td class="source"> type<span class="k">:</span> <span class="s">"enum"</span></td></tr><tr><td class="line">727</td><td class="hits"></td><td class="source"> <span class="k">,</span> name<span class="k">:</span> name<span class="k">.</span>value</td></tr><tr><td class="line">728</td><td class="hits"></td><td class="source"> <span class="k">,</span> values<span class="k">:</span> <span class="k">[]</span></td></tr><tr><td class="line">729</td><td class="hits"></td><td class="source"> <span class="k">}</span><span class="k">;</span></td></tr><tr class="hit"> <td class="line">730</td><td class="hits">1</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">731</td><td class="hits">1</td><td class="source"> consume<span class="k">(</span>OTHER<span class="k">,</span> <span class="s">"{"</span><span class="k">)</span> <span class="k">||</span> error<span class="k">(</span><span class="s">"No curly for enum"</span><span class="k">);</span></td></tr><tr class="hit"> <td class="line">732</td><td class="hits">1</td><td class="source"> <span class="k">var</span> saw_comma <span class="k">=</span> <span class="k">false</span><span class="k">;</span></td></tr><tr class="hit"> <td class="line">733</td><td class="hits">1</td><td class="source"> <span class="k">while</span> <span class="k">(</span><span class="k">true</span><span class="k">)</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">734</td><td class="hits">4</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">735</td><td class="hits">4</td><td class="source"> <span class="k">if</span> <span class="k">(</span>consume<span class="k">(</span>OTHER<span class="k">,</span> <span class="s">"}"</span><span class="k">))</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">736</td><td class="hits">1</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">737</td><td class="hits">1</td><td class="source"> <span class="k">if</span> <span class="k">(</span>saw_comma<span class="k">)</span> error<span class="k">(</span><span class="s">"Trailing comma in enum"</span><span class="k">);</span></td></tr><tr class="hit"> <td class="line">738</td><td class="hits">1</td><td class="source"> consume<span class="k">(</span>OTHER<span class="k">,</span> <span class="s">";"</span><span class="k">)</span> <span class="k">||</span> error<span class="k">(</span><span class="s">"No semicolon after enum"</span><span class="k">);</span></td></tr><tr class="hit"> <td class="line">739</td><td class="hits">1</td><td class="source"> <span class="k">return</span> ret<span class="k">;</span></td></tr><tr><td class="line">740</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr class="hit"> <td class="line">741</td><td class="hits">3</td><td class="source"> <span class="k">var</span> val <span class="k">=</span> consume<span class="k">(</span>STR<span class="k">)</span> <span class="k">||</span> error<span class="k">(</span><span class="s">"Unexpected value in enum"</span><span class="k">);</span></td></tr><tr class="hit"> <td class="line">742</td><td class="hits">3</td><td class="source"> ret<span class="k">.</span>values<span class="k">.</span>push<span class="k">(</span>val<span class="k">.</span>value<span class="k">.</span>replace<span class="k">(</span><span class="s">/"/g</span><span class="k">,</span> <span class="s">""</span><span class="k">));</span></td></tr><tr class="hit"> <td class="line">743</td><td class="hits">3</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">744</td><td class="hits">3</td><td class="source"> <span class="k">if</span> <span class="k">(</span>consume<span class="k">(</span>OTHER<span class="k">,</span> <span class="s">","</span><span class="k">))</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">745</td><td class="hits">2</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">746</td><td class="hits">2</td><td class="source"> saw_comma <span class="k">=</span> <span class="k">true</span><span class="k">;</span></td></tr><tr><td class="line">747</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr><td class="line">748</td><td class="hits"></td><td class="source"> <span class="k">else</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">749</td><td class="hits">1</td><td class="source"> saw_comma <span class="k">=</span> <span class="k">false</span><span class="k">;</span></td></tr><tr><td class="line">750</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr><td class="line">751</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr><td class="line">752</td><td class="hits"></td><td class="source"> <span class="k">}</span><span class="k">;</span></td></tr><tr><td class="line">753</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"> <td class="line">754</td><td class="hits">47</td><td class="source"> <span class="k">var</span> typedef <span class="k">=</span> <span class="k">function</span> <span class="k">()</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">755</td><td class="hits">51</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">756</td><td class="hits">99</td><td class="source"> <span class="k">if</span> <span class="k">(!</span>consume<span class="k">(</span>ID<span class="k">,</span> <span class="s">"typedef"</span><span class="k">))</span> <span class="k">return</span><span class="k">;</span></td></tr><tr class="hit"> <td class="line">757</td><td class="hits">3</td><td class="source"> <span class="k">var</span> ret <span class="k">=</span> <span class="k">{</span></td></tr><tr><td class="line">758</td><td class="hits"></td><td class="source"> type<span class="k">:</span> <span class="s">"typedef"</span></td></tr><tr><td class="line">759</td><td class="hits"></td><td class="source"> <span class="k">}</span><span class="k">;</span></td></tr><tr class="hit"> <td class="line">760</td><td class="hits">3</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">761</td><td class="hits">3</td><td class="source"> ret<span class="k">.</span>extAttrs <span class="k">=</span> extended_attrs<span class="k">();</span></td></tr><tr class="hit"> <td class="line">762</td><td class="hits">3</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">763</td><td class="hits">3</td><td class="source"> ret<span class="k">.</span>idlType <span class="k">=</span> type<span class="k">()</span> <span class="k">||</span> error<span class="k">(</span><span class="s">"No type in typedef"</span><span class="k">);</span></td></tr><tr class="hit"> <td class="line">764</td><td class="hits">3</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">765</td><td class="hits">3</td><td class="source"> <span class="k">var</span> name <span class="k">=</span> consume<span class="k">(</span>ID<span class="k">)</span> <span class="k">||</span> error<span class="k">(</span><span class="s">"No name in typedef"</span><span class="k">);</span></td></tr><tr class="hit"> <td class="line">766</td><td class="hits">3</td><td class="source"> ret<span class="k">.</span>name <span class="k">=</span> name<span class="k">.</span>value<span class="k">;</span></td></tr><tr class="hit"> <td class="line">767</td><td class="hits">3</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">768</td><td class="hits">3</td><td class="source"> consume<span class="k">(</span>OTHER<span class="k">,</span> <span class="s">";"</span><span class="k">)</span> <span class="k">||</span> error<span class="k">(</span><span class="s">"Unterminated typedef"</span><span class="k">);</span></td></tr><tr class="hit"> <td class="line">769</td><td class="hits">3</td><td class="source"> <span class="k">return</span> ret<span class="k">;</span></td></tr><tr><td class="line">770</td><td class="hits"></td><td class="source"> <span class="k">}</span><span class="k">;</span></td></tr><tr><td class="line">771</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"> <td class="line">772</td><td class="hits">47</td><td class="source"> <span class="k">var</span> implements_ <span class="k">=</span> <span class="k">function</span> <span class="k">()</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">773</td><td class="hits">48</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">774</td><td class="hits">48</td><td class="source"> <span class="k">var</span> target <span class="k">=</span> consume<span class="k">(</span>ID<span class="k">);</span></td></tr><tr class="hit"> <td class="line">775</td><td class="hits">95</td><td class="source"> <span class="k">if</span> <span class="k">(!</span>target<span class="k">)</span> <span class="k">return</span><span class="k">;</span></td></tr><tr class="hit"> <td class="line">776</td><td class="hits">1</td><td class="source"> <span class="k">var</span> w <span class="k">=</span> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">777</td><td class="hits">1</td><td class="source"> <span class="k">if</span> <span class="k">(</span>consume<span class="k">(</span>ID<span class="k">,</span> <span class="s">"implements"</span><span class="k">))</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">778</td><td class="hits">1</td><td class="source"> <span class="k">var</span> ret <span class="k">=</span> <span class="k">{</span></td></tr><tr><td class="line">779</td><td class="hits"></td><td class="source"> type<span class="k">:</span> <span class="s">"implements"</span></td></tr><tr><td class="line">780</td><td class="hits"></td><td class="source"> <span class="k">,</span> target<span class="k">:</span> target<span class="k">.</span>value</td></tr><tr><td class="line">781</td><td class="hits"></td><td class="source"> <span class="k">}</span><span class="k">;</span></td></tr><tr class="hit"> <td class="line">782</td><td class="hits">1</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">783</td><td class="hits">1</td><td class="source"> <span class="k">var</span> imp <span class="k">=</span> consume<span class="k">(</span>ID<span class="k">)</span> <span class="k">||</span> error<span class="k">(</span><span class="s">"Incomplete implements statement"</span><span class="k">);</span></td></tr><tr class="hit"> <td class="line">784</td><td class="hits">1</td><td class="source"> ret<span class="k">[</span><span class="s">"implements"</span><span class="k">]</span> <span class="k">=</span> imp<span class="k">.</span>value<span class="k">;</span></td></tr><tr class="hit"> <td class="line">785</td><td class="hits">1</td><td class="source"> all_ws<span class="k">();</span></td></tr><tr class="hit"> <td class="line">786</td><td class="hits">1</td><td class="source"> consume<span class="k">(</span>OTHER<span class="k">,</span> <span class="s">";"</span><span class="k">)</span> <span class="k">||</span> error<span class="k">(</span><span class="s">"No terminating ; for implements statement"</span><span class="k">);</span></td></tr><tr class="hit"> <td class="line">787</td><td class="hits">1</td><td class="source"> <span class="k">return</span> ret<span class="k">;</span></td></tr><tr><td class="line">788</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr><td class="line">789</td><td class="hits"></td><td class="source"> <span class="k">else</span> <span class="k">{</span></td></tr><tr><td class="line">790</td><td class="hits"></td><td class="source"> <span class="c">// rollback</span></td></tr><tr class="miss"> <td class="line">791</td><td class="hits">0</td><td class="source"> tokens<span class="k">.</span>unshift<span class="k">(</span>w<span class="k">);</span></td></tr><tr class="miss"> <td class="line">792</td><td class="hits">0</td><td class="source"> tokens<span class="k">.</span>unshift<span class="k">(</span>target<span class="k">);</span></td></tr><tr><td class="line">793</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr><td class="line">794</td><td class="hits"></td><td class="source"> <span class="k">}</span><span class="k">;</span></td></tr><tr><td class="line">795</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"> <td class="line">796</td><td class="hits">47</td><td class="source"> <span class="k">var</span> definition <span class="k">=</span> <span class="k">function</span> <span class="k">()</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">797</td><td class="hits">144</td><td class="source"> <span class="k">return</span> callback<span class="k">()</span> <span class="k">||</span></td></tr><tr><td class="line">798</td><td class="hits"></td><td class="source"> interface_<span class="k">()</span> <span class="k">||</span></td></tr><tr><td class="line">799</td><td class="hits"></td><td class="source"> partial<span class="k">()</span> <span class="k">||</span></td></tr><tr><td class="line">800</td><td class="hits"></td><td class="source"> dictionary<span class="k">()</span> <span class="k">||</span></td></tr><tr><td class="line">801</td><td class="hits"></td><td class="source"> exception<span class="k">()</span> <span class="k">||</span></td></tr><tr><td class="line">802</td><td class="hits"></td><td class="source"> enum_<span class="k">()</span> <span class="k">||</span></td></tr><tr><td class="line">803</td><td class="hits"></td><td class="source"> typedef<span class="k">()</span> <span class="k">||</span></td></tr><tr><td class="line">804</td><td class="hits"></td><td class="source"> implements_<span class="k">()</span></td></tr><tr><td class="line">805</td><td class="hits"></td><td class="source"> <span class="k">;</span></td></tr><tr><td class="line">806</td><td class="hits"></td><td class="source"> <span class="k">}</span><span class="k">;</span></td></tr><tr><td class="line">807</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"> <td class="line">808</td><td class="hits">47</td><td class="source"> <span class="k">var</span> definitions <span class="k">=</span> <span class="k">function</span> <span class="k">()</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">809</td><td class="hits">47</td><td class="source"> <span class="k">if</span> <span class="k">(!</span>tokens<span class="k">.</span>length<span class="k">)</span> <span class="k">return</span> <span class="k">[];</span></td></tr><tr class="hit"> <td class="line">810</td><td class="hits">47</td><td class="source"> <span class="k">var</span> defs <span class="k">=</span> <span class="k">[];</span></td></tr><tr class="hit"> <td class="line">811</td><td class="hits">47</td><td class="source"> <span class="k">while</span> <span class="k">(</span><span class="k">true</span><span class="k">)</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">812</td><td class="hits">144</td><td class="source"> <span class="k">var</span> ea <span class="k">=</span> extended_attrs<span class="k">()</span></td></tr><tr><td class="line">813</td><td class="hits"></td><td class="source"> <span class="k">,</span> def <span class="k">=</span> definition<span class="k">();</span></td></tr><tr class="hit"> <td class="line">814</td><td class="hits">144</td><td class="source"> <span class="k">if</span> <span class="k">(!</span>def<span class="k">)</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">815</td><td class="hits">47</td><td class="source"> <span class="k">if</span> <span class="k">(</span>ea<span class="k">.</span>length<span class="k">)</span> error<span class="k">(</span><span class="s">"Stray extended attributes"</span><span class="k">);</span></td></tr><tr class="hit"> <td class="line">816</td><td class="hits">47</td><td class="source"> <span class="k">break</span><span class="k">;</span></td></tr><tr><td class="line">817</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr class="hit"> <td class="line">818</td><td class="hits">97</td><td class="source"> def<span class="k">.</span>extAttrs <span class="k">=</span> ea<span class="k">;</span></td></tr><tr class="hit"> <td class="line">819</td><td class="hits">97</td><td class="source"> defs<span class="k">.</span>push<span class="k">(</span>def<span class="k">);</span></td></tr><tr><td class="line">820</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr class="hit"> <td class="line">821</td><td class="hits">47</td><td class="source"> <span class="k">return</span> defs<span class="k">;</span></td></tr><tr><td class="line">822</td><td class="hits"></td><td class="source"> <span class="k">}</span><span class="k">;</span></td></tr><tr class="hit"> <td class="line">823</td><td class="hits">47</td><td class="source"> <span class="k">var</span> res <span class="k">=</span> definitions<span class="k">();</span></td></tr><tr class="hit"> <td class="line">824</td><td class="hits">47</td><td class="source"> <span class="k">if</span> <span class="k">(</span>tokens<span class="k">.</span>length<span class="k">)</span> error<span class="k">(</span><span class="s">"Unrecognised tokens"</span><span class="k">);</span></td></tr><tr class="hit"> <td class="line">825</td><td class="hits">47</td><td class="source"> <span class="k">return</span> res<span class="k">;</span></td></tr><tr><td class="line">826</td><td class="hits"></td><td class="source"> <span class="k">}</span><span class="k">;</span></td></tr><tr><td class="line">827</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"> <td class="line">828</td><td class="hits">1</td><td class="source"> <span class="k">var</span> obj <span class="k">=</span> <span class="k">{</span></td></tr><tr><td class="line">829</td><td class="hits"></td><td class="source"> parse<span class="k">:</span> <span class="k">function</span> <span class="k">(</span>str<span class="k">)</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">830</td><td class="hits">47</td><td class="source"> <span class="k">var</span> tokens <span class="k">=</span> tokenise<span class="k">(</span>str<span class="k">);</span></td></tr><tr><td class="line">831</td><td class="hits"></td><td class="source"> <span class="c">// console.log(tokens);</span></td></tr><tr class="hit"> <td class="line">832</td><td class="hits">47</td><td class="source"> <span class="k">return</span> parse<span class="k">(</span>tokens<span class="k">);</span></td></tr><tr><td class="line">833</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr><td class="line">834</td><td class="hits"></td><td class="source"> <span class="k">}</span><span class="k">;</span></td></tr><tr class="hit"> <td class="line">835</td><td class="hits">1</td><td class="source"> <span class="k">if</span> <span class="k">(</span><span class="k">typeof</span> module <span class="k">!==</span> <span class="s">"undefined"</span> <span class="k">&&</span> module<span class="k">.</span>exports<span class="k">)</span> <span class="k">{</span></td></tr><tr class="hit"> <td class="line">836</td><td class="hits">1</td><td class="source"> module<span class="k">.</span>exports <span class="k">=</span> obj<span class="k">;</span></td></tr><tr><td class="line">837</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr><td class="line">838</td><td class="hits"></td><td class="source"> <span class="k">else</span> <span class="k">{</span></td></tr><tr class="miss"> <td class="line">839</td><td class="hits">0</td><td class="source"> window<span class="k">.</span>WebIDL2 <span class="k">=</span> obj<span class="k">;</span></td></tr><tr><td class="line">840</td><td class="hits"></td><td class="source"> <span class="k">}</span></td></tr><tr><td class="line">841</td><td class="hits"></td><td class="source"><span class="k">}</span><span class="k">());</span></td></tr></tbody></table></div></div></div></body></html> |