https://de.wikipedia.org/w/index.php?action=history&feed=atom&title=Modul%3ACoordParse
Modul:CoordParse - Versionsgeschichte
2025-06-06T02:44:45Z
Versionsgeschichte dieser Seite in Wikipedia
MediaWiki 1.45.0-wmf.4
https://de.wikipedia.org/w/index.php?title=Modul:CoordParse&diff=226352183&oldid=prev
PerfektesChaos: 2022-09-15
2022-09-21T15:17:21Z
<p>2022-09-15</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="de">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Nächstältere Version</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Version vom 21. September 2022, 17:17 Uhr</td>
</tr><tr>
<td colspan="2" class="diff-lineno">Zeile 1:</td>
<td colspan="2" class="diff-lineno">Zeile 1:</td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>local CoordParse = { suite = "CoordParse",</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>local CoordParse = { suite = "CoordParse",</div></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> serial = "2022-09-<del style="font-weight: bold; text-decoration: none;">14</del>",</div></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> serial = "2022-09-<ins style="font-weight: bold; text-decoration: none;">15</ins>",</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> item = 113956219 }</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> item = 113956219 }</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>--[==[</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>--[==[</div></td>
</tr>
<tr>
<td colspan="2" class="diff-lineno">Zeile 287:</td>
<td colspan="2" class="diff-lineno">Zeile 287:</td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> local begin = { }</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> local begin = { }</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> local ended = { }</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> local ended = { }</div></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> local j, k, r, s</div></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> local j, k<ins style="font-weight: bold; text-decoration: none;">, lucky</ins>, r, s</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> for i = 1, 4 do</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> for i = 1, 4 do</div></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> s = suite:sub( i, i )</div></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> s =<ins style="font-weight: bold; text-decoration: none;"> f(</ins> suite:sub( i, i<ins style="font-weight: bold; text-decoration: none;"> )</ins> )</div></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> j, k = mw.ustring.find( apply,<del style="font-weight: bold; text-decoration: none;"> f(</del> s<del style="font-weight: bold; text-decoration: none;"> )</del>,<del style="font-weight: bold; text-decoration: none;"> </del> 2 )</div></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> j, k = mw.ustring.find( apply, s, 2 )</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> table.insert( begin, j or false )</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> table.insert( begin, j or false )</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> table.insert( ended, k or false )</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> table.insert( ended, k or false )</div></td>
</tr>
<tr>
<td colspan="2" class="diff-empty diff-side-deleted"></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> if k and mw.ustring.find( apply, s, k + 1 ) then</div></td>
</tr>
<tr>
<td colspan="2" class="diff-empty diff-side-deleted"></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> r = true</div></td>
</tr>
<tr>
<td colspan="2" class="diff-empty diff-side-deleted"></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> break -- for i</div></td>
</tr>
<tr>
<td colspan="2" class="diff-empty diff-side-deleted"></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> elseif j then</div></td>
</tr>
<tr>
<td colspan="2" class="diff-empty diff-side-deleted"></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> lucky = true</div></td>
</tr>
<tr>
<td colspan="2" class="diff-empty diff-side-deleted"></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> end</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end -- for i</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end -- for i</div></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> if ( begin[ 1 ] and begin[ 2 ] ) or</div></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> if<ins style="font-weight: bold; text-decoration: none;"> r or</ins></div></td>
</tr>
<tr>
<td colspan="2" class="diff-empty diff-side-deleted"></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"> </ins> ( begin[ 1 ] and begin[ 2 ] ) or</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> ( begin[ 3 ] and begin[ 4 ] ) then</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> ( begin[ 3 ] and begin[ 4 ] ) then</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> r = fault( "Multi", apply )</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> r = fault( "Multi", apply )</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> else</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> else</div></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> local j0 <del style="font-weight: bold; text-decoration: none;">= begin[ 3 ] or begin[ 4 ]</del></div></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> local j0<ins style="font-weight: bold; text-decoration: none;">,</ins> <ins style="font-weight: bold; text-decoration: none;">j1</ins></div></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> <del style="font-weight: bold; text-decoration: none;">local j1</del> = <del style="font-weight: bold; text-decoration: none;">begin[ 1 ] or begin[ 2 ]</del></div></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> <ins style="font-weight: bold; text-decoration: none;">s</ins> = <ins style="font-weight: bold; text-decoration: none;">apply</ins></div></td>
</tr>
<tr>
<td colspan="2" class="diff-empty diff-side-deleted"></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> if lucky then</div></td>
</tr>
<tr>
<td colspan="2" class="diff-empty diff-side-deleted"></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> j0 = begin[ 3 ] or begin[ 4 ]</div></td>
</tr>
<tr>
<td colspan="2" class="diff-empty diff-side-deleted"></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> j1 = begin[ 1 ] or begin[ 2 ]</div></td>
</tr>
<tr>
<td colspan="2" class="diff-empty diff-side-deleted"></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> end</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> if j0 and j1 then</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> if j0 and j1 then</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> local k, lead</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> local k, lead</div></td>
</tr>
<tr>
<td colspan="2" class="diff-lineno">Zeile 305:</td>
<td colspan="2" class="diff-lineno">Zeile 316:</td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> k = ended[ 3 ] or ended[ 4 ]</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> k = ended[ 3 ] or ended[ 4 ]</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> if align then</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> if align then</div></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> s = mw.ustring.sub( <del style="font-weight: bold; text-decoration: none;">apply</del>, k + 1 )</div></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> s = mw.ustring.sub( <ins style="font-weight: bold; text-decoration: none;">s</ins>, k + 1 )</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> lead = true</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> lead = true</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> else</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> else</div></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> s = mw.ustring.sub( <del style="font-weight: bold; text-decoration: none;">apply</del>, 1, k )</div></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> s = mw.ustring.sub( <ins style="font-weight: bold; text-decoration: none;">s</ins>, 1, k )</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> else</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> else</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> k = ended[ 1 ] or ended[ 2 ]</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> k = ended[ 1 ] or ended[ 2 ]</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> if align then</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> if align then</div></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> s = mw.ustring.sub( <del style="font-weight: bold; text-decoration: none;">apply</del>, 1, k )</div></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> s = mw.ustring.sub( <ins style="font-weight: bold; text-decoration: none;">s</ins>, 1, k )</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> else</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> else</div></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> s = mw.ustring.sub( <del style="font-weight: bold; text-decoration: none;">apply</del>, k + 1 )</div></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> s = mw.ustring.sub( <ins style="font-weight: bold; text-decoration: none;">s</ins>, k + 1 )</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> lead = true</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> lead = true</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td>
</tr>
<tr>
<td colspan="2" class="diff-lineno">Zeile 327:</td>
<td colspan="2" class="diff-lineno">Zeile 338:</td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> elseif ( j0 and not align ) or ( j1 and align ) <del style="font-weight: bold; text-decoration: none;">then</del></div></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> elseif ( j0 and not align ) or</div></td>
</tr>
<tr>
<td colspan="2" class="diff-empty diff-side-deleted"></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"> </ins> ( j1 and align ) <ins style="font-weight: bold; text-decoration: none;"> or</ins></div></td>
</tr>
<tr>
<td colspan="2" class="diff-empty diff-side-deleted"></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> not lucky then</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> s = apply</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> s = apply</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> else</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> else</div></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> <del style="font-weight: bold; text-decoration: none;">r</del> = <del style="font-weight: bold; text-decoration: none;">fault( "Empty", apply )</del></div></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> <ins style="font-weight: bold; text-decoration: none;">s</ins> = <ins style="font-weight: bold; text-decoration: none;">false</ins></div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> s = fair( s )</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> s = fair( s )</div></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> if not s then</div></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> if not s<ins style="font-weight: bold; text-decoration: none;"> or s == "-"</ins> then</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> r = fault( "Empty", apply )</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> r = fault( "Empty", apply )</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td>
</tr>
<tr>
<td colspan="2" class="diff-lineno">Zeile 457:</td>
<td colspan="2" class="diff-lineno">Zeile 470:</td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> table.insert( g, s )</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> table.insert( g, s )</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> else</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> else</div></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> r = fault( "Bad", <del style="font-weight: bold; text-decoration: none;">s</del> )</div></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> r = fault( "Bad", <ins style="font-weight: bold; text-decoration: none;">apply</ins> )</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td>
</tr>
</table>
PerfektesChaos
https://de.wikipedia.org/w/index.php?title=Modul:CoordParse&diff=226294270&oldid=prev
PerfektesChaos: 2022-09-14
2022-09-19T15:31:55Z
<p>2022-09-14</p>
<a href="//de.wikipedia.org/w/index.php?title=Modul:CoordParse&diff=226294270&oldid=226133245">Änderungen zeigen</a>
PerfektesChaos
https://de.wikipedia.org/w/index.php?title=Modul:CoordParse&diff=226133245&oldid=prev
PerfektesChaos: 2022-09-09
2022-09-13T14:29:35Z
<p>2022-09-09</p>
<a href="//de.wikipedia.org/w/index.php?title=Modul:CoordParse&diff=226133245&oldid=226076004">Änderungen zeigen</a>
PerfektesChaos
https://de.wikipedia.org/w/index.php?title=Modul:CoordParse&diff=226076004&oldid=prev
Crazy1880: Schützte „Modul:CoordParse“: Häufig eingebundenes Modul: siehe Anfrage dazu ([Bearbeiten=Nur Sichter] (unbeschränkt) [Verschieben=Nur Administratoren] (unbeschränkt))
2022-09-11T14:55:17Z
<p>Schützte „<a href="/wiki/Modul:CoordParse" title="Modul:CoordParse">Modul:CoordParse</a>“: Häufig eingebundenes Modul: siehe <a href="/wiki/Spezial:Diff/226075856" title="Spezial:Diff/226075856">Anfrage</a> dazu ([Bearbeiten=Nur Sichter] (unbeschränkt) [Verschieben=Nur Administratoren] (unbeschränkt))</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<tr class="diff-title" lang="de">
<td colspan="1" style="background-color: #fff; color: #202122; text-align: center;">← Nächstältere Version</td>
<td colspan="1" style="background-color: #fff; color: #202122; text-align: center;">Version vom 11. September 2022, 16:55 Uhr</td>
</tr><tr><td colspan="2" class="diff-notice" lang="de"><div class="mw-diff-empty">(kein Unterschied)</div>
</td></tr></table>
Crazy1880
https://de.wikipedia.org/w/index.php?title=Modul:CoordParse&diff=226074243&oldid=prev
PerfektesChaos: 2022-09-07
2022-09-11T13:39:45Z
<p>2022-09-07</p>
<p><b>Neue Seite</b></p><div>local CoordParse = { suite = "CoordParse",<br />
serial = "2022-09-07",<br />
item = 0 }<br />
--[==[<br />
Coordinate parsing and validation<br />
* feed<br />
* fragments<br />
* failsafe<br />
]==]<br />
local Failsafe = CoordParse<br />
<br />
<br />
<br />
local function factory()<br />
-- Create patterns<br />
-- Postcondition:<br />
-- Patterns available<br />
if not CoordParse.re then<br />
CoordParse.re = {<br />
Wspace = mw.ustring.char( 91, 37, 115,<br />
0xA0,<br />
0x1680,<br />
0x2000, 45, 0x200A,<br />
0x202F,<br />
0x205F,<br />
0x3000,<br />
0x303F, 93 ),<br />
Deg = mw.ustring.char( 91, 0xB0,<br />
0xBA, 93 ),<br />
Min = mw.ustring.char( 91, 0x27,<br />
0x2032,<br />
0x2019, 93 ),<br />
Sec = mw.ustring.char( 91, 0x22,<br />
0x2033,<br />
0x201D, 93 )<br />
}<br />
end<br />
end -- factory()<br />
<br />
<br />
<br />
local function fair( adjust )<br />
-- Advanced trim<br />
-- Precondition:<br />
-- adjust -- string, to be trimmed, or something else<br />
-- CoordParse.re has been initialized<br />
-- Postcondition:<br />
-- Return trimmed string, or false if empty<br />
local r<br />
if type( adjust ) == "string" then<br />
local s = string.format( "^%s+", CoordParse.re.Wspace )<br />
r = mw.ustring.gsub( adjust, s, "" )<br />
if r == "" then<br />
r = false<br />
else<br />
s = string.format( "%s+$", CoordParse.re.Wspace )<br />
r = mw.ustring.gsub( adjust, s, "" )<br />
end<br />
else<br />
r = adjust<br />
end<br />
return r<br />
end -- fair()<br />
<br />
<br />
<br />
local function fault( apply, about )<br />
-- Error message<br />
-- Precondition:<br />
-- apply -- string, with message ID, or not<br />
-- about -- string, with details, or not<br />
-- Postcondition:<br />
-- Return mw.html object<br />
local r = mw.html.create( "span" )<br />
local s<br />
if apply then<br />
if CoordParse.err then<br />
local std = CoordParse.err[ "err" .. apply ]<br />
if type( std ) == "string" then<br />
std = mw.text.trim( std )<br />
if std ~= "" then<br />
s = std<br />
end<br />
end<br />
end<br />
if not s then<br />
s = string.format( "((%s))", apply )<br />
end<br />
end<br />
if about then<br />
if s then<br />
s = string.format( "%s: %s", s, mw.text.nowiki( about ) )<br />
else<br />
s = about<br />
end<br />
end<br />
if CoordParse.err and<br />
type( CoordParse.err.Cat ) == "string" and<br />
CoordParse.err.Cat ~= "" then<br />
s = string.format( "%s[[Category:%s]]",<br />
s,<br />
CoordParse.err.Cat )<br />
end<br />
r:addClass( "error" )<br />
:wikitext( s )<br />
return r<br />
end -- fault()<br />
<br />
<br />
<br />
local function fetch()<br />
-- Retrieve Expr library<br />
-- Postcondition:<br />
-- Return some message string, if failed<br />
local r<br />
if CoordParse.Expr then<br />
if type( CoordParse.Expr ) == "string" then<br />
r = CoordParse.Expr<br />
end<br />
else<br />
local lucky<br />
lucky, CoordParse.Expr = pcall( require, "Module:Expr" )<br />
if type( CoordParse.Expr ) == "table" then<br />
lucky, CoordParse.Expr = pcall( CoordParse.Expr )<br />
if type( CoordParse.Expr ) ~= "table" or<br />
type( CoordParse.Expr.figure ) ~= "function" or<br />
type( CoordParse.Expr.minsec2decimal ) ~= "function" then<br />
r = "Invalid library 'Expr'"<br />
end<br />
else<br />
r = CoordParse.Expr<br />
end<br />
if r then<br />
r = tostring( fault( r ) )<br />
CoordParse.Expr = r<br />
end<br />
end<br />
return r<br />
end -- fetch()<br />
<br />
<br />
<br />
local function field( apply, align, arglist )<br />
-- Parse compass direction word<br />
-- Precondition:<br />
-- apply -- string, with word, or not<br />
-- align -- true, for latitude<br />
-- arglist -- table, with options<br />
-- Postcondition:<br />
-- Return<br />
-- 1 -- mw.html object, with error message, if failed<br />
-- 2 -- string, with SNWE letter, or not<br />
local r1, r2<br />
if apply and mw.ustring.match( apply, "^%a+$" ) then<br />
local supply = mw.ustring.upper( apply )<br />
local scan<br />
if align then<br />
scan = string.format( "^%s$", arglist.N or "N" )<br />
if mw.ustring.match( supply, scan ) then<br />
r2 = "N"<br />
else<br />
scan = string.format( "^%s$", arglist.S or "S" )<br />
if mw.ustring.match( supply, scan ) then<br />
r2 = "S"<br />
end<br />
end<br />
else<br />
scan = string.format( "^%s$", arglist.E or "E" )<br />
if mw.ustring.match( supply, scan ) then<br />
r2 = "E"<br />
else<br />
scan = string.format( "^%s$", arglist.W or "W" )<br />
if mw.ustring.match( supply, scan ) then<br />
r2 = "W"<br />
end<br />
end<br />
end<br />
if not r2 then<br />
r1 = fault( "Word", apply )<br />
end<br />
end<br />
return r1, r2<br />
end -- field()<br />
<br />
<br />
<br />
local function figure( analyze )<br />
-- Parse string<br />
-- Precondition:<br />
-- analyze - string or number, with figure<br />
-- Expr available<br />
-- Postcondition:<br />
-- Return number or not<br />
local s = type( analyze )<br />
local r<br />
if s == "string" then<br />
if analyze:find( "," ) then<br />
s = "-,"<br />
else<br />
s = "-."<br />
end<br />
r = CoordParse.Expr.figure( analyze, s )<br />
elseif s == "number" then<br />
r = analyze<br />
end<br />
return r<br />
end -- figure()<br />
<br />
<br />
<br />
local function fracking( apply, accept )<br />
-- Parse number with unit<br />
-- Precondition:<br />
-- apply -- string, with coordinate remainder<br />
-- accept -- string, with key for pattern of unit<br />
-- -- "Deg"<br />
-- -- "Min"<br />
-- -- "Sec"<br />
-- -- "Min2"<br />
-- Postcondition:<br />
-- Return<br />
-- 1 -- number, if found<br />
-- 2 -- string, with remainder, or not<br />
local s = CoordParse.re[ accept ]<br />
local i, j = mw.ustring.find( apply, s, 2 )<br />
local r1, r2<br />
if i then<br />
s = mw.ustring.sub( apply, 1, i - 1 )<br />
r1 = figure( s )<br />
if r1 then<br />
r2 = fair( mw.ustring.sub( apply, j + 1 ) )<br />
end<br />
end<br />
return r1, r2<br />
end -- fracking()<br />
<br />
<br />
<br />
local function from( apply, align, arglist )<br />
-- Parse string<br />
-- Precondition:<br />
-- apply -- string, with coordinate<br />
-- align -- true, for latitude<br />
-- arglist -- table, with options<br />
-- Postcondition:<br />
-- Return -- mw.html object, with error message, if failed<br />
-- -- number, if success<br />
local g, r, snwe<br />
if apply:find( "/", 1, true ) then<br />
local n<br />
g = mw.text.split( apply, "%s*/%s*" )<br />
n = #g<br />
if n > 4 then<br />
r = fault( "GT4", apply )<br />
else<br />
r, snwe = field( fair( g[ n ] ), align, arglist )<br />
if not r then<br />
if snwe then<br />
g[ n ] = false<br />
n = n - 1<br />
end<br />
end<br />
end<br />
else<br />
local s = fair( apply )<br />
local start, suffix<br />
if s then<br />
start, suffix = mw.ustring.match( s, "^(.*%A)(%a+)$" )<br />
if start then<br />
r, snwe = field( suffix, align, arglist )<br />
s = fair( start )<br />
end<br />
else<br />
r = fault( "Empty", s )<br />
end<br />
if not r then<br />
r = fetch()<br />
end<br />
if not r then<br />
g = { }<br />
start, suffix = fracking( s, "Deg" )<br />
if start then<br />
table.insert( g, start )<br />
s = fair( suffix )<br />
if s then<br />
start, suffix = fracking( s, "Min" )<br />
if start then<br />
table.insert( g, start )<br />
s = fair( suffix )<br />
if s then<br />
start, suffix = fracking( s, "Sec" )<br />
if start then<br />
table.insert( g, start )<br />
else<br />
if not r then<br />
CoordParse.re.Min2 =<br />
CoordParse.re.Min ..<br />
CoordParse.re.Min<br />
end<br />
start, suffix = fracking( s, "Min2" )<br />
if start then<br />
table.insert( g, start )<br />
else<br />
r = fault( "Bad", s )<br />
end<br />
end<br />
s = fair( suffix )<br />
if s then<br />
r = fault( "Bad", s )<br />
end<br />
end<br />
else<br />
r = fault( "Bad", s )<br />
end<br />
end<br />
else<br />
r = fetch()<br />
if not r then<br />
s = figure( s )<br />
if s then<br />
table.insert( g, s )<br />
else<br />
r = fault( "Bad", s )<br />
end<br />
end<br />
end<br />
end<br />
end<br />
if not r then<br />
if not snwe then<br />
if align then<br />
snwe = "N"<br />
else<br />
snwe = "E"<br />
end<br />
end<br />
for i = #g + 1, 3 do<br />
table.insert( g, false )<br />
end -- for i<br />
if g == 3 then<br />
table.insert( g, snwe )<br />
else<br />
g[ 4 ] = snwe<br />
end<br />
r = CoordParse.fragments( align, g, arglist )<br />
end<br />
return r<br />
end -- from()<br />
<br />
<br />
<br />
CoordParse.feed = function ( align, adjust, arglist )<br />
-- Parse single string<br />
-- Precondition:<br />
-- align -- true, for latitude<br />
-- adjust -- string, to be parsed<br />
-- arglist -- table, with options<br />
-- Postcondition:<br />
-- Return single number, or mw.html error message<br />
local r, stuff<br />
if type( arglist ) == "table" then<br />
CoordParse.err = arglist<br />
if type( adjust ) == "string" then<br />
factory()<br />
stuff = adjust<br />
if stuff:find( "<", 1, true ) then<br />
stuff = stuff:gsub( "<[^>]*>", "" )<br />
end<br />
if stuff:find( "&.+;" ) then<br />
stuff = mw.text.decode( stuff, true )<br />
end<br />
r = from( stuff, align, arglist )<br />
end<br />
end<br />
if not stuff then<br />
r = fault( "Empty" )<br />
end<br />
return r<br />
end -- CoordParse.feed()<br />
<br />
<br />
<br />
CoordParse.fragments = function ( align, array, arglist )<br />
-- Parse component set<br />
-- Precondition:<br />
-- align -- true, for latitude<br />
-- array -- sequence table, with components<br />
-- [ 1 ] -- string or number, with degree<br />
-- [ 2 ] -- string or number, with minutes, or not<br />
-- [ 3 ] -- string or number, with seconds, or not<br />
-- [ 4 ] -- string or not, with direction<br />
-- arglist -- table, with options<br />
-- Postcondition:<br />
-- Return single number, or mw.html error message<br />
local r<br />
if type( array ) == "table" and type( arglist ) == "table" then<br />
local g = { }<br />
local max, min, s, v<br />
factory()<br />
for i = 1, #array do<br />
v = array[ i ]<br />
s = type( v )<br />
if s == "string" then<br />
v = fair( v )<br />
if v and i < 4 then<br />
max = i<br />
if not min and v:find( "[%.,]" ) then<br />
min = i<br />
end<br />
end<br />
elseif s == "number" then<br />
if i < 4 then<br />
max = i<br />
if not min and v ~= math.floor( v ) then<br />
min = i<br />
end<br />
end<br />
else<br />
v = false<br />
end<br />
table.insert( g, v )<br />
end -- for i<br />
for i = #g + 1, 4 do<br />
table.insert( g, false )<br />
end -- for i<br />
if g[ 1 ] then<br />
if g[ 3 ] and not g[ 2 ] then<br />
r = fault( "MinX" )<br />
elseif min and min < max then<br />
r = fault( "SepEl", tostring( g[ min ] ) )<br />
else<br />
r = fetch()<br />
if not r then<br />
for i = 1, max do<br />
v = g[ i ]<br />
if type( v ) == "string" then<br />
v = figure( v )<br />
if v then<br />
g[ i ] = v<br />
else<br />
r = fault( "Num", v )<br />
break -- for i<br />
end<br />
end<br />
end -- for i<br />
end<br />
if not r and max > 1 then<br />
v = g[ 2 ]<br />
if v < 0 then<br />
r = fault( "Mlt0", tostring( v ) )<br />
elseif v >= 60 then<br />
r = fault( "Mgt60", tostring( v ) )<br />
elseif max > 2 then<br />
v = g[ 3 ]<br />
if v < 0 then<br />
r = fault( "Slt0", tostring( v ) )<br />
elseif v >= 60 then<br />
r = fault( "Sgt60", tostring( v ) )<br />
end<br />
end<br />
end<br />
if not r then<br />
v = g[ 1 ]<br />
if align then<br />
if v < -90 then<br />
r = fault( "DegLT", tostring( v ) )<br />
elseif v > 90 then<br />
r = fault( "DegGT", tostring( v ) )<br />
end<br />
else<br />
if v <= -180 then<br />
r = fault( "DegLT", tostring( v ) )<br />
elseif v > 180 then<br />
if v < 360 then<br />
g[ 1 ] = v - 360<br />
else<br />
r = fault( "DegGT", tostring( v ) )<br />
end<br />
end<br />
end<br />
if not r then<br />
r = CoordParse.Expr.minsec2decimal( g[ 1 ],<br />
g[ 2 ],<br />
g[ 3 ],<br />
g[ 4 ] )<br />
if r and<br />
g[ 4 ] and<br />
r > 0 and<br />
( g[ 4 ] == "S" or<br />
g[ 4 ] == "W" ) then<br />
r = -1 * r<br />
end<br />
end<br />
end<br />
end<br />
else<br />
r = fault( "DegX" )<br />
end<br />
end<br />
return r<br />
end -- CoordParse.fragments()<br />
<br />
<br />
<br />
Failsafe.failsafe = function ( atleast )<br />
-- Retrieve versioning and check for compliance<br />
-- Precondition:<br />
-- atleast -- string, with required version<br />
-- or wikidata|item|~|@ or false<br />
-- Postcondition:<br />
-- returns string -- with queried version/item, also if problem<br />
-- false -- if appropriate<br />
-- 2020-08-17<br />
local since = atleast<br />
local last = ( since == "~" )<br />
local linked = ( since == "@" )<br />
local link = ( since == "item" )<br />
local r<br />
if last or link or linked or since == "wikidata" then<br />
local item = Failsafe.item<br />
since = false<br />
if type( item ) == "number" and item > 0 then<br />
local suited = string.format( "Q%d", item )<br />
if link then<br />
r = suited<br />
else<br />
local entity = mw.wikibase.getEntity( suited )<br />
if type( entity ) == "table" then<br />
local seek = Failsafe.serialProperty or "P348"<br />
local vsn = entity:formatPropertyValues( seek )<br />
if type( vsn ) == "table" and<br />
type( vsn.value ) == "string" and<br />
vsn.value ~= "" then<br />
if last and vsn.value == Failsafe.serial then<br />
r = false<br />
elseif linked then<br />
if mw.title.getCurrentTitle().prefixedText<br />
== mw.wikibase.getSitelink( suited ) then<br />
r = false<br />
else<br />
r = suited<br />
end<br />
else<br />
r = vsn.value<br />
end<br />
end<br />
end<br />
end<br />
end<br />
end<br />
if type( r ) == "nil" then<br />
if not since or since <= Failsafe.serial then<br />
r = Failsafe.serial<br />
else<br />
r = false<br />
end<br />
end<br />
return r<br />
end -- Failsafe.failsafe()<br />
<br />
<br />
<br />
-- Export<br />
local p = {}<br />
<br />
function p.feed( frame )<br />
local latitude = frame.args.latitude<br />
if latitude == "1" then<br />
latitude = true<br />
else<br />
latitude = false<br />
end<br />
return tostring( CoordParse.feed( latitude,<br />
frame.args[ 1 ],<br />
frame.args ) )<br />
end<br />
<br />
p.failsafe = function ( frame )<br />
-- Versioning interface<br />
local s = type( frame )<br />
local since<br />
if s == "table" then<br />
since = frame.args[ 1 ]<br />
elseif s == "string" then<br />
since = frame<br />
end<br />
if since then<br />
since = mw.text.trim( since )<br />
if since == "" then<br />
since = false<br />
end<br />
end<br />
return Failsafe.failsafe( since ) or ""<br />
end -- p.failsafe<br />
<br />
setmetatable( p, { __call = function ( func, ... )<br />
setmetatable( p, nil );<br />
return Failsafe;<br />
end } );<br />
<br />
return p</div>
PerfektesChaos