-
Notifications
You must be signed in to change notification settings - Fork 210
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
upgrade editor to last version and add lang tokens
- Loading branch information
1 parent
3856424
commit 0fc3ae1
Showing
12 changed files
with
597 additions
and
12 deletions.
There are no files selected for viewing
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
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
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
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
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
86 changes: 86 additions & 0 deletions
86
services/app/apps/codebattle/assets/js/widgets/config/editor/haskell.js
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
import tagKeywords from './tagKeywords'; | ||
|
||
export const language = { | ||
tagKeywords, | ||
keywords: [ | ||
'module', | ||
'import', | ||
'main', | ||
'where', | ||
'otherwise', | ||
'newtype', | ||
'definition', | ||
'implementation', | ||
'from', | ||
'class', | ||
'instance', | ||
'abort', | ||
], | ||
|
||
builtintypes: ['Int', 'Real', 'String'], | ||
|
||
operators: [ | ||
'=', | ||
'==', | ||
'>=', | ||
'<=', | ||
'+', | ||
'-', | ||
'*', | ||
'/', | ||
'::', | ||
'->', | ||
'=:', | ||
'=>', | ||
'|', | ||
'$', | ||
], | ||
|
||
numbers: /-?[0-9.]/, | ||
|
||
tokenizer: { | ||
root: [ | ||
{ include: '@whitespace' }, | ||
|
||
[/->/, 'operators'], | ||
|
||
[/\|/, 'operators'], | ||
|
||
[/(\w*)(\s?)(::)/, ['keyword', 'white', 'operators']], | ||
|
||
[/[+\-*/=<>$]/, 'operators'], | ||
|
||
[ | ||
/[a-zA-Z_][a-zA-Z0-9_]*/, | ||
{ | ||
cases: { | ||
'@builtintypes': 'type', | ||
'@keywords': 'keyword', | ||
'@default': '', | ||
}, | ||
}, | ||
], | ||
|
||
[/[()[\],:]/, 'delimiter'], | ||
|
||
[/@numbers/, 'number'], | ||
|
||
[/(")(.*)(")/, ['string', 'string', 'string']], | ||
], | ||
|
||
comment: [ | ||
[/[^/*]+/, 'comment'], | ||
[/\*\//, 'comment', '@pop'], | ||
[/[/*]/, 'comment'], | ||
], | ||
|
||
whitespace: [ | ||
[/[ \t\r\n]+/, 'white'], | ||
[/\/\*/, 'comment', '@comment'], | ||
[/\/\/.*$/, 'comment'], | ||
[/--.*$/, 'comment'], | ||
], | ||
}, | ||
}; | ||
|
||
export default language; |
Oops, something went wrong.