Chromium Code Reviews| Index: samples/markdown/block_parser.dart |
| =================================================================== |
| --- samples/markdown/block_parser.dart (revision 12654) |
| +++ samples/markdown/block_parser.dart (working copy) |
| @@ -3,39 +3,39 @@ |
| // BSD-style license that can be found in the LICENSE file. |
| /// The line contains only whitespace or is empty. |
| -const _RE_EMPTY = const RegExp(@'^([ \t]*)$'); |
| +final _RE_EMPTY = new RegExp(@'^([ \t]*)$'); |
|
Siggi Cherem (dart-lang)
2012/09/21 00:17:28
why do we need these changes?
dgrove
2012/09/21 00:37:23
Done.
|
| /// A series of `=` or `-` (on the next line) define setext-style headers. |
| -const _RE_SETEXT = const RegExp(@'^((=+)|(-+))$'); |
| +final _RE_SETEXT = new RegExp(@'^((=+)|(-+))$'); |
| /// Leading (and trailing) `#` define atx-style headers. |
| -const _RE_HEADER = const RegExp(@'^(#{1,6})(.*?)#*$'); |
| +final _RE_HEADER = new RegExp(@'^(#{1,6})(.*?)#*$'); |
| /// The line starts with `>` with one optional space after. |
| -const _RE_BLOCKQUOTE = const RegExp(@'^[ ]{0,3}>[ ]?(.*)$'); |
| +final _RE_BLOCKQUOTE = new RegExp(@'^[ ]{0,3}>[ ]?(.*)$'); |
| /// A line indented four spaces. Used for code blocks and lists. |
| -const _RE_INDENT = const RegExp(@'^(?: |\t)(.*)$'); |
| +final _RE_INDENT = new RegExp(@'^(?: |\t)(.*)$'); |
| /// Three or more hyphens, asterisks or underscores by themselves. Note that |
| /// a line like `----` is valid as both HR and SETEXT. In case of a tie, |
| /// SETEXT should win. |
| -const _RE_HR = const RegExp(@'^[ ]{0,3}((-+[ ]{0,2}){3,}|' + |
| - @'(_+[ ]{0,2}){3,}|' + |
| +final _RE_HR = new RegExp(@'^[ ]{0,3}((-+[ ]{0,2}){3,}|' |
| + @'(_+[ ]{0,2}){3,}|' |
| @'(\*+[ ]{0,2}){3,})$'); |
| /// Really hacky way to detect block-level embedded HTML. Just looks for |
| /// "<somename". |
| -const _RE_HTML = const RegExp(@'^<[ ]*\w+[ >]'); |
| +final _RE_HTML = new RegExp(@'^<[ ]*\w+[ >]'); |
| /// A line starting with one of these markers: `-`, `*`, `+`. May have up to |
| /// three leading spaces before the marker and any number of spaces or tabs |
| /// after. |
| -const _RE_UL = const RegExp(@'^[ ]{0,3}[*+-][ \t]+(.*)$'); |
| +final _RE_UL = new RegExp(@'^[ ]{0,3}[*+-][ \t]+(.*)$'); |
| /// A line starting with a number like `123.`. May have up to three leading |
| /// spaces before the marker and any number of spaces or tabs after. |
| -const _RE_OL = const RegExp(@'^[ ]{0,3}\d+\.[ \t]+(.*)$'); |
| +final _RE_OL = new RegExp(@'^[ ]{0,3}\d+\.[ \t]+(.*)$'); |
| /// Maintains the internal state needed to parse a series of lines into blocks |
| /// of markdown suitable for further inline parsing. |