This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| interface TokenDefinition { | |
| categories?: string[]; | |
| name: string; | |
| regex: RegExp; | |
| ignore?: true; | |
| parse?: (...args: string[]) => any; | |
| } | |
| interface PrecedenceLevelDefinition { | |
| operators: string[]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // dependence: got, cheerio, tough | |
| // haven't complete | |
| // haven't fully tested | |
| const got = require("got").default; | |
| const cheerio = require("cheerio"); | |
| const tough = require("tough-cookie"); | |
| const nodeUrl = require("url"); | |
| async function fetchAsDOM(client, url) { | |
| return cheerio.load((await client.get(url, { responseType: "text" })).body); |