Skip to content
This repository was archived by the owner on Apr 22, 2020. It is now read-only.

Add support for x86 assembly language.#486

Open
codygray wants to merge 1 commit intogooglearchive:masterfrom
codygray:master
Open

Add support for x86 assembly language.#486
codygray wants to merge 1 commit intogooglearchive:masterfrom
codygray:master

Conversation

@codygray
Copy link
Copy Markdown

@codygray codygray commented May 3, 2017

Adds a "lang-x86.js" lexer that enables syntax highlighting for Intel x86 assembly language.
(See commit description and/or comments in file for additional information.)

Although I am not an experienced JavaScript developer, nor do I have much experience with writing regular expressions, I did have this code reviewed by the Stack Exchange community (https://codereview.stackexchange.com/questions/152836/adding-x86-assembly-language-syntax-highlighting-to-google-prettify) and received positive feedback.

I have made a few changes since then, optimizing the code for performance, and I have been very happy with the results in my own personal use. I'd like to get this merged into the master repository so others can start using it, too!

I have a Google Individual Contributor License Agreement on file for this email address already. Please let me know if there's anything else I need to do or change.

@codygray codygray force-pushed the master branch 3 times, most recently from 3758cea to 0b0cd14 Compare May 3, 2017 11:53
Adds a "lang-x86.js" lexer that enables syntax highlighting for
Intel x86 assembly language. This language handler supports
both Intel/MASM and AT&T/GAS syntax, and calls itself "x86"
(not the somewhat more obvious "asm", since there are
other architectures with their own assembly languages
that this library may eventually want to support, also).

Also added a few rudimentary tests. I have a more complete
test harness for this, but I didn't want to overload the standard
tests. Comprehensively testing this language module is
difficult, because it needs to support so many different styles
of syntax. (These could be broken up into different modules,
but I prefer having them all under one heading for the
convenience of the user at the expense of some difficulty
and/or complexity in the implementation.)

Note that the regexes have been heavily optimized, particularly
those for matching the vast array of instruction mnemonics.
Although this had the unfortunate effect of obfuscating the code,
the Safari web inspector shows it cut the render time in half.
@doyler
Copy link
Copy Markdown

doyler commented Jun 30, 2018

Any update for this pull request? If not, then I'll add @codygray 's code to my site manually.

Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants