r109253 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r109252‎ | r109253 | r109254 >
Date:00:00, 18 January 2012
Author:gwicke
Status:deferred
Tags:
Comment:
Accept IPv6 (and IPv4) addresses in the tokenizer, so another test passes.
Modified paths:
  • /trunk/extensions/VisualEditor/modules/parser/pegTokenizer.pegjs.txt (modified) (history)

Diff [purge]

Index: trunk/extensions/VisualEditor/modules/parser/pegTokenizer.pegjs.txt
@@ -674,6 +674,7 @@
675675
676676 url
677677 = proto:url_protocol
 678+ addr:( ipv6_address / ipv4_address )?
678679 rest:( ( !inline_breaks
679680 c:no_punctuation_char
680681 { return c }
@@ -683,9 +684,21 @@
684685 / urlencoded_char
685686 / [&%] )+
686687 {
687 - return proto + rest.join('');
 688+ return proto + addr + rest.join('');
688689 }
689690
 691+ipv4_address
 692+ = a:([0-9]* '.' [0-9]* '.' [0-9]* '.' [0-9]*)
 693+{
 694+ return flatten( a ).join('');
 695+}
 696+
 697+ipv6_address
 698+ = a:('[' [0-9]* ':' [0-9]* ':' [0-9]* ':' [0-9]* ':' [0-9]* ':' [0-9]* ':' [0-9]* ']')
 699+{
 700+ return flatten( a ).join('');
 701+}
 702+
690703 template
691704 = "{{" target:template_param_text
692705 params:(newline? "|" newline? p:template_param { return p })*

Status & tagging log