Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Commit 36ccf90

Browse files
committed
Decaf snippet-body-parser.coffee
1 parent 34da38f commit 36ccf90

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

lib/snippet-body-parser.coffee

Lines changed: 0 additions & 12 deletions
This file was deleted.

lib/snippet-body-parser.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
let parser
2+
try {
3+
parser = require('./snippet-body')
4+
} catch (error) {
5+
const {allowUnsafeEval} = require('loophole')
6+
const fs = require('fs-plus')
7+
const PEG = require('pegjs')
8+
9+
const grammarSrc = fs.readFileSync(require.resolve('./snippet-body.pegjs'), 'utf8')
10+
parser = null
11+
allowUnsafeEval(() => parser = PEG.buildParser(grammarSrc))
12+
}
13+
14+
module.exports = parser

0 commit comments

Comments
 (0)