Open GoogleCodeExporter opened 9 years ago
The original problem is identified in that thread. The C# keywords list is
missing keywords 'namespace' 'using' and 'get'
Original comment by sriharshachilakapati@gmail.com
on 23 Jul 2013 at 3:31
This related to issue #283. Currently [the code][1] tries to reduce repetition
by having a list of common keywords and inheriting this list from the various
languages. Unfortunately, a couple of extra keywords slip through, as well as
missing a few specific ones.
I went through this [list][2], and came up with the following (basically I
"unrolled" the list of inherited keywords and removed the extra tokens, while
adding a few missing ones):
var CSHARP_KEYWORDS = [FLOW_CONTROL_KEYWORDS,
"case,char,const,default," +
"double,enum,extern,float,goto,int,long,short," +
"sizeof,static,struct,switch,void,volatile," +
"catch,class,false," +
"new,operator,private,protected,public,this,throw,true,try,typeof," +
"abstract,as,base,bool,byte,checked,decimal,delegate,descending," +
"dynamic,event,finally,fixed,foreach,from,group,implicit,in,interface," +
"internal,into,is,let,lock,null,object,out,override,orderby,params," +
"partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong," +
"unchecked,unsafe,ushort,var,virtual,where," +
"ascending,async,await,explicit,get,global,join,namespace,set,using,yield"];
This should fix the case of the missing keywords you mentioned, along with a
few others. Note that C# has some contextual keywords, meaning that the token
is only considered in certain contexts, which is not possible without a proper
grammatical parsing.
btw, Stack Overflow is apparently not using the latest version of
code-prettify, so it might take some time for you to see the changes over
there..
[1]: http://code.google.com/p/google-code-prettify/source/browse/trunk/src/prettify.js#110
[2]: http://msdn.microsoft.com/en-us/library/x53a06bb.aspx
Original comment by amroamro...@gmail.com
on 4 Aug 2013 at 3:03
Original issue reported on code.google.com by
sriharshachilakapati@gmail.com
on 22 Jul 2013 at 4:53