Compare commits

..

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

  1. 5
      playground/index.php
  2. 4
      src/Lexer.php
  3. 20
      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))); const fromTop = Math.min(100, Math.max(0, Math.round(top * 100 / height)));
percent.innerHTML = `${fromTop}%`; percent.innerHTML = `${fromTop}%`;
console.log("SCROOLLL", fromTop, height, top);
}); });
}); });
@ -213,9 +215,6 @@
border: none; border: none;
color: #888; color: #888;
} }
.statusbar > * {
margin-left: 0.5rem;
}
#position { #position {
color: dodgerblue; color: dodgerblue;

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

@ -348,18 +348,6 @@ class Parser {
} }
array_push($elms, $obj); 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 } else
$buffer .= self::StripBackslashes($this->consume()->data); $buffer .= self::StripBackslashes($this->consume()->data);
} }
@ -669,11 +657,9 @@ class Parser {
$this->parseHeading(); $this->parseHeading();
break; break;
case TokenType::NUMBER: case TokenType::NUMBER:
if ($this->next()->type === TokenType::DOT) { $list = $this->parseList(ListType::ORDERED);
$list = $this->parseList(ListType::ORDERED); $this->document->appendChild($list);
$this->document->appendChild($list); break;
break;
}
case TokenType::BACKTICK: case TokenType::BACKTICK:
$this->parseCodeBlock(); $this->parseCodeBlock();
break; break;

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

Loading…
Cancel
Save