diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2021-04-20 13:59:10 -0400 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2021-04-20 13:59:10 -0400 |
commit | f5bb2118eadc20402e69d575c9be8a02cf673caa (patch) | |
tree | e04d4853e6cdd1a8cf9415b35c800f0c534f9b3d /keywords.py | |
parent | da61efabb1b28c5500824a560c960a720a628de0 (diff) |
HTML syntax highlighting
Diffstat (limited to 'keywords.py')
-rwxr-xr-x | keywords.py | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/keywords.py b/keywords.py index 951f3b2..c8f7e9c 100755 --- a/keywords.py +++ b/keywords.py @@ -216,6 +216,40 @@ builtins_python = ['ArithmeticError', 'AssertionError', 'AttributeError', 'BaseE 'vars', 'zip', ] +attributes_html = [ + 'accept','accept-charset','accesskey','action','align','alt','async', + 'autocomplete','autofocus','autoplay','bgcolor','border','charset', + 'checked','cite','class','color','cols','colspan','content', + 'contenteditable','controls','coords','data','datetime', + 'default','defer','dir','dirname','disabled','download','draggable', + 'enctype','for','form','formaction','headers','height','hidden','high', + 'href','hreflang','http-equiv','id','ismap','kind','label','lang','list', + 'loop','low','max','maxlength','media','method','min','multiple','muted', + 'name','novalidate','onabort','onafterprint','onbeforeprint', + 'onbeforeunload','onblur','oncanplay','oncanplaythrough','onchange', + 'onclick','oncontextmenu','oncopy','oncuechange','oncut','ondblclick', + 'ondrag','ondragend','ondragenter','ondragleave','ondragover','ondragstart', + 'ondrop','ondurationchange','onemptied','onended','onerror','onfocus', + 'onhashchange','oninput','oninvalid','onkeydown','onkeypress','onkeyup', + 'onload','onloadeddata','onloadedmetadata','onloadstart','onmousedown', + 'onmousemove','onmouseout','onmouseover','onmouseup','onmousewheel','onoffline', + 'ononline','onpagehide','onpageshow','onpaste','onpause','onplay','onplaying', + 'onpopstate','onprogress','onratechange','onreset','onresize','onscroll', + 'onsearch','onseeked','onseeking','onselect','onstalled','onstorage', + 'onsubmit','onsuspend','ontimeupdate','ontoggle','onunload','onvolumechange', + 'onwaiting','onwheel','open','optimum','pattern','placeholder','poster', + 'preload','readonly','rel','required','reversed','rows','rowspan','sandbox', + 'scope','selected','shape','size','sizes','span','spellcheck','src','srcdoc', + 'srclang','srcset','start','step','style','tabindex','target', + 'title','translate','type','usemap','value','width','wrap' +] + +assert len(attributes_html) == len(set(attributes_html)) + +builtins_html = [] +for attr in attributes_html: + builtins_html.append(attr + '=') + file = open('keywords.h', 'w') file.write('''// keywords for all languages ted supports // This file was auto-generated by keywords.py @@ -239,4 +273,5 @@ cpp_things.remove((SYNTAX_BUILTIN, 'wchar_t')) output_keywords(file, cpp_things, 'cpp') output_keywords(file, label(keywords_rust, SYNTAX_KEYWORD) + label(builtins_rust, SYNTAX_BUILTIN) + label(constants_rust, SYNTAX_CONSTANT), 'rust') output_keywords(file, label(keywords_python, SYNTAX_KEYWORD) + label(builtins_python, SYNTAX_BUILTIN), 'python') +output_keywords(file, label(builtins_html, SYNTAX_BUILTIN), 'html') file.close() |