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
Open
Add support for x86 assembly language.#486codygray wants to merge 1 commit intogooglearchive:masterfrom
codygray wants to merge 1 commit intogooglearchive:masterfrom
Conversation
3758cea to
0b0cd14
Compare
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.
Closed
|
Any update for this pull request? If not, then I'll add @codygray 's code to my site manually. Thanks! |
hmenke
approved these changes
Dec 28, 2018
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.