Merge pull request #19 from ProbablyNotArtyom/master
Various fixes for the Kick Assembler grammar
This commit is contained in:
commit
e387111185
|
@ -36,8 +36,12 @@ repository:
|
||||||
# ===============================================================
|
# ===============================================================
|
||||||
# Assembler symbols
|
# Assembler symbols
|
||||||
{ # Labels
|
{ # Labels
|
||||||
|
match: '^\\s*[a-zA-Z_][a-zA-Z0-9_]*:'
|
||||||
|
name: 'entity.name.function.kickass'
|
||||||
|
}
|
||||||
|
{ # Local labels
|
||||||
|
match: '!(:|[\\+\\-]+)'
|
||||||
name: 'entity.name.function.kickass'
|
name: 'entity.name.function.kickass'
|
||||||
match: '^\\s*[!a-zA-Z_][a-zA-Z0-9_]*:'
|
|
||||||
}
|
}
|
||||||
{ # Variable functions, like var.getValue()
|
{ # Variable functions, like var.getValue()
|
||||||
match: '(\\w+(?=\\())'
|
match: '(\\w+(?=\\())'
|
||||||
|
@ -51,9 +55,9 @@ repository:
|
||||||
name: 'string.char.kickass'
|
name: 'string.char.kickass'
|
||||||
}
|
}
|
||||||
{ # Strings
|
{ # Strings
|
||||||
name: 'string.quoted.kickass'
|
|
||||||
begin: '"'
|
begin: '"'
|
||||||
end: '"'
|
end: '"'
|
||||||
|
name: 'string.quoted.kickass'
|
||||||
}
|
}
|
||||||
|
|
||||||
{ # Hex numbers
|
{ # Hex numbers
|
||||||
|
@ -62,27 +66,22 @@ repository:
|
||||||
}
|
}
|
||||||
{ # Octals
|
{ # Octals
|
||||||
match: '@([0-7]+)\\b'
|
match: '@([0-7]+)\\b'
|
||||||
name: 'constant.numeric.octal.merlin'
|
name: 'constant.numeric.octal.kickass'
|
||||||
}
|
}
|
||||||
{ # Binary numbers
|
{ # Binary numbers
|
||||||
match: '%[01]+'
|
match: '%[01]+'
|
||||||
name: 'constant.numeric.binary.merlin'
|
name: 'constant.numeric.binary.kickass'
|
||||||
}
|
}
|
||||||
{ # Decimal numbers
|
{ # Decimal numbers
|
||||||
match: '\\b([0-9]+)\\b'
|
match: '\\b([0-9]+)\\b'
|
||||||
name: 'constant.numeric.decimal.merlin'
|
name: 'constant.numeric.decimal.kickass'
|
||||||
}
|
|
||||||
|
|
||||||
{ # Operators
|
|
||||||
match: '[-+/*^><|#\\[\\](),=.!&]'
|
|
||||||
name: 'keyword.operator.kickass'
|
|
||||||
}
|
}
|
||||||
{ # Immediate values
|
{ # Immediate values
|
||||||
match: '\\#(\'.\'|[^\\s\']+)'
|
match: '\\#([^\\s]+)'
|
||||||
name: 'constant.numeric.hex.kickass'
|
name: 'constant.numeric.hex.kickass'
|
||||||
}
|
}
|
||||||
{ # Constants
|
{ # Constants
|
||||||
match: '\\b([_A-Z]+)\\b'
|
match: '\\b([_A-Z][_A-Z0-9]+)\\b'
|
||||||
name: 'variable.kickass'
|
name: 'variable.kickass'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -139,7 +138,7 @@ repository:
|
||||||
# ===============================================================
|
# ===============================================================
|
||||||
# Variables and Macros
|
# Variables and Macros
|
||||||
{
|
{
|
||||||
match: '(\\.)(var|eval|const|label)(\\s*[a-zA-Z0-9_]*)(\\s*=)'
|
match: '(\\.)(var|eval|const|label)(\\s*[a-zA-Z0-9_]*)(\\s*=)?'
|
||||||
captures:
|
captures:
|
||||||
1: name: 'keyword.control.directive.kickass'
|
1: name: 'keyword.control.directive.kickass'
|
||||||
2: name: 'keyword.control.directive.kickass'
|
2: name: 'keyword.control.directive.kickass'
|
||||||
|
@ -147,11 +146,10 @@ repository:
|
||||||
4: name: 'keyword.operator.kickass'
|
4: name: 'keyword.operator.kickass'
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
match: '(\\.)(var|eval|const|label)(\\s*[a-zA-Z0-9_]*)'
|
match: '(?:\\()(var|eval|const|label)(?=\\s*[a-zA-Z0-9_]*)'
|
||||||
captures:
|
captures:
|
||||||
1: name: 'keyword.control.directive.kickass'
|
1: name: 'keyword.control.directive.kickass'
|
||||||
2: name: 'keyword.control.directive.kickass'
|
2: name: 'support.function.kickass'
|
||||||
3: name: 'support.function.kickass'
|
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
match: '(\\.)(function|macro)([\\s\\w_.]*)(\\()([^)]*)(\\))'
|
match: '(\\.)(function|macro)([\\s\\w_.]*)(\\()([^)]*)(\\))'
|
||||||
|
|
Loading…
Reference in New Issue