From ecfce903c4e74cb6bea274f9a6bac03d43c224a3 Mon Sep 17 00:00:00 2001 From: Martin Aeschlimann Date: Mon, 26 Jun 2017 15:37:03 +0800 Subject: [PATCH] Website - Jade should be Pug. Fixes Microsoft/monaco-editor#13 --- README.md | 2 +- gulpfile.js | 2 +- src/monaco.contribution.ts | 6 +- src/{jade.ts => pug.ts} | 2 +- test/all.js | 2 +- test/jade.test.ts | 433 ------------------------------------- test/pug.test.ts | 433 +++++++++++++++++++++++++++++++++++++ 7 files changed, 440 insertions(+), 440 deletions(-) rename src/{jade.ts => pug.ts} (99%) delete mode 100644 test/jade.test.ts create mode 100644 test/pug.test.ts diff --git a/README.md b/README.md index d6fab63b..742b298c 100644 --- a/README.md +++ b/README.md @@ -13,12 +13,12 @@ Colorization and configuration supports for multiple languages for the Monaco Ed * handlebars * html * ini -* jade * lua * objective-c * postiats * php * powershell +* pug * python * r * razor diff --git a/gulpfile.js b/gulpfile.js index fad5d9fc..e671c5e9 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -56,7 +56,7 @@ gulp.task('release', ['clean-release','compile'], function() { bundleOne('src/handlebars'), bundleOne('src/html'), bundleOne('src/ini'), - bundleOne('src/jade'), + bundleOne('src/pug'), bundleOne('src/java'), bundleOne('src/less'), bundleOne('src/lua'), diff --git a/src/monaco.contribution.ts b/src/monaco.contribution.ts index 7af26d99..9073acd1 100644 --- a/src/monaco.contribution.ts +++ b/src/monaco.contribution.ts @@ -123,10 +123,10 @@ registerLanguage({ module: './ini' }); registerLanguage({ - id: 'jade', + id: 'pug', extensions: ['.jade', '.pug'], - aliases: ['Jade', 'jade'], - module: './jade' + aliases: ['Pug', 'Jade', 'jade'], + module: './pug' }); registerLanguage({ id: 'java', diff --git a/src/jade.ts b/src/pug.ts similarity index 99% rename from src/jade.ts rename to src/pug.ts index a7d40fbf..ea625616 100644 --- a/src/jade.ts +++ b/src/pug.ts @@ -24,7 +24,7 @@ export const conf: IRichLanguageConfiguration = { export const language = { defaultToken: '', - tokenPostfix: '.jade', + tokenPostfix: '.pug', ignoreCase: true, diff --git a/test/all.js b/test/all.js index 6655d3bb..8375bc6f 100644 --- a/test/all.js +++ b/test/all.js @@ -34,7 +34,7 @@ requirejs([ 'out/test/go.test', 'out/test/handlebars.test', 'out/test/html.test', - 'out/test/jade.test', + 'out/test/pug.test', 'out/test/java.test', 'out/test/less.test', 'out/test/lua.test', diff --git a/test/jade.test.ts b/test/jade.test.ts deleted file mode 100644 index 689d4a73..00000000 --- a/test/jade.test.ts +++ /dev/null @@ -1,433 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * 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('jade', [ - // Tags [Jade] - [{ - line: 'p 5', - tokens: [ - { startIndex: 0, type: 'tag.jade' }, - { startIndex: 1, type: '' } - ] - }], - - [{ - line: 'div#container.stuff', - tokens: [ - { startIndex: 0, type: 'tag.jade' }, - { startIndex: 3, type: 'tag.id.jade' }, - { startIndex: 13, type: 'tag.class.jade' } - ] - }], - - [{ - line: 'div.container#stuff', - tokens: [ - { startIndex: 0, type: 'tag.jade' }, - { startIndex: 3, type: 'tag.class.jade' }, - { startIndex: 13, type: 'tag.id.jade' } - ] - }], - - [{ - line: 'div.container#stuff .container', - tokens: [ - { startIndex: 0, type: 'tag.jade' }, - { startIndex: 3, type: 'tag.class.jade' }, - { startIndex: 13, type: 'tag.id.jade' }, - { startIndex: 19, type: '' } - ] - }], - - [{ - line: '#tag-id-1', - tokens: [ - { startIndex: 0, type: 'tag.id.jade' } - ] - }], - - [{ - line: '.tag-id-1', - tokens: [ - { startIndex: 0, type: 'tag.class.jade' } - ] - }], - - // Attributes - Single Line [Jade] - [{ - line: 'input(type="checkbox")', - tokens: [ - { startIndex: 0, type: 'tag.jade' }, - { startIndex: 5, type: 'delimiter.parenthesis.jade' }, - { startIndex: 6, type: 'attribute.name.jade' }, - { startIndex: 10, type: 'delimiter.jade' }, - { startIndex: 11, type: 'attribute.value.jade' }, - { startIndex: 21, type: 'delimiter.parenthesis.jade' } - ] - }], - - [{ - line: 'input (type="checkbox")', - tokens: [ - { startIndex: 0, type: 'tag.jade' }, - { startIndex: 5, type: '' } - ] - }], - - [{ - line: 'input(type="checkbox",name="agreement",checked)', - tokens: [ - { startIndex: 0, type: 'tag.jade' }, - { startIndex: 5, type: 'delimiter.parenthesis.jade' }, - { startIndex: 6, type: 'attribute.name.jade' }, - { startIndex: 10, type: 'delimiter.jade' }, - { startIndex: 11, type: 'attribute.value.jade' }, - { startIndex: 21, type: 'attribute.delimiter.jade' }, - { startIndex: 22, type: 'attribute.name.jade' }, - { startIndex: 26, type: 'delimiter.jade' }, - { startIndex: 27, type: 'attribute.value.jade' }, - { startIndex: 38, type: 'attribute.delimiter.jade' }, - { startIndex: 39, type: 'attribute.name.jade' }, - { startIndex: 46, type: 'delimiter.parenthesis.jade' } - ] - }], - - [{ - line: 'input(type="checkbox"', - tokens: [ - { startIndex: 0, type: 'tag.jade' }, - { startIndex: 5, type: 'delimiter.parenthesis.jade' }, - { startIndex: 6, type: 'attribute.name.jade' }, - { startIndex: 10, type: 'delimiter.jade' }, - { startIndex: 11, type: 'attribute.value.jade' } - ] - }, { - line: 'name="agreement"', - tokens: [ - { startIndex: 0, type: 'attribute.name.jade' }, - { startIndex: 4, type: 'delimiter.jade' }, - { startIndex: 5, type: 'attribute.value.jade' } - ] - }, { - line: 'checked)', - tokens: [ - { startIndex: 0, type: 'attribute.name.jade' }, - { startIndex: 7, type: 'delimiter.parenthesis.jade' } - ] - }, { - line: 'body', - tokens: [ - { startIndex: 0, type: 'tag.jade' } - ] - }], - - // Attributes - MultiLine [Jade] - [{ - line: 'input(type="checkbox"', - tokens: [ - { startIndex: 0, type: 'tag.jade' }, - { startIndex: 5, type: 'delimiter.parenthesis.jade' }, - { startIndex: 6, type: 'attribute.name.jade' }, - { startIndex: 10, type: 'delimiter.jade' }, - { startIndex: 11, type: 'attribute.value.jade' } - ] - }, { - line: 'disabled', - tokens: [ - { startIndex: 0, type: 'attribute.name.jade' } - ] - }, { - line: 'checked)', - tokens: [ - { startIndex: 0, type: 'attribute.name.jade' }, - { startIndex: 7, type: 'delimiter.parenthesis.jade' } - ] - }, { - line: 'body', - tokens: [ - { startIndex: 0, type: 'tag.jade' } - ] - }], - - // Interpolation [Jade] - [{ - line: 'p print #{count} lines', - tokens: [ - { startIndex: 0, type: 'tag.jade' }, - { startIndex: 1, type: '' }, - { startIndex: 8, type: 'interpolation.delimiter.jade' }, - { startIndex: 10, type: 'interpolation.jade' }, - { startIndex: 15, type: 'interpolation.delimiter.jade' }, - { startIndex: 16, type: '' } - ] - }], - - [{ - line: 'p print "#{count}" lines', - tokens: [ - { startIndex: 0, type: 'tag.jade' }, - { startIndex: 1, type: '' }, - { startIndex: 9, type: 'interpolation.delimiter.jade' }, - { startIndex: 11, type: 'interpolation.jade' }, - { startIndex: 16, type: 'interpolation.delimiter.jade' }, - { startIndex: 17, type: '' } - ] - }], - - [{ - line: '{ key: 123 }', - tokens: [ - { startIndex: 0, type: 'delimiter.curly.jade' }, - { startIndex: 1, type: '' }, - { startIndex: 5, type: 'delimiter.jade' }, - { startIndex: 6, type: '' }, - { startIndex: 7, type: 'number.jade' }, - { startIndex: 10, type: '' }, - { startIndex: 11, type: 'delimiter.curly.jade' } - ] - }], - - // Comments - Single Line [Jade] - [{ - line: '// html#id1.class1', - tokens: [ - { startIndex: 0, type: 'comment.jade' } - ] - }], - - [{ - line: 'body hello // not a comment 123', - tokens: [ - { startIndex: 0, type: 'tag.jade' }, - { startIndex: 4, type: '' } - ] - }], - - // Comments - MultiLine [Jade] - [{ - line: '//', - tokens: [ - { startIndex: 0, type: 'comment.jade' } - ] - }, { - line: ' should be a comment', - tokens: [ - { startIndex: 0, type: 'comment.jade' } - ] - }, { - line: ' should still be a comment', - tokens: [ - { startIndex: 0, type: 'comment.jade' } - ] - }, { - line: 'div should not be a comment', - tokens: [ - { startIndex: 0, type: 'tag.jade' }, - { startIndex: 3, type: '' } - ] - }], - - // Code [Jade] - [{ - line: '- var a = 1', - tokens: [ - { startIndex: 0, type: '' }, - { startIndex: 2, type: 'keyword.var.jade' }, - { startIndex: 5, type: '' }, - { startIndex: 8, type: 'delimiter.jade' }, - { startIndex: 9, type: '' }, - { startIndex: 10, type: 'number.jade' } - ] - }], - - [{ - line: 'each item in items', - tokens: [ - { startIndex: 0, type: 'keyword.each.jade' }, - { startIndex: 4, type: '' }, - { startIndex: 10, type: 'keyword.in.jade' }, - { startIndex: 12, type: '' } - ] - }], - - [{ - line: '- var html = ""', - tokens: [ - { startIndex: 0, type: '' }, - { startIndex: 2, type: 'keyword.var.jade' }, - { startIndex: 5, type: '' }, - { startIndex: 11, type: 'delimiter.jade' }, - { startIndex: 12, type: '' }, - { startIndex: 13, type: 'string.jade' } - ] - }], - - // Generated from sample - [{ - line: 'doctype 5', - tokens: [ - { startIndex: 0, type: 'keyword.doctype.jade' }, - { startIndex: 7, type: '' }, - { startIndex: 8, type: 'number.jade' } - ] - }, { - line: 'html(lang="en")', - tokens: [ - { startIndex: 0, type: 'tag.jade' }, - { startIndex: 4, type: 'delimiter.parenthesis.jade' }, - { startIndex: 5, type: 'attribute.name.jade' }, - { startIndex: 9, type: 'delimiter.jade' }, - { startIndex: 10, type: 'attribute.value.jade' }, - { startIndex: 14, type: 'delimiter.parenthesis.jade' } - ] - }, { - line: ' head', - tokens: [ - { startIndex: 0, type: '' }, - { startIndex: 4, type: 'tag.jade' } - ] - }, { - line: ' title= pageTitle', - tokens: [ - { startIndex: 0, type: '' }, - { startIndex: 8, type: 'tag.jade' }, - { startIndex: 13, type: '' } - ] - }, { - line: ' script(type=\'text/javascript\')', - tokens: [ - { startIndex: 0, type: '' }, - { startIndex: 8, type: 'tag.jade' }, - { startIndex: 14, type: 'delimiter.parenthesis.jade' }, - { startIndex: 15, type: 'attribute.name.jade' }, - { startIndex: 19, type: 'delimiter.jade' }, - { startIndex: 20, type: 'attribute.value.jade' }, - { startIndex: 37, type: 'delimiter.parenthesis.jade' } - ] - }, { - line: ' if (foo) {', - tokens: [ - { startIndex: 0, type: '' }, - { startIndex: 12, type: 'keyword.if.jade' }, - { startIndex: 14, type: '' }, - { startIndex: 15, type: 'delimiter.parenthesis.jade' }, - { startIndex: 16, type: '' }, - { startIndex: 19, type: 'delimiter.parenthesis.jade' }, - { startIndex: 20, type: '' }, - { startIndex: 21, type: 'delimiter.curly.jade' } - ] - }, { - line: ' bar()', - tokens: [ - { startIndex: 0, type: '' }, - { startIndex: 19, type: 'delimiter.parenthesis.jade' } - ] - }, { - line: ' }', - tokens: [ - { startIndex: 0, type: '' }, - { startIndex: 12, type: 'delimiter.curly.jade' } - ] - }, { - line: ' body', - tokens: [ - { startIndex: 0, type: '' }, - { startIndex: 4, type: 'tag.jade' } - ] - }, { - line: ' // Disclaimer: You will need to turn insertSpaces to true in order for the', - tokens: [ - { startIndex: 0, type: 'comment.jade' } - ] - }, { - line: ' syntax highlighting to kick in properly (especially for comments)', - tokens: [ - { startIndex: 0, type: 'comment.jade' } - ] - }, { - line: ' Enjoy :)', - tokens: [ - { startIndex: 0, type: 'comment.jade' } - ] - }, { - line: ' h1 Jade - node template engine if in', - tokens: [ - { startIndex: 0, type: '' }, - { startIndex: 8, type: 'tag.jade' }, - { startIndex: 10, type: '' } - ] - }, { - line: ' p.', - tokens: [ - { startIndex: 0, type: '' }, - { startIndex: 8, type: 'tag.jade' }, - { startIndex: 9, type: 'delimiter.jade' } - ] - }, { - line: ' text ', - tokens: [ - { startIndex: 0, type: '' } - ] - }, { - line: ' text', - tokens: [ - { startIndex: 0, type: '' } - ] - }, { - line: ' #container', - tokens: [ - { startIndex: 0, type: '' } - ] - }, { - line: ' #container', - tokens: [ - { startIndex: 0, type: '' } - ] - }, { - line: ' #container', - tokens: [ - { startIndex: 0, type: '' }, - { startIndex: 8, type: 'tag.id.jade' } - ] - }, { - line: ' if youAreUsingJade', - tokens: [ - { startIndex: 0, type: '' }, - { startIndex: 10, type: 'keyword.if.jade' }, - { startIndex: 12, type: '' } - ] - }, { - line: ' p You are amazing', - tokens: [ - { startIndex: 0, type: '' }, - { startIndex: 12, type: 'tag.jade' }, - { startIndex: 13, type: '' } - ] - }, { - line: ' else', - tokens: [ - { startIndex: 0, type: '' }, - { startIndex: 10, type: 'keyword.else.jade' } - ] - }, { - line: ' p Get on it!', - tokens: [ - { startIndex: 0, type: '' }, - { startIndex: 12, type: 'tag.jade' }, - { startIndex: 13, type: '' } - ] - }, { - line: ' p Text can be included in a number of different ways.', - tokens: [ - { startIndex: 0, type: '' }, - { startIndex: 5, type: 'tag.jade' }, - { startIndex: 6, type: '' } - ] - }] -]); diff --git a/test/pug.test.ts b/test/pug.test.ts new file mode 100644 index 00000000..998d2e36 --- /dev/null +++ b/test/pug.test.ts @@ -0,0 +1,433 @@ +/*--------------------------------------------------------------------------------------------- + * 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('pug', [ + // Tags [Pug] + [{ + line: 'p 5', + tokens: [ + { startIndex: 0, type: 'tag.pug' }, + { startIndex: 1, type: '' } + ] + }], + + [{ + line: 'div#container.stuff', + tokens: [ + { startIndex: 0, type: 'tag.pug' }, + { startIndex: 3, type: 'tag.id.pug' }, + { startIndex: 13, type: 'tag.class.pug' } + ] + }], + + [{ + line: 'div.container#stuff', + tokens: [ + { startIndex: 0, type: 'tag.pug' }, + { startIndex: 3, type: 'tag.class.pug' }, + { startIndex: 13, type: 'tag.id.pug' } + ] + }], + + [{ + line: 'div.container#stuff .container', + tokens: [ + { startIndex: 0, type: 'tag.pug' }, + { startIndex: 3, type: 'tag.class.pug' }, + { startIndex: 13, type: 'tag.id.pug' }, + { startIndex: 19, type: '' } + ] + }], + + [{ + line: '#tag-id-1', + tokens: [ + { startIndex: 0, type: 'tag.id.pug' } + ] + }], + + [{ + line: '.tag-id-1', + tokens: [ + { startIndex: 0, type: 'tag.class.pug' } + ] + }], + + // Attributes - Single Line [Pug] + [{ + line: 'input(type="checkbox")', + tokens: [ + { startIndex: 0, type: 'tag.pug' }, + { startIndex: 5, type: 'delimiter.parenthesis.pug' }, + { startIndex: 6, type: 'attribute.name.pug' }, + { startIndex: 10, type: 'delimiter.pug' }, + { startIndex: 11, type: 'attribute.value.pug' }, + { startIndex: 21, type: 'delimiter.parenthesis.pug' } + ] + }], + + [{ + line: 'input (type="checkbox")', + tokens: [ + { startIndex: 0, type: 'tag.pug' }, + { startIndex: 5, type: '' } + ] + }], + + [{ + line: 'input(type="checkbox",name="agreement",checked)', + tokens: [ + { startIndex: 0, type: 'tag.pug' }, + { startIndex: 5, type: 'delimiter.parenthesis.pug' }, + { startIndex: 6, type: 'attribute.name.pug' }, + { startIndex: 10, type: 'delimiter.pug' }, + { startIndex: 11, type: 'attribute.value.pug' }, + { startIndex: 21, type: 'attribute.delimiter.pug' }, + { startIndex: 22, type: 'attribute.name.pug' }, + { startIndex: 26, type: 'delimiter.pug' }, + { startIndex: 27, type: 'attribute.value.pug' }, + { startIndex: 38, type: 'attribute.delimiter.pug' }, + { startIndex: 39, type: 'attribute.name.pug' }, + { startIndex: 46, type: 'delimiter.parenthesis.pug' } + ] + }], + + [{ + line: 'input(type="checkbox"', + tokens: [ + { startIndex: 0, type: 'tag.pug' }, + { startIndex: 5, type: 'delimiter.parenthesis.pug' }, + { startIndex: 6, type: 'attribute.name.pug' }, + { startIndex: 10, type: 'delimiter.pug' }, + { startIndex: 11, type: 'attribute.value.pug' } + ] + }, { + line: 'name="agreement"', + tokens: [ + { startIndex: 0, type: 'attribute.name.pug' }, + { startIndex: 4, type: 'delimiter.pug' }, + { startIndex: 5, type: 'attribute.value.pug' } + ] + }, { + line: 'checked)', + tokens: [ + { startIndex: 0, type: 'attribute.name.pug' }, + { startIndex: 7, type: 'delimiter.parenthesis.pug' } + ] + }, { + line: 'body', + tokens: [ + { startIndex: 0, type: 'tag.pug' } + ] + }], + + // Attributes - MultiLine [Pug] + [{ + line: 'input(type="checkbox"', + tokens: [ + { startIndex: 0, type: 'tag.pug' }, + { startIndex: 5, type: 'delimiter.parenthesis.pug' }, + { startIndex: 6, type: 'attribute.name.pug' }, + { startIndex: 10, type: 'delimiter.pug' }, + { startIndex: 11, type: 'attribute.value.pug' } + ] + }, { + line: 'disabled', + tokens: [ + { startIndex: 0, type: 'attribute.name.pug' } + ] + }, { + line: 'checked)', + tokens: [ + { startIndex: 0, type: 'attribute.name.pug' }, + { startIndex: 7, type: 'delimiter.parenthesis.pug' } + ] + }, { + line: 'body', + tokens: [ + { startIndex: 0, type: 'tag.pug' } + ] + }], + + // Interpolation [Pug] + [{ + line: 'p print #{count} lines', + tokens: [ + { startIndex: 0, type: 'tag.pug' }, + { startIndex: 1, type: '' }, + { startIndex: 8, type: 'interpolation.delimiter.pug' }, + { startIndex: 10, type: 'interpolation.pug' }, + { startIndex: 15, type: 'interpolation.delimiter.pug' }, + { startIndex: 16, type: '' } + ] + }], + + [{ + line: 'p print "#{count}" lines', + tokens: [ + { startIndex: 0, type: 'tag.pug' }, + { startIndex: 1, type: '' }, + { startIndex: 9, type: 'interpolation.delimiter.pug' }, + { startIndex: 11, type: 'interpolation.pug' }, + { startIndex: 16, type: 'interpolation.delimiter.pug' }, + { startIndex: 17, type: '' } + ] + }], + + [{ + line: '{ key: 123 }', + tokens: [ + { startIndex: 0, type: 'delimiter.curly.pug' }, + { startIndex: 1, type: '' }, + { startIndex: 5, type: 'delimiter.pug' }, + { startIndex: 6, type: '' }, + { startIndex: 7, type: 'number.pug' }, + { startIndex: 10, type: '' }, + { startIndex: 11, type: 'delimiter.curly.pug' } + ] + }], + + // Comments - Single Line [Pug] + [{ + line: '// html#id1.class1', + tokens: [ + { startIndex: 0, type: 'comment.pug' } + ] + }], + + [{ + line: 'body hello // not a comment 123', + tokens: [ + { startIndex: 0, type: 'tag.pug' }, + { startIndex: 4, type: '' } + ] + }], + + // Comments - MultiLine [Pug] + [{ + line: '//', + tokens: [ + { startIndex: 0, type: 'comment.pug' } + ] + }, { + line: ' should be a comment', + tokens: [ + { startIndex: 0, type: 'comment.pug' } + ] + }, { + line: ' should still be a comment', + tokens: [ + { startIndex: 0, type: 'comment.pug' } + ] + }, { + line: 'div should not be a comment', + tokens: [ + { startIndex: 0, type: 'tag.pug' }, + { startIndex: 3, type: '' } + ] + }], + + // Code [Pug] + [{ + line: '- var a = 1', + tokens: [ + { startIndex: 0, type: '' }, + { startIndex: 2, type: 'keyword.var.pug' }, + { startIndex: 5, type: '' }, + { startIndex: 8, type: 'delimiter.pug' }, + { startIndex: 9, type: '' }, + { startIndex: 10, type: 'number.pug' } + ] + }], + + [{ + line: 'each item in items', + tokens: [ + { startIndex: 0, type: 'keyword.each.pug' }, + { startIndex: 4, type: '' }, + { startIndex: 10, type: 'keyword.in.pug' }, + { startIndex: 12, type: '' } + ] + }], + + [{ + line: '- var html = ""', + tokens: [ + { startIndex: 0, type: '' }, + { startIndex: 2, type: 'keyword.var.pug' }, + { startIndex: 5, type: '' }, + { startIndex: 11, type: 'delimiter.pug' }, + { startIndex: 12, type: '' }, + { startIndex: 13, type: 'string.pug' } + ] + }], + + // Generated from sample + [{ + line: 'doctype 5', + tokens: [ + { startIndex: 0, type: 'keyword.doctype.pug' }, + { startIndex: 7, type: '' }, + { startIndex: 8, type: 'number.pug' } + ] + }, { + line: 'html(lang="en")', + tokens: [ + { startIndex: 0, type: 'tag.pug' }, + { startIndex: 4, type: 'delimiter.parenthesis.pug' }, + { startIndex: 5, type: 'attribute.name.pug' }, + { startIndex: 9, type: 'delimiter.pug' }, + { startIndex: 10, type: 'attribute.value.pug' }, + { startIndex: 14, type: 'delimiter.parenthesis.pug' } + ] + }, { + line: ' head', + tokens: [ + { startIndex: 0, type: '' }, + { startIndex: 4, type: 'tag.pug' } + ] + }, { + line: ' title= pageTitle', + tokens: [ + { startIndex: 0, type: '' }, + { startIndex: 8, type: 'tag.pug' }, + { startIndex: 13, type: '' } + ] + }, { + line: ' script(type=\'text/javascript\')', + tokens: [ + { startIndex: 0, type: '' }, + { startIndex: 8, type: 'tag.pug' }, + { startIndex: 14, type: 'delimiter.parenthesis.pug' }, + { startIndex: 15, type: 'attribute.name.pug' }, + { startIndex: 19, type: 'delimiter.pug' }, + { startIndex: 20, type: 'attribute.value.pug' }, + { startIndex: 37, type: 'delimiter.parenthesis.pug' } + ] + }, { + line: ' if (foo) {', + tokens: [ + { startIndex: 0, type: '' }, + { startIndex: 12, type: 'keyword.if.pug' }, + { startIndex: 14, type: '' }, + { startIndex: 15, type: 'delimiter.parenthesis.pug' }, + { startIndex: 16, type: '' }, + { startIndex: 19, type: 'delimiter.parenthesis.pug' }, + { startIndex: 20, type: '' }, + { startIndex: 21, type: 'delimiter.curly.pug' } + ] + }, { + line: ' bar()', + tokens: [ + { startIndex: 0, type: '' }, + { startIndex: 19, type: 'delimiter.parenthesis.pug' } + ] + }, { + line: ' }', + tokens: [ + { startIndex: 0, type: '' }, + { startIndex: 12, type: 'delimiter.curly.pug' } + ] + }, { + line: ' body', + tokens: [ + { startIndex: 0, type: '' }, + { startIndex: 4, type: 'tag.pug' } + ] + }, { + line: ' // Disclaimer: You will need to turn insertSpaces to true in order for the', + tokens: [ + { startIndex: 0, type: 'comment.pug' } + ] + }, { + line: ' syntax highlighting to kick in properly (especially for comments)', + tokens: [ + { startIndex: 0, type: 'comment.pug' } + ] + }, { + line: ' Enjoy :)', + tokens: [ + { startIndex: 0, type: 'comment.pug' } + ] + }, { + line: ' h1 Pug - node template engine if in', + tokens: [ + { startIndex: 0, type: '' }, + { startIndex: 8, type: 'tag.pug' }, + { startIndex: 10, type: '' } + ] + }, { + line: ' p.', + tokens: [ + { startIndex: 0, type: '' }, + { startIndex: 8, type: 'tag.pug' }, + { startIndex: 9, type: 'delimiter.pug' } + ] + }, { + line: ' text ', + tokens: [ + { startIndex: 0, type: '' } + ] + }, { + line: ' text', + tokens: [ + { startIndex: 0, type: '' } + ] + }, { + line: ' #container', + tokens: [ + { startIndex: 0, type: '' } + ] + }, { + line: ' #container', + tokens: [ + { startIndex: 0, type: '' } + ] + }, { + line: ' #container', + tokens: [ + { startIndex: 0, type: '' }, + { startIndex: 8, type: 'tag.id.pug' } + ] + }, { + line: ' if youAreUsingPug', + tokens: [ + { startIndex: 0, type: '' }, + { startIndex: 10, type: 'keyword.if.pug' }, + { startIndex: 12, type: '' } + ] + }, { + line: ' p You are amazing', + tokens: [ + { startIndex: 0, type: '' }, + { startIndex: 12, type: 'tag.pug' }, + { startIndex: 13, type: '' } + ] + }, { + line: ' else', + tokens: [ + { startIndex: 0, type: '' }, + { startIndex: 10, type: 'keyword.else.pug' } + ] + }, { + line: ' p Get on it!', + tokens: [ + { startIndex: 0, type: '' }, + { startIndex: 12, type: 'tag.pug' }, + { startIndex: 13, type: '' } + ] + }, { + line: ' p Text can be included in a number of different ways.', + tokens: [ + { startIndex: 0, type: '' }, + { startIndex: 5, type: 'tag.pug' }, + { startIndex: 6, type: '' } + ] + }] +]);