python语法错误检查,ace编辑器中的Python语法检查

What I am trying to develop is a web-environment app which will let user write and syntax check his own python code. To the moment, I have embedded ACE editor to my app using the python mode. My problem is that ace does not include a javascript lib for python syntax check in order to implement it by using workers as described here How to integrate syntax check in Ace Editor using custom mode?.

Through my search I have found modules like pyflakes or pylint. for syntax check which are both written in python.

The options of using an online checker, or connecting to the server in order to execute the check do not work for me since the scenario of my app is to provide python syntax check (even without internet connection) while writing on ace.

So, what I am asking is if there is a syntax checker for python that could be used along with a web embedded ace editor?

Thanks

解决方案

https://github.com/ajaxorg/ace/pull/1174 may be somewhat helpful, as it has python2 lexer compiled to javascript with emscripten, and can show basic errors.

It may be possible to create a more full featured version by compiling pylint to javascript, but all python->js compilers i know are too limited, and compiling whole python to webassembly may result in too big bundle.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值