|
|
|
@ -9,14 +9,16 @@ import IRichLanguageConfiguration = monaco.languages.LanguageConfiguration;
|
|
|
|
|
import ILanguage = monaco.languages.IMonarchLanguage;
|
|
|
|
|
|
|
|
|
|
export const conf: IRichLanguageConfiguration = {
|
|
|
|
|
comments: {
|
|
|
|
|
lineComment: '*',
|
|
|
|
|
},
|
|
|
|
|
brackets: [
|
|
|
|
|
['[', ']'],
|
|
|
|
|
['(', ')']
|
|
|
|
|
],
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const language = <ILanguage> {
|
|
|
|
|
defaultToken: 'invalid',
|
|
|
|
|
ignoreCase: true,
|
|
|
|
|
tokenPostfix: '.abap',
|
|
|
|
|
|
|
|
|
|
keywords: [
|
|
|
|
|
const abapKeywords = [
|
|
|
|
|
'abstract','add','add-corresponding','adjacent','alias','aliases','all','append','appending','ascending','as','assert','assign','assigned','assigning','association','authority-check',
|
|
|
|
|
'back','begin','binary','block','bound','break-point','by','byte',
|
|
|
|
|
'class', 'call','cast','changing','check','class-data','class-method','class-methods','clear','close','cnt','collect','commit','cond','character',
|
|
|
|
@ -49,7 +51,13 @@ export const language = <ILanguage> {
|
|
|
|
|
'at','case','catch','continue','do','elseif','else','endat','endcase','enddo','endif','endloop','endon','if','loop','on','raise','try',
|
|
|
|
|
'abs','sign','ceil','floor','trunc','frac','acos','asin','atan','cos','sin','tan','cosh','sinh','tanh','exp','log','log10','sqrt','strlen','xstrlen','charlen','lines','numofchar','dbmaxlen','round','rescale','nmax','nmin','cmax','cmin','boolc','boolx','xsdbool','contains','contains_any_of','contains_any_not_of','matches','line_exists','ipow','char_off','count','count_any_of','count_any_not_of','distance','condense','concat_lines_of','escape','find','find_end','find_any_of','find_any_not_of','insert','match','repeat','replace','reverse','segment','shift_left','shift_right','substring','substring_after','substring_from','substring_before','substring_to','to_upper','to_lower','to_mixed','from_mixed','translate','bit-set','line_index',
|
|
|
|
|
'definition','implementation','public','inheriting','final'
|
|
|
|
|
],
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
export const language = <ILanguage> {
|
|
|
|
|
defaultToken: 'invalid',
|
|
|
|
|
ignoreCase: true,
|
|
|
|
|
tokenPostfix: '.abap',
|
|
|
|
|
keywords: abapKeywords,
|
|
|
|
|
|
|
|
|
|
typeKeywords: [
|
|
|
|
|
'abap_bool','string','xstring','any','clike','csequence','numeric',
|
|
|
|
@ -79,23 +87,24 @@ export const language = <ILanguage> {
|
|
|
|
|
[/@symbols/, { cases: { '@operators': 'operator',
|
|
|
|
|
'@default' : '' } } ],
|
|
|
|
|
|
|
|
|
|
[/'/, { token: 'string.quote', bracket: '@open', next: '@string' } ],
|
|
|
|
|
[/\|/, { token: 'string.quote', bracket: '@open', next: '@stringtemplate' } ],
|
|
|
|
|
[/'/, { token: 'string', bracket: '@open', next: '@string' } ],
|
|
|
|
|
[/\|/, { token: 'string', bracket: '@open', next: '@stringtemplate' } ],
|
|
|
|
|
|
|
|
|
|
[/\d+/, 'number'],
|
|
|
|
|
],
|
|
|
|
|
|
|
|
|
|
stringtemplate: [
|
|
|
|
|
[/[^\\\|]+/, 'string'],
|
|
|
|
|
[/\|/, { token: 'string.quote', bracket: '@close', next: '@pop' } ]
|
|
|
|
|
[/\|/, { token: 'string', bracket: '@close', next: '@pop' } ]
|
|
|
|
|
],
|
|
|
|
|
|
|
|
|
|
string: [
|
|
|
|
|
[/[^\\']+/, 'string'],
|
|
|
|
|
[/'/, { token: 'string.quote', bracket: '@close', next: '@pop' } ]
|
|
|
|
|
[/'/, { token: 'string', bracket: '@close', next: '@pop' } ]
|
|
|
|
|
],
|
|
|
|
|
|
|
|
|
|
whitespace: [
|
|
|
|
|
[/[ \t\r\n]+/, ''],
|
|
|
|
|
[/^\*.*$/, 'comment'],
|
|
|
|
|
[/\".*$/, 'comment'],
|
|
|
|
|
],
|
|
|
|
|