1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
| | // Body
class Body extends Element
{
...
function parse(& $lines)
{
...
while (!empty($lines))
{
...
// The first character
- $head = $line{0};
+ $head = substr($line,0,1);
+ $head2 = substr($line,0,2);
+
+ // ; Format
+ if ($head2 == ';.') {// SCNF: SemiColon-NoFormat
+ $this->last = & $this->last->add(new Inline(substr($line, 2)));
+ continue;
+ }
+ if ($head2 == ';,') {// SCNL: SemiCcolon-NewLine
+ $this->last = & $this->last->add(new Inline("\r".substr($line, 2))); // Same as Default to Add Text
+ continue;
+ }
+ if ($head2 == ';:') {// SCNP: SemiColon-NewParagraph (Week)
+ $this->last = & $this->last->add(new Paragraph(' '.substr($line, 2))); // Same as ~-Format to Add Paragraph
+ continue;
+ }
+ if ($head2 == ';;') {// SCNP: SemiColon-NewParagraph
+ $this->last = & $this->last->add(new EmptyLine($this->last)); // Same as Empty Line to add Inter-line Space
+ $this->last = & $this->last->add(new Paragraph(' '.substr($line, 2))); // Same as ~-Format to Add Paragraph
+ continue;
+ }
+ if ($head == ';') {// SCNL: SemiCcolon-NewLine // Equal to ($head2 == ';,')
+ $this->last = & $this->last->add(new Inline("\r".substr($line, 1)));
+ continue;
+ }
|