123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737 |
- /*---------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the MIT License. See License.txt in the project root for license information.
- *--------------------------------------------------------------------------------------------*/
- 'use strict';
- import {testTokenization} from './testRunner';
- testTokenization('powershell', [
- // Comments - single line
- [{
- line: '#',
- tokens: [
- { startIndex: 0, type: 'comment.ps1' }
- ]}],
- [{
- line: ' # a comment',
- tokens: [
- { startIndex: 0, type: '' },
- { startIndex: 4, type: 'comment.ps1' }
- ]}],
- [{
- line: '# a comment',
- tokens: [
- { startIndex: 0, type: 'comment.ps1' }
- ]}],
- [{
- line: '#sticky comment',
- tokens: [
- { startIndex: 0, type: 'comment.ps1' }
- ]}],
- [{
- line: '##still a comment',
- tokens: [
- { startIndex: 0, type: 'comment.ps1' }
- ]}],
- [{
- line: '1 / 2 /# comment',
- tokens: [
- { startIndex: 0, type: 'number.ps1' },
- { startIndex: 1, type: '' },
- { startIndex: 2, type: 'delimiter.ps1' },
- { startIndex: 3, type: '' },
- { startIndex: 4, type: 'number.ps1' },
- { startIndex: 5, type: '' },
- { startIndex: 6, type: 'delimiter.ps1' },
- { startIndex: 7, type: 'comment.ps1' }
- ]}],
- [{
- line: '$x = 1 # my comment # is a nice one',
- tokens: [
- { startIndex: 0, type: 'variable.ps1' },
- { startIndex: 2, type: '' },
- { startIndex: 3, type: 'delimiter.ps1' },
- { startIndex: 4, type: '' },
- { startIndex: 5, type: 'number.ps1' },
- { startIndex: 6, type: '' },
- { startIndex: 7, type: 'comment.ps1' }
- ]}],
- // Comments - range comment, single line
- [{
- line: '<# a simple comment #>',
- tokens: [
- { startIndex: 0, type: 'comment.ps1' }
- ]}],
- [{
- line: '$x = <# a simple comment #> 1',
- tokens: [
- { startIndex: 0, type: 'variable.ps1' },
- { startIndex: 2, type: '' },
- { startIndex: 3, type: 'delimiter.ps1' },
- { startIndex: 4, type: '' },
- { startIndex: 5, type: 'comment.ps1' },
- { startIndex: 27, type: '' },
- { startIndex: 28, type: 'number.ps1' }
- ]}],
- [{
- line: '$yy = <# comment #> 14',
- tokens: [
- { startIndex: 0, type: 'variable.ps1' },
- { startIndex: 3, type: '' },
- { startIndex: 4, type: 'delimiter.ps1' },
- { startIndex: 5, type: '' },
- { startIndex: 6, type: 'comment.ps1' },
- { startIndex: 19, type: '' },
- { startIndex: 20, type: 'number.ps1' }
- ]}],
- [{
- line: '$x = <##>7',
- tokens: [
- { startIndex: 0, type: 'variable.ps1' },
- { startIndex: 2, type: '' },
- { startIndex: 3, type: 'delimiter.ps1' },
- { startIndex: 4, type: '' },
- { startIndex: 5, type: 'comment.ps1' },
- { startIndex: 9, type: 'number.ps1' }
- ]}],
- [{
- line: '$x = <#<85',
- tokens: [
- { startIndex: 0, type: 'variable.ps1' },
- { startIndex: 2, type: '' },
- { startIndex: 3, type: 'delimiter.ps1' },
- { startIndex: 4, type: '' },
- { startIndex: 5, type: 'comment.ps1' }
- ]}],
- // Comments - range comment, multiple lines
- [{
- line: '<# start of multiline comment',
- tokens: [
- { startIndex: 0, type: 'comment.ps1' }
- ]}, {
- line: 'a comment between',
- tokens: [
- { startIndex: 0, type: 'comment.ps1' }
- ]}, {
- line: 'end of multiline comment#>',
- tokens: [
- { startIndex: 0, type: 'comment.ps1' }
- ]}],
- [{
- line: '$x = <# start a comment',
- tokens: [
- { startIndex: 0, type: 'variable.ps1' },
- { startIndex: 2, type: '' },
- { startIndex: 3, type: 'delimiter.ps1' },
- { startIndex: 4, type: '' },
- { startIndex: 5, type: 'comment.ps1' }
- ]}, {
- line: ' a ',
- tokens: [
- { startIndex: 0, type: 'comment.ps1' }
- ]}, {
- line: 'and end it #> 2',
- tokens: [
- { startIndex: 0, type: 'comment.ps1' },
- { startIndex: 13, type: '' },
- { startIndex: 14, type: 'number.ps1' }
- ]}],
- // Keywords
- [{
- line: 'foreach($i in $b) {if (7) continue}',
- tokens: [
- { startIndex: 0, type: 'keyword.foreach.ps1' },
- { startIndex: 7, type: 'delimiter.parenthesis.ps1' },
- { startIndex: 8, type: 'variable.ps1' },
- { startIndex: 10, type: '' },
- { startIndex: 11, type: 'keyword.in.ps1' },
- { startIndex: 13, type: '' },
- { startIndex: 14, type: 'variable.ps1' },
- { startIndex: 16, type: 'delimiter.parenthesis.ps1' },
- { startIndex: 17, type: '' },
- { startIndex: 18, type: 'delimiter.curly.ps1' },
- { startIndex: 19, type: 'keyword.if.ps1' },
- { startIndex: 21, type: '' },
- { startIndex: 22, type: 'delimiter.parenthesis.ps1' },
- { startIndex: 23, type: 'number.ps1' },
- { startIndex: 24, type: 'delimiter.parenthesis.ps1' },
- { startIndex: 25, type: '' },
- { startIndex: 26, type: 'keyword.continue.ps1' },
- { startIndex: 34, type: 'delimiter.curly.ps1' }
- ]}],
- // Redirect operand
- [{
- line: '$i > output1.txt',
- tokens: [
- { startIndex: 0, type: 'variable.ps1' },
- { startIndex: 2, type: '' },
- { startIndex: 3, type: 'delimiter.ps1' },
- { startIndex: 4, type: '' },
- { startIndex: 12, type: 'delimiter.ps1' },
- { startIndex: 13, type: '' }
- ]}],
- // Numbers
- [{
- line: '0',
- tokens: [
- { startIndex: 0, type: 'number.ps1' }
- ]}],
- [{
- line: '0.10',
- tokens: [
- { startIndex: 0, type: 'number.float.ps1' }
- ]}],
- [{
- line: '0X123',
- tokens: [
- { startIndex: 0, type: 'number.hex.ps1' }
- ]}],
- [{
- line: '0x123',
- tokens: [
- { startIndex: 0, type: 'number.hex.ps1' }
- ]}],
- [{
- line: '23.5e3',
- tokens: [
- { startIndex: 0, type: 'number.float.ps1' }
- ]}],
- [{
- line: '23.5e-3',
- tokens: [
- { startIndex: 0, type: 'number.float.ps1' }
- ]}],
- [{
- line: '23.5E3',
- tokens: [
- { startIndex: 0, type: 'number.float.ps1' }
- ]}],
- [{
- line: '23.5E-3',
- tokens: [
- { startIndex: 0, type: 'number.float.ps1' }
- ]}],
- [{
- line: '23.5',
- tokens: [
- { startIndex: 0, type: 'number.float.ps1' }
- ]}],
- [{
- line: '0+0',
- tokens: [
- { startIndex: 0, type: 'number.ps1' },
- { startIndex: 1, type: 'delimiter.ps1' },
- { startIndex: 2, type: 'number.ps1' }
- ]}],
- [{
- line: '100+10',
- tokens: [
- { startIndex: 0, type: 'number.ps1' },
- { startIndex: 3, type: 'delimiter.ps1' },
- { startIndex: 4, type: 'number.ps1' }
- ]}],
- [{
- line: '10 + 0',
- tokens: [
- { startIndex: 0, type: 'number.ps1' },
- { startIndex: 2, type: '' },
- { startIndex: 3, type: 'delimiter.ps1' },
- { startIndex: 4, type: '' },
- { startIndex: 5, type: 'number.ps1' }
- ]}],
- // Strings
- [{
- line: '$s = "I am a String"',
- tokens: [
- { startIndex: 0, type: 'variable.ps1' },
- { startIndex: 2, type: '' },
- { startIndex: 3, type: 'delimiter.ps1' },
- { startIndex: 4, type: '' },
- { startIndex: 5, type: 'string.ps1' }
- ]}],
- [{
- line: '\'I am also a ( String\'',
- tokens: [
- { startIndex: 0, type: 'string.ps1' }
- ]}],
- [{
- line: '$s = "concatenated" + " String"',
- tokens: [
- { startIndex: 0, type: 'variable.ps1' },
- { startIndex: 2, type: '' },
- { startIndex: 3, type: 'delimiter.ps1' },
- { startIndex: 4, type: '' },
- { startIndex: 5, type: 'string.ps1' },
- { startIndex: 19, type: '' },
- { startIndex: 20, type: 'delimiter.ps1' },
- { startIndex: 21, type: '' },
- { startIndex: 22, type: 'string.ps1' }
- ]}],
- [{
- line: '"escaping `"quotes`" is cool"',
- tokens: [
- { startIndex: 0, type: 'string.ps1' },
- { startIndex: 10, type: 'string.escape.ps1' },
- { startIndex: 12, type: 'string.ps1' },
- { startIndex: 18, type: 'string.escape.ps1' },
- { startIndex: 20, type: 'string.ps1' }
- ]}],
- [{
- line: '\'`\'end of the string',
- tokens: [
- { startIndex: 0, type: 'string.ps1' },
- { startIndex: 1, type: 'string.escape.ps1' },
- { startIndex: 3, type: 'string.ps1' }
- ]}],
- [{
- line: '@"I am an expandable String"@',
- tokens: [
- { startIndex: 0, type: 'string.ps1' }
- ]}],
- [{
- line: '@\'I am also an expandable String\'@',
- tokens: [
- { startIndex: 0, type: 'string.ps1' }
- ]}],
- [{
- line: '$s = @\'I am also an expandable String\'@',
- tokens: [
- { startIndex: 0, type: 'variable.ps1' },
- { startIndex: 2, type: '' },
- { startIndex: 3, type: 'delimiter.ps1' },
- { startIndex: 4, type: '' },
- { startIndex: 5, type: 'string.ps1' }
- ]}],
- [{
- line: '$s = @\'I am also an expandable String\'@+7',
- tokens: [
- { startIndex: 0, type: 'variable.ps1' },
- { startIndex: 2, type: '' },
- { startIndex: 3, type: 'delimiter.ps1' },
- { startIndex: 4, type: '' },
- { startIndex: 5, type: 'string.ps1' }
- ]}],
- [{
- line: '@\'I am a multiline string,',
- tokens: [
- { startIndex: 0, type: 'string.ps1' }
- ]}, {
- line: 'and this is the middle line,',
- tokens: [
- { startIndex: 0, type: 'string.ps1' }
- ]}, {
- line: 'and this is NOT the end of the string\'@foreach $i',
- tokens: [
- { startIndex: 0, type: 'string.ps1' }
- ]}, {
- line: '\'@',
- tokens: [
- { startIndex: 0, type: 'string.ps1' }
- ]}, {
- line: '${script:foo}',
- tokens: [
- { startIndex: 0, type: 'variable.ps1' }
- ]}, {
- line: 'foreach $i',
- tokens: [
- { startIndex: 0, type: 'keyword.foreach.ps1' },
- { startIndex: 7, type: '' },
- { startIndex: 8, type: 'variable.ps1' }
- ]}],
- // Generated from sample
- [{
- line: '$SelectedObjectNames=@();',
- tokens: [
- { startIndex: 0, type: 'variable.ps1' },
- { startIndex: 20, type: 'delimiter.ps1' },
- { startIndex: 21, type: '' },
- { startIndex: 22, type: 'delimiter.parenthesis.ps1' },
- { startIndex: 24, type: 'delimiter.ps1' }
- ]}, {
- line: '$XenCenterNodeSelected = 0;',
- tokens: [
- { startIndex: 0, type: 'variable.ps1' },
- { startIndex: 22, type: '' },
- { startIndex: 23, type: 'delimiter.ps1' },
- { startIndex: 24, type: '' },
- { startIndex: 25, type: 'number.ps1' },
- { startIndex: 26, type: 'delimiter.ps1' }
- ]}, {
- line: '#the object info array contains hashmaps, each of which represent a parameter set and describe a target in the XenCenter resource list',
- tokens: [
- { startIndex: 0, type: 'comment.ps1' }
- ]}, {
- line: 'foreach($parameterSet in $ObjInfoArray)',
- tokens: [
- { startIndex: 0, type: 'keyword.foreach.ps1' },
- { startIndex: 7, type: 'delimiter.parenthesis.ps1' },
- { startIndex: 8, type: 'variable.ps1' },
- { startIndex: 21, type: '' },
- { startIndex: 22, type: 'keyword.in.ps1' },
- { startIndex: 24, type: '' },
- { startIndex: 25, type: 'variable.ps1' },
- { startIndex: 38, type: 'delimiter.parenthesis.ps1' }
- ]}, {
- line: '{',
- tokens: [
- { startIndex: 0, type: 'delimiter.curly.ps1' }
- ]}, {
- line: ' if ($parameterSet["class"] -eq "blank")',
- tokens: [
- { startIndex: 0, type: '' },
- { startIndex: 1, type: 'keyword.if.ps1' },
- { startIndex: 3, type: '' },
- { startIndex: 4, type: 'delimiter.parenthesis.ps1' },
- { startIndex: 5, type: 'variable.ps1' },
- { startIndex: 18, type: 'delimiter.square.ps1' },
- { startIndex: 19, type: 'string.ps1' },
- { startIndex: 26, type: 'delimiter.square.ps1' },
- { startIndex: 27, type: '' },
- { startIndex: 28, type: 'delimiter.ps1' },
- { startIndex: 29, type: '' },
- { startIndex: 32, type: 'string.ps1' },
- { startIndex: 39, type: 'delimiter.parenthesis.ps1' }
- ]}, {
- line: ' {',
- tokens: [
- { startIndex: 0, type: '' },
- { startIndex: 1, type: 'delimiter.curly.ps1' }
- ]}, {
- line: ' #When the XenCenter node is selected a parameter set is created for each of your connected servers with the class and objUuid keys marked as blank',
- tokens: [
- { startIndex: 0, type: '' },
- { startIndex: 2, type: 'comment.ps1' }
- ]}, {
- line: ' if ($XenCenterNodeSelected)',
- tokens: [
- { startIndex: 0, type: '' },
- { startIndex: 2, type: 'keyword.if.ps1' },
- { startIndex: 4, type: '' },
- { startIndex: 5, type: 'delimiter.parenthesis.ps1' },
- { startIndex: 6, type: 'variable.ps1' },
- { startIndex: 28, type: 'delimiter.parenthesis.ps1' }
- ]}, {
- line: ' {',
- tokens: [
- { startIndex: 0, type: '' },
- { startIndex: 2, type: 'delimiter.curly.ps1' }
- ]}, {
- line: ' continue',
- tokens: [
- { startIndex: 0, type: '' },
- { startIndex: 3, type: 'keyword.continue.ps1' }
- ]}, {
- line: ' }',
- tokens: [
- { startIndex: 0, type: '' },
- { startIndex: 2, type: 'delimiter.curly.ps1' }
- ]}, {
- line: ' $XenCenterNodeSelected = 1;',
- tokens: [
- { startIndex: 0, type: '' },
- { startIndex: 2, type: 'variable.ps1' },
- { startIndex: 24, type: '' },
- { startIndex: 25, type: 'delimiter.ps1' },
- { startIndex: 26, type: '' },
- { startIndex: 27, type: 'number.ps1' },
- { startIndex: 28, type: 'delimiter.ps1' }
- ]}, {
- line: ' $SelectedObjectNames += "XenCenter"',
- tokens: [
- { startIndex: 0, type: '' },
- { startIndex: 2, type: 'variable.ps1' },
- { startIndex: 22, type: '' },
- { startIndex: 23, type: 'delimiter.ps1' },
- { startIndex: 25, type: '' },
- { startIndex: 26, type: 'string.ps1' }
- ]}, {
- line: ' }',
- tokens: [
- { startIndex: 0, type: '' },
- { startIndex: 1, type: 'delimiter.curly.ps1' }
- ]}, {
- line: ' elseif ($parameterSet["sessionRef"] -eq "null")',
- tokens: [
- { startIndex: 0, type: '' },
- { startIndex: 1, type: 'keyword.elseif.ps1' },
- { startIndex: 7, type: '' },
- { startIndex: 8, type: 'delimiter.parenthesis.ps1' },
- { startIndex: 9, type: 'variable.ps1' },
- { startIndex: 22, type: 'delimiter.square.ps1' },
- { startIndex: 23, type: 'string.ps1' },
- { startIndex: 35, type: 'delimiter.square.ps1' },
- { startIndex: 36, type: '' },
- { startIndex: 37, type: 'delimiter.ps1' },
- { startIndex: 38, type: '' },
- { startIndex: 41, type: 'string.ps1' },
- { startIndex: 47, type: 'delimiter.parenthesis.ps1' }
- ]}, {
- line: ' {',
- tokens: [
- { startIndex: 0, type: '' },
- { startIndex: 1, type: 'delimiter.curly.ps1' }
- ]}, {
- line: ' #When a disconnected server is selected there is no session information, we get null for everything except class',
- tokens: [
- { startIndex: 0, type: '' },
- { startIndex: 2, type: 'comment.ps1' }
- ]}, {
- line: ' }',
- tokens: [
- { startIndex: 0, type: '' },
- { startIndex: 1, type: 'delimiter.curly.ps1' }
- ]}, {
- line: ' $SelectedObjectNames += "a disconnected server"',
- tokens: [
- { startIndex: 0, type: '' },
- { startIndex: 2, type: 'variable.ps1' },
- { startIndex: 22, type: '' },
- { startIndex: 23, type: 'delimiter.ps1' },
- { startIndex: 25, type: '' },
- { startIndex: 26, type: 'string.ps1' }
- ]}, {
- line: ' else',
- tokens: [
- { startIndex: 0, type: '' },
- { startIndex: 1, type: 'keyword.else.ps1' }
- ]}, {
- line: ' {',
- tokens: [
- { startIndex: 0, type: '' },
- { startIndex: 1, type: 'delimiter.curly.ps1' }
- ]}, {
- line: ' Connect-XenServer -url $parameterSet["url"] -opaqueref $parameterSet["sessionRef"]',
- tokens: [
- { startIndex: 0, type: '' },
- { startIndex: 20, type: 'delimiter.ps1' },
- { startIndex: 21, type: '' },
- { startIndex: 25, type: 'variable.ps1' },
- { startIndex: 38, type: 'delimiter.square.ps1' },
- { startIndex: 39, type: 'string.ps1' },
- { startIndex: 44, type: 'delimiter.square.ps1' },
- { startIndex: 45, type: '' },
- { startIndex: 46, type: 'delimiter.ps1' },
- { startIndex: 47, type: '' },
- { startIndex: 57, type: 'variable.ps1' },
- { startIndex: 70, type: 'delimiter.square.ps1' },
- { startIndex: 71, type: 'string.ps1' },
- { startIndex: 83, type: 'delimiter.square.ps1' }
- ]}, {
- line: ' #Use $class to determine which server objects to get',
- tokens: [
- { startIndex: 0, type: '' },
- { startIndex: 2, type: 'comment.ps1' }
- ]}, {
- line: ' #-properties allows us to filter the results to just include the selected object',
- tokens: [
- { startIndex: 0, type: '' },
- { startIndex: 2, type: 'comment.ps1' }
- ]}, {
- line: ' $exp = "Get-XenServer:{0} -properties @{{uuid=\'{1}\'}}" -f $parameterSet["class"], $parameterSet["objUuid"]',
- tokens: [
- { startIndex: 0, type: '' },
- { startIndex: 2, type: 'variable.ps1' },
- { startIndex: 6, type: '' },
- { startIndex: 7, type: 'delimiter.ps1' },
- { startIndex: 8, type: '' },
- { startIndex: 9, type: 'string.ps1' },
- { startIndex: 56, type: '' },
- { startIndex: 57, type: 'delimiter.ps1' },
- { startIndex: 58, type: '' },
- { startIndex: 60, type: 'variable.ps1' },
- { startIndex: 73, type: 'delimiter.square.ps1' },
- { startIndex: 74, type: 'string.ps1' },
- { startIndex: 81, type: 'delimiter.square.ps1' },
- { startIndex: 82, type: 'delimiter.ps1' },
- { startIndex: 83, type: '' },
- { startIndex: 84, type: 'variable.ps1' },
- { startIndex: 97, type: 'delimiter.square.ps1' },
- { startIndex: 98, type: 'string.ps1' },
- { startIndex: 107, type: 'delimiter.square.ps1' }
- ]}, {
- line: ' $obj = Invoke-Expression $exp',
- tokens: [
- { startIndex: 0, type: '' },
- { startIndex: 2, type: 'variable.ps1' },
- { startIndex: 6, type: '' },
- { startIndex: 7, type: 'delimiter.ps1' },
- { startIndex: 8, type: '' },
- { startIndex: 27, type: 'variable.ps1' }
- ]}, {
- line: ' $SelectedObjectNames += $obj.name_label;',
- tokens: [
- { startIndex: 0, type: '' },
- { startIndex: 2, type: 'variable.ps1' },
- { startIndex: 22, type: '' },
- { startIndex: 23, type: 'delimiter.ps1' },
- { startIndex: 25, type: '' },
- { startIndex: 26, type: 'variable.ps1' },
- { startIndex: 30, type: 'delimiter.ps1' },
- { startIndex: 31, type: '' },
- { startIndex: 41, type: 'delimiter.ps1' }
- ]}, {
- line: ' } ',
- tokens: [
- { startIndex: 0, type: '' },
- { startIndex: 1, type: 'delimiter.curly.ps1' },
- { startIndex: 2, type: '' }
- ]}, {
- line: '}',
- tokens: [
- { startIndex: 0, type: 'delimiter.curly.ps1' }
- ]}, {
- line: '',
- tokens: [
- ]}, {
- line: '$test = "in string var$test"',
- tokens: [
- { startIndex: 0, type: 'variable.ps1' },
- { startIndex: 5, type: '' },
- { startIndex: 6, type: 'delimiter.ps1' },
- { startIndex: 7, type: '' },
- { startIndex: 8, type: 'string.ps1' },
- { startIndex: 22, type: 'variable.ps1' },
- { startIndex: 27, type: 'string.ps1' }
- ]}, {
- line: '$another = \'not a $var\'',
- tokens: [
- { startIndex: 0, type: 'variable.ps1' },
- { startIndex: 8, type: '' },
- { startIndex: 9, type: 'delimiter.ps1' },
- { startIndex: 10, type: '' },
- { startIndex: 11, type: 'string.ps1' }
- ]}, {
- line: '$third = "a $var and not `$var string"',
- tokens: [
- { startIndex: 0, type: 'variable.ps1' },
- { startIndex: 6, type: '' },
- { startIndex: 7, type: 'delimiter.ps1' },
- { startIndex: 8, type: '' },
- { startIndex: 9, type: 'string.ps1' },
- { startIndex: 12, type: 'variable.ps1' },
- { startIndex: 16, type: 'string.ps1' },
- { startIndex: 25, type: 'string.escape.ps1' },
- { startIndex: 27, type: 'string.ps1' }
- ]}, {
- line: '',
- tokens: [
- ]}, {
- line: ':aLabel',
- tokens: [
- { startIndex: 0, type: 'metatag.ps1' }
- ]}, {
- line: '',
- tokens: [
- ]}, {
- line: '<#',
- tokens: [
- { startIndex: 0, type: 'comment.ps1' }
- ]}, {
- line: '.SYNOPSIS',
- tokens: [
- { startIndex: 0, type: 'comment.keyword.synopsis.ps1' }
- ]}, {
- line: ' some text',
- tokens: [
- { startIndex: 0, type: 'comment.ps1' }
- ]}, {
- line: ' ',
- tokens: [
- { startIndex: 0, type: 'comment.ps1' }
- ]}, {
- line: '.LINK',
- tokens: [
- { startIndex: 0, type: 'comment.keyword.link.ps1' }
- ]}, {
- line: ' some more text',
- tokens: [
- { startIndex: 0, type: 'comment.ps1' }
- ]}, {
- line: '#>',
- tokens: [
- { startIndex: 0, type: 'comment.ps1' }
- ]}, {
- line: '',
- tokens: [
- ]}, {
- line: '',
- tokens: [
- ]}, {
- line: '$hereString = @"',
- tokens: [
- { startIndex: 0, type: 'variable.ps1' },
- { startIndex: 11, type: '' },
- { startIndex: 12, type: 'delimiter.ps1' },
- { startIndex: 13, type: '' },
- { startIndex: 14, type: 'string.ps1' }
- ]}, {
- line: ' a string',
- tokens: [
- { startIndex: 0, type: 'string.ps1' }
- ]}, {
- line: ' still "@ a string $withVar',
- tokens: [
- { startIndex: 0, type: 'string.ps1' },
- { startIndex: 20, type: 'variable.ps1' }
- ]}, {
- line: ' still a string `$noVar',
- tokens: [
- { startIndex: 0, type: 'string.ps1' },
- { startIndex: 17, type: 'string.escape.ps1' },
- { startIndex: 19, type: 'string.ps1' }
- ]}, {
- line: '',
- tokens: [
- ]}, {
- line: '"@ still a string',
- tokens: [
- { startIndex: 0, type: 'string.ps1' },
- { startIndex: 2, type: '' }
- ]}]
- ]);
|