Skip to content

Add a lexer for KickAssembler syntax (6502 assembly)#2262

Merged
jneen merged 3 commits intorouge-ruby:mainfrom
lkdjiin:kickass
Apr 1, 2026
Merged

Add a lexer for KickAssembler syntax (6502 assembly)#2262
jneen merged 3 commits intorouge-ruby:mainfrom
lkdjiin:kickass

Conversation

@lkdjiin
Copy link
Copy Markdown
Contributor

@lkdjiin lkdjiin commented Mar 31, 2026

Hello,

Kick assembler is used mainly for writing assembly for the Commodore 64.
If you need some reference, it's here : https://www.theweb.dk/KickAssembler/KickAssembler.pdf

rule %r/\.\w+/i do |m|
if m[0] == '.const'
token Keyword::Constant
elsif m[0] =~ /^\.(for|while|macro|function|pseudopc|pseudocommand)$/i
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It is probably best to use the /o flag on a regex in this context, to avoid compiling a regex at match time. But perhaps this could just be a statically defined Set somewhere?

@jneen
Copy link
Copy Markdown
Member

jneen commented Apr 1, 2026

LGTM otherwise, thanks for the lexer!

@jneen
Copy link
Copy Markdown
Member

jneen commented Apr 1, 2026

Also, would you mind putting the reference link in a comment in the lexer?

@jneen jneen added this pull request to the merge queue Apr 1, 2026
Merged via the queue into rouge-ruby:main with commit 87891be Apr 1, 2026
10 checks passed
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.

2 participants