This commit is contained in:
marihachi 2020-02-01 16:10:25 +09:00
parent 303ba2827a
commit 8884fde58b
7 changed files with 15 additions and 9 deletions

2
.gitignore vendored
View file

@ -1,4 +1,6 @@
node_modules
built
package-lock.json
temp
syuilo-parser*

View file

@ -6,8 +6,8 @@
"scripts": {
"build": "npm run peg && npm run tsc && npm run webpack",
"build-dev": "npm run peg-dev && npm run tsc && npm run webpack-dev",
"peg": "mkdirp ./built/parser && pegjs -o built/parser/coreParser.js src/parser/coreParser.pegjs",
"peg-dev": "mkdirp ./built/parser && pegjs -o built/parser/coreParser.js --trace src/parser/coreParser.pegjs",
"peg": "mkdirp ./built/parser && pegjs -o built/parser/core-parser.js src/parser/core-parser.pegjs",
"peg-dev": "mkdirp ./built/parser && pegjs -o built/parser/core-parser.js --trace src/parser/core-parser.pegjs",
"tsc": "tsc",
"webpack": "webpack --mode=production",
"webpack-dev": "webpack --mode=development",
@ -26,5 +26,9 @@
"typescript": "3.7.x",
"webpack": "4.40.x",
"webpack-cli": "3.3.x"
},
"dependencies": {
"@types/parsimmon": "^1.10.1",
"parsimmon": "^1.13.0"
}
}

View file

@ -1,13 +1,13 @@
import { PegParser } from '../parser/pegParser';
import { PegParser } from '../parser/peg-parser';
async function entryPoint() {
const coreParser: PegParser = require('../../built/parser/coreParser.js');
const coreParser: PegParser = require('../../built/parser/core-parser.js');
const input = '[hoge]';
console.log('parsing input:', input);
const result = coreParser.parse(input);
console.log('parsing result:');
console.log(result);
console.log(JSON.stringify(result));
}
entryPoint()
.catch(err => console.log(err));

View file

@ -1,8 +1,8 @@
import { PegParser } from './parser/pegParser';
import { PegParser } from './parser/peg-parser';
const coreParser: PegParser = require('./parser/coreParser');
const coreParser: PegParser = require('./parser/core-parser');
const input = '[hoge]';
console.log('parsing input:', input);
const result = coreParser.parse(input);
console.log('parsing result:');
console.log(result);
console.log(JSON.stringify(result));

View file

@ -1,5 +1,5 @@
module.exports = {
entry: './src/client/mainEntry.ts',
entry: './src/client/main-entry.ts',
output: {
path: `${__dirname}/built/client`,
publicPath: '/', // base path of URL