mirror of
https://github.com/safiire/n65.git
synced 2024-12-11 08:49:42 +00:00
Linted regexes.rb
This commit is contained in:
parent
9acca01731
commit
d3ed4e81ec
@ -1,15 +1,14 @@
|
||||
|
||||
# frozen_string_literal: true
|
||||
|
||||
module N65
|
||||
|
||||
####
|
||||
## All the regexes used to parse in one module
|
||||
# All the regexes used to parse in one module
|
||||
module Regexes
|
||||
## Mnemonics
|
||||
# rubocop:disable Naming/ConstantName
|
||||
# Mnemonics
|
||||
Mnemonic = '([A-Za-z]{3})'
|
||||
Branches = '(BPL|BMI|BVC|BVS|BCC|BCS|BNE|BEQ|bpl|bmi|bvc|bvs|bcc|bcs|bne|beq)'
|
||||
|
||||
## Numeric Literals
|
||||
# Numeric Literals
|
||||
Hex8 = '\$([A-Fa-f0-9]{1,2})'
|
||||
Hex16 = '\$([A-Fa-f0-9]{3,4})'
|
||||
|
||||
@ -17,17 +16,17 @@ module N65
|
||||
Bin16 = '%([01]{9,16})'
|
||||
|
||||
Num8 = Regexp.union(Regexp.new(Hex8), Regexp.new(Bin8)).to_s
|
||||
Num16 = Regexp.union(Regexp.new(Hex16),Regexp.new(Bin16)).to_s
|
||||
Num16 = Regexp.union(Regexp.new(Hex16), Regexp.new(Bin16)).to_s
|
||||
|
||||
Immediate = "\##{Num8}"
|
||||
|
||||
## Symbols, must begin with a letter, and supports dot syntax
|
||||
# Symbols, must begin with a letter, and supports dot syntax
|
||||
Sym = '([a-zA-Z][a-zA-Z\d_\.]*(?:[\+\-\*\/]\d+)*)'
|
||||
|
||||
|
||||
## The X or Y register
|
||||
# The X or Y register
|
||||
XReg = '[Xx]'
|
||||
YReg = '[Yy]'
|
||||
end
|
||||
|
||||
# rubocop:enable Naming/ConstantName
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user