Compare commits

..

No commits in common. '21713e220942c49d20b9cb3b27597cafcaddcc4b' and 'af619634409a6542cf8eb0e2281e0ac089620adc' have entirely different histories.

  1. 5
      playground/index.php
  2. 4
      src/Lexer.php
  3. 14
      src/Parser.php
  4. 1
      src/Token.php

@ -91,6 +91,8 @@
const fromTop = Math.min(100, Math.max(0, Math.round(top * 100 / height)));
percent.innerHTML = `${fromTop}%`;
console.log("SCROOLLL", fromTop, height, top);
});
});
@ -213,9 +215,6 @@
border: none;
color: #888;
}
.statusbar > * {
margin-left: 0.5rem;
}
#position {
color: dodgerblue;

@ -119,10 +119,6 @@ class Lexer {
$clearBuffer();
array_push($tokens, new Token(TokenType::RBRACE, $char, [$col, $row, $this->fileName]));
break;
case ' ':
$clearBuffer();
array_push($tokens, new Token(TokenType::SPACE, $char, [$col, $row, $this->fileName]));
break;
default:
$buffer .= $char;
break;

@ -348,18 +348,6 @@ class Parser {
}
array_push($elms, $obj);
} elseif ($this->current()->type === TokenType::SPACE) { // do linebreak when two spaces are at the EOL
if ($this->last()->type === TokenType::SPACE && $this->next()->type === TokenType::EOL) {
$this->consume();
$clearBuffer();
$elm = $this->document->createElement("br");
array_push($elms, $elm);
continue;
} else {
$this->consume();
$buffer .= " ";
}
} else
$buffer .= self::StripBackslashes($this->consume()->data);
}
@ -669,11 +657,9 @@ class Parser {
$this->parseHeading();
break;
case TokenType::NUMBER:
if ($this->next()->type === TokenType::DOT) {
$list = $this->parseList(ListType::ORDERED);
$this->document->appendChild($list);
break;
}
case TokenType::BACKTICK:
$this->parseCodeBlock();
break;

@ -24,7 +24,6 @@ enum TokenType {
case TAB ;
case LBRACE ;
case RBRACE ;
case SPACE ;
}
class Token {

Loading…
Cancel
Save