JavaScript 中的 JavaScript 解析器 [英] JavaScript parser in JavaScript

查看:33
本文介绍了JavaScript 中的 JavaScript 解析器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要向 JavaScript 源代码添加一些轻量级的语法糖,并使用基于 JavaScript 的构建系统对其进行处理.有没有用 JavaScript 编写的开源 JavaScript 解析器?在 V8 或类似的高性能 JavaScript 实现之上运行时,它们是否相当快?

I need to add some lightweight syntactic sugar to JavaScript source code, and process it using a JavaScript-based build system. Are there any open source JavaScript parsers written in JavaScript? And are they reasonably fast when run on top of V8 or a similar high-performance JavaScript implementation?

感谢您提供的任何指点!

Thank you for any pointers you can provide!

推荐答案

Crescent Fresh 在评论中回答了这个问题:

Crescent Fresh answered this question in the comments:

JSLint 包含一个用 JavaScript 编写的 JavaScript 解析器.请参阅 Douglas Crockford 的 JSlint 大约在 2712 行开始解析器.JSLint 被编写为也处理 html,所以你必须掩盖这些部分

JSLint contains a JavaScript parser written in JavaScript. See JSlint by Douglas Crockford Around line 2712 begins the parser. JSLint is written to also handle html so you'd have to gloss over those parts

这篇关于JavaScript 中的 JavaScript 解析器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆