newmember123 / google-code-prettify

Automatically exported from code.google.com/p/google-code-prettify
Apache License 2.0
0 stars 0 forks source link

FLOW_CONTROL_KEYWORDS should not contain `do` #366

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
Visit http://stackoverflow.com/q/28197948/1426065 and look at the code section 
at the bottom of the original question. After the imports, 2 variables are 
assigned:

do = dir_with_original_files = ...
dm = dir_with_modified_files = ...

`do` is highlighted as a keyword, while `dm` is the standard black color. 
Python does not include a `do` keyword, so it should not be highlighted.

What version are you using?  On what browser?

I'm not a Stack Exchange dev, so I don't know what version they're using, but 
looking at the current source online, the issue is still there. I'm using 
Firefox, but I assume this would show up in any browser.

Please provide any additional information below.

In prettify.js line 95 
(https://code.google.com/p/google-code-prettify/source/browse/trunk/src/prettify
.js#95), FLOW_CONTROL_KEYWORDS is defined as 
["break,continue,do,else,for,if,return,while"]. One line 125, PYTHON_KEYWORDS 
is defined as FLOW_CONTROL_KEYWORDS plus a number of others. Many of the other 
languages listed are defined in a similar manner. Since not all languages 
(including Python) have `do` as a keyword, it should be removed from 
FLOW_CONTROL_KEYWORDS and added individually to those languages that define it.

Original issue reported on code.google.com by MatthewD...@gmail.com on 28 Jan 2015 at 7:36