语法高亮规则和定义 [英] Syntax highlighting rules and definitions

查看:62
本文介绍了语法高亮规则和定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

R 是否有任何标准的语法高亮规则?如果有,在哪里可以找到?

Are there any standard syntax highlighting rules for R? If yes, where can they be found?

还是每个编辑器、IDE、包(例如,highlight 包)创建自己的规则集?

Or does each editor, IDE, package (e.g., the highlight package) create their own rule set?

推荐答案

每个编辑器都会创建自己的规则集.由于历史原因,每个编辑器都以自己的方式实现了语法高亮.例如,使用 GeSHi 可能有一个跨编辑器标准,但几乎可以肯定,要让编辑器制作者付出很多努力注册,特别是如果他们已经拥有自己的系统.

Each editor creates their own rule set. For historical reasons, each editor has implemented syntax highlighting in its own way. Having a cross-editor standard may be possible using, for example, GeSHi, but it would almost certainly require a lot of effort getting editor makers to sign up to it, especially if they already have their own system.

Eclipse 使用 .hrc 文件来存储语法信息.
RStudio 有一个名为 r_highlight.html 的文件.
Notepad++ 将不同语言的关键字存储在名为 langs.model.xml 的文件中.
Textpad 有自己的.syn 格式用于代码高亮显示.
TextWrangler 有一个插件.

Eclipse uses .hrc files for storing syntax information.
RStudio has a file called r_highlight.html.
Notepad++ stores keywords for different languages in a file named langs.model.xml.
Textpad has its own .syn format for the code highlighting.
TextWrangler has a plugin.

这篇关于语法高亮规则和定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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