Initial Commit
This commit is contained in:
commit
4bc8cfc7d1
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
.DS_Store
|
||||
npm-debug.log
|
||||
node_modules
|
11
additon.t8
Normal file
11
additon.t8
Normal file
@ -0,0 +1,11 @@
|
||||
LODIP 0,0x13
|
||||
LOADP 1,0
|
||||
ARITI ADD,14,14,1
|
||||
LODIP 0,0x13
|
||||
LOADP 2,0
|
||||
ARITI ADD,14,14,1
|
||||
ARITH ADD,0,1,2
|
||||
STORP 0,0
|
||||
HLT
|
||||
0x6
|
||||
0x9
|
94
grammars/t8-assembly.cson
Normal file
94
grammars/t8-assembly.cson
Normal file
@ -0,0 +1,94 @@
|
||||
# If this is your first time writing a language grammar, check out:
|
||||
# - https://flight-manual.atom.io/hacking-atom/sections/creating-a-grammar/
|
||||
|
||||
'scopeName': 'source.t8-assembly'
|
||||
'name': 'T8 Assembly'
|
||||
'fileTypes': [
|
||||
't8'
|
||||
]
|
||||
'patterns': [
|
||||
{
|
||||
'match': '\\bLOAD\\b'
|
||||
'name': 'keyword.other.masm.load'
|
||||
},
|
||||
{
|
||||
'match': '\\bSTOR\\b'
|
||||
'name': 'keyword.other.masm.stor'
|
||||
},
|
||||
{
|
||||
'match': '\\bLOADP\\b'
|
||||
'name': 'keyword.other.masm.loadp'
|
||||
},
|
||||
{
|
||||
'match': '\\bSTORP\\b'
|
||||
'name': 'keyword.other.masm.storp'
|
||||
},
|
||||
{
|
||||
'match': '\\bLODI\\b'
|
||||
'name': 'keyword.other.masm.lodi'
|
||||
},
|
||||
{
|
||||
'match': '\\bLODIP\\b'
|
||||
'name': 'keyword.other.masm.lodip'
|
||||
},
|
||||
{
|
||||
'match': '\\bARITH\\b'
|
||||
'name': 'keyword.other.masm.arith'
|
||||
},
|
||||
{
|
||||
'match': '\\bARITI\\b'
|
||||
'name': 'keyword.other.masm.ariti'
|
||||
},
|
||||
{
|
||||
'match': '\\bMOV\\b'
|
||||
'name': 'keyword.other.masm.mov'
|
||||
},
|
||||
{
|
||||
'match': '\\bJMPC\\b'
|
||||
'name': 'keyword.control.masm.jmpc'
|
||||
},
|
||||
{
|
||||
'match': '\\bCALL\\b'
|
||||
'name': 'keyword.control.masm.call'
|
||||
},
|
||||
{
|
||||
'match': '\\bHLT\\b'
|
||||
'name': 'keyword.control.masm.hlt'
|
||||
},
|
||||
{
|
||||
'match': '\\bRET\\b'
|
||||
'name': 'keyword.control.masm.ret'
|
||||
},
|
||||
{
|
||||
'match': '\\bIN\\b'
|
||||
'name': 'keyword.other.masm.in'
|
||||
},
|
||||
{
|
||||
'match': '\\bOUT\\b'
|
||||
'name': 'keyword.other.masm.out'
|
||||
},
|
||||
{
|
||||
'match': '\\bPUSH\\b'
|
||||
'name': 'keyword.other.masm.push'
|
||||
},
|
||||
{
|
||||
'match': '\\bPOP\\b'
|
||||
'name': 'keyword.other.masm.pop'
|
||||
},
|
||||
{
|
||||
'match': "\\bADD\\b"
|
||||
'name': 'keyword.other</scope>.masm.add'
|
||||
},
|
||||
{
|
||||
'match': '#.*'
|
||||
'name': 'comment.line.number-sign'
|
||||
},
|
||||
{
|
||||
'match': '\\b\\d+\\b'
|
||||
'name': 'constant.numeric.masm'
|
||||
},
|
||||
{
|
||||
'match': '\\b0x[0-9a-fA-F]+\\b'
|
||||
'name': 'constant.numeric.masm'
|
||||
}
|
||||
]
|
13
package.json
Normal file
13
package.json
Normal file
@ -0,0 +1,13 @@
|
||||
{
|
||||
"name": "language-t8-assembly",
|
||||
"version": "0.0.0",
|
||||
"description": "This is the atom package for my T8 cpu's assembly language (see pjht/t8)",
|
||||
"keywords": [
|
||||
"language",
|
||||
"grammar"
|
||||
],
|
||||
"repository": "https://github.com/pjht/language-t8-assembly",
|
||||
"engines": {
|
||||
"atom": ">=1.0.0 <2.0.0"
|
||||
}
|
||||
}
|
6
settings/language-t8-assembly.cson
Normal file
6
settings/language-t8-assembly.cson
Normal file
@ -0,0 +1,6 @@
|
||||
# If you want some examples of settings, check out:
|
||||
# https://github.com/atom/language-gfm/blob/master/settings/gfm.cson
|
||||
|
||||
'.source.t8-assembly':
|
||||
'editor':
|
||||
'commentStart': '#'
|
7
snippets/language-t8-assembly.cson
Normal file
7
snippets/language-t8-assembly.cson
Normal file
@ -0,0 +1,7 @@
|
||||
# If you want some example snippets, check out:
|
||||
# https://github.com/atom/language-javascript/blob/master/snippets/javascript.cson
|
||||
|
||||
'.source.t8-assembly':
|
||||
'Method documentation':
|
||||
'prefix': 'doc'
|
||||
'body': '@@ ${1:method} - ${2:description}'
|
16
spec/language-t8-assembly-spec.coffee
Normal file
16
spec/language-t8-assembly-spec.coffee
Normal file
@ -0,0 +1,16 @@
|
||||
# If you want an example of language specs, check out:
|
||||
# https://github.com/atom/language-javascript/blob/master/spec/javascript-spec.coffee
|
||||
|
||||
describe "T8Assembly grammar", ->
|
||||
grammar = null
|
||||
|
||||
beforeEach ->
|
||||
waitsForPromise ->
|
||||
atom.packages.activatePackage("language-t8-assembly")
|
||||
|
||||
runs ->
|
||||
grammar = atom.syntax.grammarForScopeName("source.t8-assembly")
|
||||
|
||||
it "parses the grammar", ->
|
||||
expect(grammar).toBeTruthy()
|
||||
expect(grammar.scopeName).toBe "source.t8-assembly"
|
Loading…
Reference in New Issue
Block a user