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&amp;diff=226294270&amp;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&amp;diff=226133245&amp;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 = &quot;CoordParse&quot;,<br /> serial = &quot;2022-09-07&quot;,<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 ) == &quot;string&quot; then<br /> local s = string.format( &quot;^%s+&quot;, CoordParse.re.Wspace )<br /> r = mw.ustring.gsub( adjust, s, &quot;&quot; )<br /> if r == &quot;&quot; then<br /> r = false<br /> else<br /> s = string.format( &quot;%s+$&quot;, CoordParse.re.Wspace )<br /> r = mw.ustring.gsub( adjust, s, &quot;&quot; )<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( &quot;span&quot; )<br /> local s<br /> if apply then<br /> if CoordParse.err then<br /> local std = CoordParse.err[ &quot;err&quot; .. apply ]<br /> if type( std ) == &quot;string&quot; then<br /> std = mw.text.trim( std )<br /> if std ~= &quot;&quot; then<br /> s = std<br /> end<br /> end<br /> end<br /> if not s then<br /> s = string.format( &quot;((%s))&quot;, apply )<br /> end<br /> end<br /> if about then<br /> if s then<br /> s = string.format( &quot;%s: %s&quot;, s, mw.text.nowiki( about ) )<br /> else<br /> s = about<br /> end<br /> end<br /> if CoordParse.err and<br /> type( CoordParse.err.Cat ) == &quot;string&quot; and<br /> CoordParse.err.Cat ~= &quot;&quot; then<br /> s = string.format( &quot;%s[[Category:%s]]&quot;,<br /> s,<br /> CoordParse.err.Cat )<br /> end<br /> r:addClass( &quot;error&quot; )<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 ) == &quot;string&quot; then<br /> r = CoordParse.Expr<br /> end<br /> else<br /> local lucky<br /> lucky, CoordParse.Expr = pcall( require, &quot;Module:Expr&quot; )<br /> if type( CoordParse.Expr ) == &quot;table&quot; then<br /> lucky, CoordParse.Expr = pcall( CoordParse.Expr )<br /> if type( CoordParse.Expr ) ~= &quot;table&quot; or<br /> type( CoordParse.Expr.figure ) ~= &quot;function&quot; or<br /> type( CoordParse.Expr.minsec2decimal ) ~= &quot;function&quot; then<br /> r = &quot;Invalid library &#039;Expr&#039;&quot;<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, &quot;^%a+$&quot; ) then<br /> local supply = mw.ustring.upper( apply )<br /> local scan<br /> if align then<br /> scan = string.format( &quot;^%s$&quot;, arglist.N or &quot;N&quot; )<br /> if mw.ustring.match( supply, scan ) then<br /> r2 = &quot;N&quot;<br /> else<br /> scan = string.format( &quot;^%s$&quot;, arglist.S or &quot;S&quot; )<br /> if mw.ustring.match( supply, scan ) then<br /> r2 = &quot;S&quot;<br /> end<br /> end<br /> else<br /> scan = string.format( &quot;^%s$&quot;, arglist.E or &quot;E&quot; )<br /> if mw.ustring.match( supply, scan ) then<br /> r2 = &quot;E&quot;<br /> else<br /> scan = string.format( &quot;^%s$&quot;, arglist.W or &quot;W&quot; )<br /> if mw.ustring.match( supply, scan ) then<br /> r2 = &quot;W&quot;<br /> end<br /> end<br /> end<br /> if not r2 then<br /> r1 = fault( &quot;Word&quot;, 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 == &quot;string&quot; then<br /> if analyze:find( &quot;,&quot; ) then<br /> s = &quot;-,&quot;<br /> else<br /> s = &quot;-.&quot;<br /> end<br /> r = CoordParse.Expr.figure( analyze, s )<br /> elseif s == &quot;number&quot; 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 /> -- -- &quot;Deg&quot;<br /> -- -- &quot;Min&quot;<br /> -- -- &quot;Sec&quot;<br /> -- -- &quot;Min2&quot;<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( &quot;/&quot;, 1, true ) then<br /> local n<br /> g = mw.text.split( apply, &quot;%s*/%s*&quot; )<br /> n = #g<br /> if n &gt; 4 then<br /> r = fault( &quot;GT4&quot;, 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, &quot;^(.*%A)(%a+)$&quot; )<br /> if start then<br /> r, snwe = field( suffix, align, arglist )<br /> s = fair( start )<br /> end<br /> else<br /> r = fault( &quot;Empty&quot;, 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, &quot;Deg&quot; )<br /> if start then<br /> table.insert( g, start )<br /> s = fair( suffix )<br /> if s then<br /> start, suffix = fracking( s, &quot;Min&quot; )<br /> if start then<br /> table.insert( g, start )<br /> s = fair( suffix )<br /> if s then<br /> start, suffix = fracking( s, &quot;Sec&quot; )<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, &quot;Min2&quot; )<br /> if start then<br /> table.insert( g, start )<br /> else<br /> r = fault( &quot;Bad&quot;, s )<br /> end<br /> end<br /> s = fair( suffix )<br /> if s then<br /> r = fault( &quot;Bad&quot;, s )<br /> end<br /> end<br /> else<br /> r = fault( &quot;Bad&quot;, 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( &quot;Bad&quot;, 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 = &quot;N&quot;<br /> else<br /> snwe = &quot;E&quot;<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 ) == &quot;table&quot; then<br /> CoordParse.err = arglist<br /> if type( adjust ) == &quot;string&quot; then<br /> factory()<br /> stuff = adjust<br /> if stuff:find( &quot;&lt;&quot;, 1, true ) then<br /> stuff = stuff:gsub( &quot;&lt;[^&gt;]*&gt;&quot;, &quot;&quot; )<br /> end<br /> if stuff:find( &quot;&amp;.+;&quot; ) 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( &quot;Empty&quot; )<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 ) == &quot;table&quot; and type( arglist ) == &quot;table&quot; 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 == &quot;string&quot; then<br /> v = fair( v )<br /> if v and i &lt; 4 then<br /> max = i<br /> if not min and v:find( &quot;[%.,]&quot; ) then<br /> min = i<br /> end<br /> end<br /> elseif s == &quot;number&quot; then<br /> if i &lt; 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( &quot;MinX&quot; )<br /> elseif min and min &lt; max then<br /> r = fault( &quot;SepEl&quot;, 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 ) == &quot;string&quot; then<br /> v = figure( v )<br /> if v then<br /> g[ i ] = v<br /> else<br /> r = fault( &quot;Num&quot;, v )<br /> break -- for i<br /> end<br /> end<br /> end -- for i<br /> end<br /> if not r and max &gt; 1 then<br /> v = g[ 2 ]<br /> if v &lt; 0 then<br /> r = fault( &quot;Mlt0&quot;, tostring( v ) )<br /> elseif v &gt;= 60 then<br /> r = fault( &quot;Mgt60&quot;, tostring( v ) )<br /> elseif max &gt; 2 then<br /> v = g[ 3 ]<br /> if v &lt; 0 then<br /> r = fault( &quot;Slt0&quot;, tostring( v ) )<br /> elseif v &gt;= 60 then<br /> r = fault( &quot;Sgt60&quot;, tostring( v ) )<br /> end<br /> end<br /> end<br /> if not r then<br /> v = g[ 1 ]<br /> if align then<br /> if v &lt; -90 then<br /> r = fault( &quot;DegLT&quot;, tostring( v ) )<br /> elseif v &gt; 90 then<br /> r = fault( &quot;DegGT&quot;, tostring( v ) )<br /> end<br /> else<br /> if v &lt;= -180 then<br /> r = fault( &quot;DegLT&quot;, tostring( v ) )<br /> elseif v &gt; 180 then<br /> if v &lt; 360 then<br /> g[ 1 ] = v - 360<br /> else<br /> r = fault( &quot;DegGT&quot;, 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 &gt; 0 and<br /> ( g[ 4 ] == &quot;S&quot; or<br /> g[ 4 ] == &quot;W&quot; ) then<br /> r = -1 * r<br /> end<br /> end<br /> end<br /> end<br /> else<br /> r = fault( &quot;DegX&quot; )<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 == &quot;~&quot; )<br /> local linked = ( since == &quot;@&quot; )<br /> local link = ( since == &quot;item&quot; )<br /> local r<br /> if last or link or linked or since == &quot;wikidata&quot; then<br /> local item = Failsafe.item<br /> since = false<br /> if type( item ) == &quot;number&quot; and item &gt; 0 then<br /> local suited = string.format( &quot;Q%d&quot;, item )<br /> if link then<br /> r = suited<br /> else<br /> local entity = mw.wikibase.getEntity( suited )<br /> if type( entity ) == &quot;table&quot; then<br /> local seek = Failsafe.serialProperty or &quot;P348&quot;<br /> local vsn = entity:formatPropertyValues( seek )<br /> if type( vsn ) == &quot;table&quot; and<br /> type( vsn.value ) == &quot;string&quot; and<br /> vsn.value ~= &quot;&quot; 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 ) == &quot;nil&quot; then<br /> if not since or since &lt;= 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 == &quot;1&quot; 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 == &quot;table&quot; then<br /> since = frame.args[ 1 ]<br /> elseif s == &quot;string&quot; then<br /> since = frame<br /> end<br /> if since then<br /> since = mw.text.trim( since )<br /> if since == &quot;&quot; then<br /> since = false<br /> end<br /> end<br /> return Failsafe.failsafe( since ) or &quot;&quot;<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