Skip to content

Commit

Permalink
support for \r ; tag 0.0.6
Browse files Browse the repository at this point in the history
  • Loading branch information
tiye committed Aug 23, 2022
1 parent 8e3004a commit 2d4ac8c
Show file tree
Hide file tree
Showing 4 changed files with 1,425 additions and 1,781 deletions.
5 changes: 3 additions & 2 deletions example/main.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import ReactDOM from "react-dom";
import { createRoot } from "react-dom/client";
import React from "react";

import "./main.css";

import Container from "./pages/container";

const renderApp = (Container) => {
ReactDOM.render(<Container router={{}} />, document.querySelector(".app"));
let root = createRoot(document.querySelector(".app"));
root.render(<Container router={{}} />);
};

window.onload = (e) => renderApp(Container);
Expand Down
30 changes: 15 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cirru/parser.ts",
"version": "0.0.5",
"version": "0.0.6",
"description": "Cirru Parser in TypeScript",
"main": "lib/index.js",
"scripts": {
Expand All @@ -17,20 +17,20 @@
"author": "",
"license": "MIT",
"devDependencies": {
"@emotion/css": "^11.1.3",
"@types/jest": "^27.0.2",
"@types/node": "^16.10.3",
"@types/react": "^17.0.27",
"@types/react-dom": "^17.0.9",
"dayjs": "^1.10.7",
"jest": "^27.2.4",
"prettier": "^2.4.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"ts-jest": "^27.0.5",
"typescript": "^4.4.3",
"typescript-styled-plugin": "^0.18.1",
"vite": "^2.6.3"
"@emotion/css": "^11.10.0",
"@types/jest": "^28.1.7",
"@types/node": "^18.7.11",
"@types/react": "^18.0.17",
"@types/react-dom": "^18.0.6",
"dayjs": "^1.11.5",
"jest": "^28.1.3",
"prettier": "^2.7.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"ts-jest": "^28.0.8",
"typescript": "^4.7.4",
"typescript-styled-plugin": "^0.18.2",
"vite": "^3.0.9"
},
"dependencies": {}
}
5 changes: 4 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,9 @@ let lex = (initialCode: string) => {
case "n":
[acc, state, buffer] = [acc, ELexState.string, `${buffer}\n`];
break;
case "r":
[acc, state, buffer] = [acc, ELexState.string, `${buffer}\r`];
break;
case "\\":
[acc, state, buffer] = [acc, ELexState.string, `${buffer}\\`];
break;
Expand All @@ -191,7 +194,7 @@ let lex = (initialCode: string) => {
[acc, state, buffer] = [acc, ELexState.string, `${buffer}\\u`];
break;
default:
throw new Error(`Unknown ${c} in escape`);
throw new Error(`Unknown \\${c} in escape`);
}
break;
case ELexState.indent:
Expand Down
Loading

0 comments on commit 2d4ac8c

Please sign in to comment.