Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a lexer for ARM assembly files #1057

Merged
merged 21 commits into from
Jul 30, 2019
Merged

Add a lexer for ARM assembly files #1057

merged 21 commits into from
Jul 30, 2019

Conversation

bavison
Copy link
Contributor

@bavison bavison commented Jan 4, 2019

This is for the syntax used by ARM DS-5, Keil, RealView, ADS, SDT, objasm, asasm and aasm toolchains, which is not the same as that shared by GNU AS and Clang's integrated assembler.

@bavison
Copy link
Contributor Author

bavison commented Jan 4, 2019

I see the CI checks failed. I don't think the failures are my fault, as I experienced the same problem with bundler when I first tried to build rouge. I worked around it with "gem install bundler -v 1.15".

This is my first ever attempt at Ruby, so I can't really help more than this, sorry!

lib/rouge/lexers/armasm.rb Outdated Show resolved Hide resolved
lib/rouge/lexers/armasm.rb Outdated Show resolved Hide resolved
lib/rouge/lexers/armasm.rb Outdated Show resolved Hide resolved
lib/rouge/lexers/armasm.rb Outdated Show resolved Hide resolved
@pyrmont
Copy link
Contributor

pyrmont commented Jun 12, 2019

@bavison Sorry it's taken so long to get onto this :(

I've submitted some comments on the code. Hopefully it all makes sense but of course feel free to ask if anything is unclear.

I'd also recommend rebasing against the current master. If you do that, Travis will be able to build and perform the CI checks.

@pyrmont pyrmont added author-action The PR has been reviewed but action by the author is needed and removed needs-review The PR needs to be reviewed labels Jun 12, 2019
@bavison
Copy link
Contributor Author

bavison commented Jul 23, 2019

Try as I might, I couldn't figure out the syntax for array-of-keywords-as-method. Hope this will do instead.

@pyrmont pyrmont added needs-review The PR needs to be reviewed and removed author-action The PR has been reviewed but action by the author is needed labels Jul 23, 2019
@pyrmont
Copy link
Contributor

pyrmont commented Jul 24, 2019

@bavison Thank you for all the effort so far!

I hope you don't mind but I've taken the liberty of force pushing an update to your branch. I felt bad because I was mistaken about the whole self.class.keywords thing and rather than ask you to redo it with the correct suggestion (it should be ArmAsm.keywords) I thought I'd save you the effort. I also wanted to get it passing Travis' tests. And then, well, once I was already poking around in there, I thought I'd simplify some of the rules using a few metacharacters.

Copy link
Contributor

@pyrmont pyrmont left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some questions about the revised lexer:

lib/rouge/lexers/armasm.rb Outdated Show resolved Hide resolved
lib/rouge/lexers/armasm.rb Outdated Show resolved Hide resolved
@pyrmont pyrmont added author-action The PR has been reviewed but action by the author is needed and removed needs-review The PR needs to be reviewed labels Jul 24, 2019
@bavison
Copy link
Contributor Author

bavison commented Jul 25, 2019

@pyrmont Thanks very much for all those polishing touches. I've looked through them all and they make sense - lots of handy advanced features that I'll have to remember for future use.

In fact, I reckon you've actually improved its capabilties by merging the first two states, because it can now colour labels that are made up partially using variable substitution, for example

EntryPoint$number  ROUT

pyrmont and others added 2 commits July 27, 2019 04:56
These two preprocessor statements have no parameters, so do not require
following spaces.
@pyrmont pyrmont merged commit b4fe9f1 into rouge-ruby:master Jul 30, 2019
@pyrmont
Copy link
Contributor

pyrmont commented Jul 30, 2019

Thanks @bavison :) This was a lot of work but I think it's in pretty good shape now!

@pyrmont pyrmont removed the author-action The PR has been reviewed but action by the author is needed label Jul 30, 2019
@bavison
Copy link
Contributor Author

bavison commented Jul 30, 2019

Thanks for hand-holding me through the process. Hopefully the other lexers I've submitted have started from closer to their final form as a result!

@pyrmont
Copy link
Contributor

pyrmont commented Jul 30, 2019

@bavison Thanks for all the submissions! Always good to see Rogue highlight more languages :)

bavison added a commit to bavison/rouge that referenced this pull request Sep 9, 2019
This commit adds a lexer for ARM assembly code. This is for the syntax 
used by ARM DS-5, Keil, RealView, ADS, SDT, objasm, asasm and aasm 
toolchains and is **not** the same as that shared by GNU AS and Clang's 
integrated assembler.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants