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

查看:154
本文介绍了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?

感谢您提供任何指示!

推荐答案

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天全站免登陆