mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 13:55:41 +01:00
Update ABAP syntax (#1)
General update to ABAP 7.55 syntax, bug fixes, enhancements
This commit is contained in:
parent
1b8581c9aa
commit
b39800cf5e
2 changed files with 1377 additions and 956 deletions
|
|
@ -40,7 +40,7 @@ testTokenization('abap', [
|
|||
{ startIndex: 2, type: '' },
|
||||
{ startIndex: 3, type: 'number.abap' },
|
||||
{ startIndex: 4, type: '' },
|
||||
{ startIndex: 5, type: 'operator.abap' },
|
||||
{ startIndex: 5, type: 'key.abap' },
|
||||
{ startIndex: 6, type: '' },
|
||||
{ startIndex: 7, type: 'number.abap' },
|
||||
{ startIndex: 8, type: 'delimiter.abap' }
|
||||
|
|
@ -121,7 +121,7 @@ testTokenization('abap', [
|
|||
{ startIndex: 6, type: '' },
|
||||
{ startIndex: 7, type: 'keyword.abap' },
|
||||
{ startIndex: 9, type: '' },
|
||||
{ startIndex: 10, type: 'operator.abap' },
|
||||
{ startIndex: 10, type: 'keyword.abap' },
|
||||
{ startIndex: 13, type: '' },
|
||||
{ startIndex: 14, type: 'keyword.abap' },
|
||||
{ startIndex: 21, type: 'delimiter.abap' }
|
||||
|
|
@ -156,11 +156,11 @@ testTokenization('abap', [
|
|||
tokens: [
|
||||
{ startIndex: 0, type: 'identifier.abap' },
|
||||
{ startIndex: 3, type: '' },
|
||||
{ startIndex: 4, type: 'operator.abap' },
|
||||
{ startIndex: 4, type: 'key.abap' },
|
||||
{ startIndex: 5, type: '' },
|
||||
{ startIndex: 6, type: 'keyword.abap' },
|
||||
{ startIndex: 10, type: '' },
|
||||
{ startIndex: 11, type: 'operator.abap' },
|
||||
{ startIndex: 11, type: 'key.abap' },
|
||||
{ startIndex: 12, type: 'delimiter.parenthesis.abap' },
|
||||
{ startIndex: 13, type: '' },
|
||||
{ startIndex: 14, type: 'number.abap' },
|
||||
|
|
@ -178,7 +178,7 @@ testTokenization('abap', [
|
|||
{ startIndex: 5, type: '' },
|
||||
{ startIndex: 6, type: 'identifier.abap' },
|
||||
{ startIndex: 9, type: '' },
|
||||
{ startIndex: 12, type: 'identifier.abap' },
|
||||
{ startIndex: 10, type: 'comment.abap' },
|
||||
{ startIndex: 18, type: 'delimiter.abap' }
|
||||
]
|
||||
}
|
||||
|
|
@ -189,7 +189,7 @@ testTokenization('abap', [
|
|||
tokens: [
|
||||
{ startIndex: 0, type: 'keyword.abap' },
|
||||
{ startIndex: 6, type: '' },
|
||||
{ startIndex: 7, type: 'operator.abap' },
|
||||
{ startIndex: 7, type: 'key.abap' },
|
||||
{ startIndex: 8, type: '' },
|
||||
{ startIndex: 9, type: 'keyword.abap' },
|
||||
{ startIndex: 13, type: '' },
|
||||
|
|
@ -197,10 +197,164 @@ testTokenization('abap', [
|
|||
{ startIndex: 19, type: '' },
|
||||
{ startIndex: 20, type: 'keyword.abap' },
|
||||
{ startIndex: 24, type: '' },
|
||||
{ startIndex: 25, type: 'operator.abap' },
|
||||
{ startIndex: 26, type: 'identifier.abap' },
|
||||
{ startIndex: 25, type: 'identifier.abap' },
|
||||
{ startIndex: 29, type: 'delimiter.abap' }
|
||||
]
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
line: 'li = lines( itab ).',
|
||||
tokens: [
|
||||
{ startIndex: 0, type: 'identifier.abap' },
|
||||
{ startIndex: 2, type: '' },
|
||||
{ startIndex: 3, type: 'key.abap' },
|
||||
{ startIndex: 4, type: '' },
|
||||
{ startIndex: 5, type: 'keyword.abap' },
|
||||
{ startIndex: 10, type: 'delimiter.parenthesis.abap' },
|
||||
{ startIndex: 11, type: '' },
|
||||
{ startIndex: 12, type: 'identifier.abap' },
|
||||
{ startIndex: 16, type: '' },
|
||||
{ startIndex: 17, type: 'delimiter.parenthesis.abap' },
|
||||
{ startIndex: 18, type: 'delimiter.abap' }
|
||||
]
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
line: "foo = 'bar' && 'baz'.",
|
||||
tokens: [
|
||||
{ startIndex: 0, type: 'identifier.abap' },
|
||||
{ startIndex: 3, type: '' },
|
||||
{ startIndex: 4, type: 'key.abap' },
|
||||
{ startIndex: 5, type: '' },
|
||||
{ startIndex: 6, type: 'string.abap' },
|
||||
{ startIndex: 11, type: '' },
|
||||
{ startIndex: 12, type: 'key.abap' },
|
||||
{ startIndex: 14, type: '' },
|
||||
{ startIndex: 15, type: 'string.abap' },
|
||||
{ startIndex: 20, type: 'delimiter.abap' }
|
||||
]
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
line: 'DATA num TYPE n.',
|
||||
tokens: [
|
||||
{ startIndex: 0, type: 'keyword.abap' },
|
||||
{ startIndex: 4, type: '' },
|
||||
{ startIndex: 5, type: 'identifier.abap' },
|
||||
{ startIndex: 8, type: '' },
|
||||
{ startIndex: 9, type: 'keyword.abap' },
|
||||
{ startIndex: 13, type: '' },
|
||||
{ startIndex: 14, type: 'type.abap' },
|
||||
{ startIndex: 15, type: 'delimiter.abap' }
|
||||
]
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
line: 'CLASS-METHODS class_constructor.',
|
||||
tokens: [
|
||||
{ startIndex: 0, type: 'keyword.abap' },
|
||||
{ startIndex: 13, type: '' },
|
||||
{ startIndex: 14, type: 'type.abap' },
|
||||
{ startIndex: 31, type: 'delimiter.abap' }
|
||||
]
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
line: 'super->constructor( ).',
|
||||
tokens: [
|
||||
{ startIndex: 0, type: 'type.abap' },
|
||||
{ startIndex: 5, type: 'tag.abap' },
|
||||
{ startIndex: 7, type: 'type.abap' },
|
||||
{ startIndex: 18, type: 'delimiter.parenthesis.abap' },
|
||||
{ startIndex: 19, type: '' },
|
||||
{ startIndex: 20, type: 'delimiter.parenthesis.abap' },
|
||||
{ startIndex: 21, type: 'delimiter.abap' }
|
||||
]
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
line: 'foo->my_method( ).',
|
||||
tokens: [
|
||||
{ startIndex: 0, type: 'identifier.abap' },
|
||||
{ startIndex: 3, type: 'tag.abap' },
|
||||
{ startIndex: 5, type: 'identifier.abap' },
|
||||
{ startIndex: 14, type: 'delimiter.parenthesis.abap' },
|
||||
{ startIndex: 15, type: '' },
|
||||
{ startIndex: 16, type: 'delimiter.parenthesis.abap' },
|
||||
{ startIndex: 17, type: 'delimiter.abap' }
|
||||
]
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
line: 'foo=>const_bar.',
|
||||
tokens: [
|
||||
{ startIndex: 0, type: 'identifier.abap' },
|
||||
{ startIndex: 3, type: 'tag.abap' },
|
||||
{ startIndex: 5, type: 'identifier.abap' },
|
||||
{ startIndex: 14, type: 'delimiter.abap' }
|
||||
]
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
line: 'foo-bar+42(42).',
|
||||
tokens: [
|
||||
{ startIndex: 0, type: 'identifier.abap' },
|
||||
{ startIndex: 7, type: '' },
|
||||
{ startIndex: 8, type: 'number.abap' },
|
||||
{ startIndex: 10, type: 'delimiter.parenthesis.abap' },
|
||||
{ startIndex: 11, type: 'number.abap' },
|
||||
{ startIndex: 13, type: 'delimiter.parenthesis.abap' },
|
||||
{ startIndex: 14, type: 'delimiter.abap' }
|
||||
]
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
line: "@EndUserText.label: 'hallo'",
|
||||
tokens: [
|
||||
{ startIndex: 0, type: 'annotation.abap' },
|
||||
{ startIndex: 12, type: 'delimiter.abap' },
|
||||
{ startIndex: 13, type: 'identifier.abap' },
|
||||
{ startIndex: 18, type: 'delimiter.abap' },
|
||||
{ startIndex: 19, type: '' },
|
||||
{ startIndex: 20, type: 'string.abap' }
|
||||
]
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
line: 'IF foo = abap_true.',
|
||||
tokens: [
|
||||
{ startIndex: 0, type: 'keyword.abap' },
|
||||
{ startIndex: 2, type: '' },
|
||||
{ startIndex: 3, type: 'identifier.abap' },
|
||||
{ startIndex: 6, type: '' },
|
||||
{ startIndex: 7, type: 'key.abap' },
|
||||
{ startIndex: 8, type: '' },
|
||||
{ startIndex: 9, type: 'type.abap' },
|
||||
{ startIndex: 18, type: 'delimiter.abap' }
|
||||
]
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
line: 'LOOP AT screen.',
|
||||
tokens: [
|
||||
{ startIndex: 0, type: 'keyword.abap' },
|
||||
{ startIndex: 4, type: '' },
|
||||
{ startIndex: 5, type: 'keyword.abap' },
|
||||
{ startIndex: 7, type: '' },
|
||||
{ startIndex: 8, type: 'type.abap' },
|
||||
{ startIndex: 14, type: 'delimiter.abap' }
|
||||
]
|
||||
}
|
||||
]
|
||||
]);
|
||||
|
|
|
|||
2163
src/abap/abap.ts
2163
src/abap/abap.ts
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue