Created
February 25, 2017 21:07
-
-
Save Zegnat/e588ca858337e60ae43e408667142e31 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CodeMirror.defineSimpleMode('human_resource_machine', { | |
// The start state contains the rules that are intially used | |
start: [ | |
// Possible header. | |
{ | |
regex: /^-- HUMAN RESOURCE MACHINE PROGRAM --$/, | |
token: 'string' | |
}, | |
// Comment definition. | |
{ | |
regex: /^(DEFINE COMMENT)( )(\d+)$/, | |
token: ['keyword', null, 'number'], | |
next: 'comment' | |
}, | |
// Commands. | |
{ | |
regex: /([A-Z]+)( +)([0-9a-z]+)?/, | |
token: ['keyword', null, 'number'] | |
} | |
], | |
// The comment block. | |
comment: [ | |
{regex: /;$/, token: 'comment', next: 'start'}, | |
{regex: /[^;]*/, token: 'comment'} | |
] | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment