csharp-parser.js

来自「原名JSPackager」· JavaScript 代码 · 共 25 行

JS
25
字号
function CSharpParser(source){
  this.initialize(source);
}
$JSI.extend(CSharpParser,SourceParser);
//ECMAParser.prototype = new SourceParser();

CSharpParser.prototype.keywordsRegexp = SourceParser.buildKeywordsRegexp(
['abstract','as','base','bool','break','byte','case','catch','char','checked','class','const',
'continue','decimal','default','delegate','do','double','else','enum','event','explicit',
'extern','false','finally','fixed','float','for','foreach','get','goto','if','implicit',
'interface','internal','is','lock','long','namespace','new','null','object','operator',
'override','params','private','protected','public','readonly','ref','return','sbyte','sealed','set',
'short','sizeof','stackalloc','static','string','struct','switch','this','throw','true','try',
'typeof','uint','ulong','unchecked','unsafe','ushort','using','virtual','void','while']
);

CSharpParser.prototype.partitionsRegexp = SourceParser.buildPartitionsRegexp(
[
      '/\\*(?:[^\\*]|\\*[^/])*\\*/'      //muti-comment
      ,'//.*$'                    //single-comment
      ,'"(?:\\\\.|[^"\\n\\r])*"'  //string
      ,"'(?:\\\\.|[^'\\n\\r])*'"  //string : char
      ,'^\\s*#.*'             //process
]);

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?