move the parser to the internal dir

This commit is contained in:
marihachi 2021-06-12 12:10:07 +09:00
parent 07f6d94e4e
commit 0733b1e06f
4 changed files with 6 additions and 6 deletions

View file

@ -7,8 +7,8 @@
"scripts": { "scripts": {
"build": "npm run tsc && npm run peg", "build": "npm run tsc && npm run peg",
"build-debug": "npm run tsc && npm run peg-debug", "build-debug": "npm run tsc && npm run peg-debug",
"peg": "peggy --cache -o built/parser.js --allowed-start-rules fullParser,inlineParser,plainParser src/parser.pegjs", "peg": "peggy --cache -o built/internal/parser.js --allowed-start-rules fullParser,inlineParser,plainParser src/internal/parser.pegjs",
"peg-debug": "peggy --cache -o built/parser.js --allowed-start-rules fullParser,inlineParser,plainParser --trace src/parser.pegjs", "peg-debug": "peggy --cache -o built/internal/parser.js --allowed-start-rules fullParser,inlineParser,plainParser --trace src/internal/parser.pegjs",
"tsc": "tsc", "tsc": "tsc",
"tsd": "tsd", "tsd": "tsd",
"parse": "node ./built/cli/parse", "parse": "node ./built/cli/parse",

View file

@ -1,8 +1,8 @@
import peg from 'peggy'; import peg from 'peggy';
import { MfmNode, MfmPlainNode } from './node'; import { MfmNode, MfmPlainNode } from './node';
import { stringifyNode, stringifyTree, inspectOne } from './util'; import { stringifyNode, stringifyTree, inspectOne } from './internal/util';
const parser: peg.Parser = require('./parser'); const parser: peg.Parser = require('./internal/parser');
/** /**
* Generates a MfmNode tree from the MFM string. * Generates a MfmNode tree from the MFM string.

View file

@ -22,7 +22,7 @@
LINK, LINK,
FN, FN,
TEXT TEXT
} = require('./node'); } = require('../node');
const { const {
mergeText, mergeText,

View file

@ -1,4 +1,4 @@
import { isMfmBlock, MfmNode, TEXT } from './node'; import { isMfmBlock, MfmNode, TEXT } from '../node';
export function mergeText(nodes: (MfmNode | string)[]): MfmNode[] { export function mergeText(nodes: (MfmNode | string)[]): MfmNode[] {
const dest: MfmNode[] = []; const dest: MfmNode[] = [];