mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 23:13:02 +01:00
Format sources
This commit is contained in:
parent
da162968ac
commit
f661c5f826
65 changed files with 19255 additions and 17150 deletions
|
|
@ -5,101 +5,113 @@
|
|||
|
||||
'use strict';
|
||||
|
||||
import {testTokenization} from './testRunner';
|
||||
import { testTokenization } from './testRunner';
|
||||
|
||||
testTokenization('python', [
|
||||
// Keywords
|
||||
[{
|
||||
line: 'def func():',
|
||||
tokens: [
|
||||
{ startIndex: 0, type: 'keyword.python' },
|
||||
{ startIndex: 3, type: 'white.python' },
|
||||
{ startIndex: 4, type: 'identifier.python' },
|
||||
{ startIndex: 8, type: 'delimiter.parenthesis.python' },
|
||||
{ startIndex: 10, type: 'delimiter.python' }
|
||||
]}],
|
||||
line: 'def func():',
|
||||
tokens: [
|
||||
{ startIndex: 0, type: 'keyword.python' },
|
||||
{ startIndex: 3, type: 'white.python' },
|
||||
{ startIndex: 4, type: 'identifier.python' },
|
||||
{ startIndex: 8, type: 'delimiter.parenthesis.python' },
|
||||
{ startIndex: 10, type: 'delimiter.python' }
|
||||
]
|
||||
}],
|
||||
|
||||
[{
|
||||
line: 'func(str Y3)',
|
||||
tokens: [
|
||||
{ startIndex: 0, type: 'identifier.python' },
|
||||
{ startIndex: 4, type: 'delimiter.parenthesis.python' },
|
||||
{ startIndex: 5, type: 'keyword.python' },
|
||||
{ startIndex: 8, type: 'white.python' },
|
||||
{ startIndex: 9, type: 'identifier.python' },
|
||||
{ startIndex: 11, type: 'delimiter.parenthesis.python' }
|
||||
]}],
|
||||
line: 'func(str Y3)',
|
||||
tokens: [
|
||||
{ startIndex: 0, type: 'identifier.python' },
|
||||
{ startIndex: 4, type: 'delimiter.parenthesis.python' },
|
||||
{ startIndex: 5, type: 'keyword.python' },
|
||||
{ startIndex: 8, type: 'white.python' },
|
||||
{ startIndex: 9, type: 'identifier.python' },
|
||||
{ startIndex: 11, type: 'delimiter.parenthesis.python' }
|
||||
]
|
||||
}],
|
||||
|
||||
[{
|
||||
line: '@Dec0_rator:',
|
||||
tokens: [
|
||||
{ startIndex: 0, type: 'tag.python' },
|
||||
{ startIndex: 11, type: 'delimiter.python' }
|
||||
]}],
|
||||
line: '@Dec0_rator:',
|
||||
tokens: [
|
||||
{ startIndex: 0, type: 'tag.python' },
|
||||
{ startIndex: 11, type: 'delimiter.python' }
|
||||
]
|
||||
}],
|
||||
|
||||
// Comments
|
||||
[{
|
||||
line: ' # Comments! ## "jfkd" ',
|
||||
tokens: [
|
||||
{ startIndex: 0, type: 'white.python' },
|
||||
{ startIndex: 1, type: 'comment.python' }
|
||||
]}],
|
||||
line: ' # Comments! ## "jfkd" ',
|
||||
tokens: [
|
||||
{ startIndex: 0, type: 'white.python' },
|
||||
{ startIndex: 1, type: 'comment.python' }
|
||||
]
|
||||
}],
|
||||
|
||||
// Strings
|
||||
[{
|
||||
line: '\'s0\'',
|
||||
tokens: [
|
||||
{ startIndex: 0, type: 'string.escape.python' },
|
||||
{ startIndex: 1, type: 'string.python' },
|
||||
{ startIndex: 3, type: 'string.escape.python' }
|
||||
]}],
|
||||
line: '\'s0\'',
|
||||
tokens: [
|
||||
{ startIndex: 0, type: 'string.escape.python' },
|
||||
{ startIndex: 1, type: 'string.python' },
|
||||
{ startIndex: 3, type: 'string.escape.python' }
|
||||
]
|
||||
}],
|
||||
|
||||
[{
|
||||
line: '"\' " "',
|
||||
tokens: [
|
||||
{ startIndex: 0, type: 'string.escape.python' },
|
||||
{ startIndex: 1, type: 'string.python' },
|
||||
{ startIndex: 3, type: 'string.escape.python' },
|
||||
{ startIndex: 4, type: 'white.python' },
|
||||
{ startIndex: 5, type: 'string.escape.python' }
|
||||
]}],
|
||||
line: '"\' " "',
|
||||
tokens: [
|
||||
{ startIndex: 0, type: 'string.escape.python' },
|
||||
{ startIndex: 1, type: 'string.python' },
|
||||
{ startIndex: 3, type: 'string.escape.python' },
|
||||
{ startIndex: 4, type: 'white.python' },
|
||||
{ startIndex: 5, type: 'string.escape.python' }
|
||||
]
|
||||
}],
|
||||
|
||||
[{
|
||||
line: '\'\'\'Lots of string\'\'\'',
|
||||
tokens: [
|
||||
{ startIndex: 0, type: 'string.python' }
|
||||
]}],
|
||||
line: '\'\'\'Lots of string\'\'\'',
|
||||
tokens: [
|
||||
{ startIndex: 0, type: 'string.python' }
|
||||
]
|
||||
}],
|
||||
|
||||
[{
|
||||
line: '"""Lots \'\'\' \'\'\'"""',
|
||||
tokens: [
|
||||
{ startIndex: 0, type: 'string.python' }
|
||||
]}],
|
||||
line: '"""Lots \'\'\' \'\'\'"""',
|
||||
tokens: [
|
||||
{ startIndex: 0, type: 'string.python' }
|
||||
]
|
||||
}],
|
||||
|
||||
[{
|
||||
line: '\'\'\'Lots \'\'\'0.3e-5',
|
||||
tokens: [
|
||||
{ startIndex: 0, type: 'string.python' },
|
||||
{ startIndex: 11, type: 'number.python' }
|
||||
]}],
|
||||
line: '\'\'\'Lots \'\'\'0.3e-5',
|
||||
tokens: [
|
||||
{ startIndex: 0, type: 'string.python' },
|
||||
{ startIndex: 11, type: 'number.python' }
|
||||
]
|
||||
}],
|
||||
|
||||
// Numbers
|
||||
[{
|
||||
line: '0xAcBFd',
|
||||
tokens: [
|
||||
{ startIndex: 0, type: 'number.hex.python' }
|
||||
]}],
|
||||
line: '0xAcBFd',
|
||||
tokens: [
|
||||
{ startIndex: 0, type: 'number.hex.python' }
|
||||
]
|
||||
}],
|
||||
|
||||
[{
|
||||
line: '0x0cH',
|
||||
tokens: [
|
||||
{ startIndex: 0, type: 'number.hex.python' },
|
||||
{ startIndex: 4, type: 'identifier.python' }
|
||||
]}],
|
||||
line: '0x0cH',
|
||||
tokens: [
|
||||
{ startIndex: 0, type: 'number.hex.python' },
|
||||
{ startIndex: 4, type: 'identifier.python' }
|
||||
]
|
||||
}],
|
||||
|
||||
[{
|
||||
line: '456.7e-7j',
|
||||
tokens: [
|
||||
{ startIndex: 0, type: 'number.python' }
|
||||
]}]
|
||||
line: '456.7e-7j',
|
||||
tokens: [
|
||||
{ startIndex: 0, type: 'number.python' }
|
||||
]
|
||||
}]
|
||||
]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue