Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Add support for x86 assembly language. #486
Adds a "lang-x86.js" lexer that enables syntax highlighting for Intel x86 assembly language.
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.
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.