summaryrefslogtreecommitdiff
path: root/tests/lexers/qml
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2021-01-18 21:24:00 +0100
committerGeorg Brandl <georg@python.org>2021-01-18 22:08:36 +0100
commit2a3d3a7d5b9c60dedf6638d876161d9563faebcf (patch)
tree809c0b4a686db98f5954afa1944404cd9652c6b2 /tests/lexers/qml
parentf0445be718da83541ea3401aad882f3937147263 (diff)
downloadpygments-git-examplefiles.tar.gz
Move test_examplefiles to new tests/lexers scheme.examplefiles
Diffstat (limited to 'tests/lexers/qml')
-rw-r--r--tests/lexers/qml/example.txt520
1 files changed, 520 insertions, 0 deletions
diff --git a/tests/lexers/qml/example.txt b/tests/lexers/qml/example.txt
new file mode 100644
index 00000000..8eaf3e58
--- /dev/null
+++ b/tests/lexers/qml/example.txt
@@ -0,0 +1,520 @@
+---input---
+ /****************************************************************************
+ **
+ ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+ ** All rights reserved.
+ ** Contact: Nokia Corporation (qt-info@nokia.com)
+ **
+ ** This file is part of the QtDeclarative module of the Qt Toolkit.
+ **
+ ** $QT_BEGIN_LICENSE:LGPL$
+ ** GNU Lesser General Public License Usage
+ ** This file may be used under the terms of the GNU Lesser General Public
+ ** License version 2.1 as published by the Free Software Foundation and
+ ** appearing in the file LICENSE.LGPL included in the packaging of this
+ ** file. Please review the following information to ensure the GNU Lesser
+ ** General Public License version 2.1 requirements will be met:
+ ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+ **
+ ** In addition, as a special exception, Nokia gives you certain additional
+ ** rights. These rights are described in the Nokia Qt LGPL Exception
+ ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+ **
+ ** GNU General Public License Usage
+ ** Alternatively, this file may be used under the terms of the GNU General
+ ** Public License version 3.0 as published by the Free Software Foundation
+ ** and appearing in the file LICENSE.GPL included in the packaging of this
+ ** file. Please review the following information to ensure the GNU General
+ ** Public License version 3.0 requirements will be met:
+ ** http://www.gnu.org/copyleft/gpl.html.
+ **
+ ** Other Usage
+ ** Alternatively, this file may be used in accordance with the terms and
+ ** conditions contained in a signed written agreement between you and Nokia.
+ **
+ **
+ **
+ **
+ **
+ ** $QT_END_LICENSE$
+ **
+ ****************************************************************************/
+
+ import QtQuick 1.0
+ import "MinehuntCore" 1.0
+
+ Item {
+ id: field
+ property int clickx: 0
+ property int clicky: 0
+
+ width: 450; height: 450
+
+ Image { source: "MinehuntCore/pics/background.png"; anchors.fill: parent; fillMode: Image.Tile }
+
+ Grid {
+ anchors.horizontalCenter: parent.horizontalCenter
+ columns: 9; spacing: 1
+
+ Repeater {
+ id: repeater
+ model: tiles
+ delegate: Tile {}
+ }
+ }
+
+ Row {
+ id: gamedata
+ x: 20; spacing: 20
+ anchors.bottom: field.bottom; anchors.bottomMargin: 15
+
+ Image {
+ source: "MinehuntCore/pics/quit.png"
+ scale: quitMouse.pressed ? 0.8 : 1.0
+ smooth: quitMouse.pressed
+ y: 10
+ MouseArea {
+ id: quitMouse
+ anchors.fill: parent
+ anchors.margins: -20
+ onClicked: Qt.quit()
+ }
+ }
+ Column {
+ spacing: 2
+ Image { source: "MinehuntCore/pics/bomb-color.png" }
+ Text { anchors.horizontalCenter: parent.horizontalCenter; color: "white"; text: numMines }
+ }
+
+ Column {
+ spacing: 2
+ Image { source: "MinehuntCore/pics/flag-color.png" }
+ Text { anchors.horizontalCenter: parent.horizontalCenter; color: "white"; text: numFlags }
+ }
+ }
+
+ Image {
+ anchors.bottom: field.bottom; anchors.bottomMargin: 15
+ anchors.right: field.right; anchors.rightMargin: 20
+ source: isPlaying ? 'MinehuntCore/pics/face-smile.png' :
+ hasWon ? 'MinehuntCore/pics/face-smile-big.png': 'MinehuntCore/pics/face-sad.png'
+
+ MouseArea { anchors.fill: parent; onPressed: reset() }
+ }
+ Text {
+ anchors.centerIn: parent; width: parent.width - 20
+ horizontalAlignment: Text.AlignHCenter
+ wrapMode: Text.WordWrap
+ text: "Minehunt demo has to be compiled to run.\n\nPlease see README."
+ color: "white"; font.bold: true; font.pixelSize: 14
+ visible: tiles == undefined
+ }
+
+ }
+
+---tokens---
+'' Text
+' ' Text
+'/****************************************************************************\n **\n ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).\n ** All rights reserved.\n ** Contact: Nokia Corporation (qt-info@nokia.com)\n **\n ** This file is part of the QtDeclarative module of the Qt Toolkit.\n **\n ** $QT_BEGIN_LICENSE:LGPL$\n ** GNU Lesser General Public License Usage\n ** This file may be used under the terms of the GNU Lesser General Public\n ** License version 2.1 as published by the Free Software Foundation and\n ** appearing in the file LICENSE.LGPL included in the packaging of this\n ** file. Please review the following information to ensure the GNU Lesser\n ** General Public License version 2.1 requirements will be met:\n ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n **\n ** In addition, as a special exception, Nokia gives you certain additional\n ** rights. These rights are described in the Nokia Qt LGPL Exception\n ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n **\n ** GNU General Public License Usage\n ** Alternatively, this file may be used under the terms of the GNU General\n ** Public License version 3.0 as published by the Free Software Foundation\n ** and appearing in the file LICENSE.GPL included in the packaging of this\n ** file. Please review the following information to ensure the GNU General\n ** Public License version 3.0 requirements will be met:\n ** http://www.gnu.org/copyleft/gpl.html.\n **\n ** Other Usage\n ** Alternatively, this file may be used in accordance with the terms and\n ** conditions contained in a signed written agreement between you and Nokia.\n **\n **\n **\n **\n **\n ** $QT_END_LICENSE$\n **\n ****************************************************************************/' Comment.Multiline
+'\n\n ' Text
+'import' Keyword.Reserved
+' ' Text
+'QtQuick' Name.Other
+' ' Text
+'1.0' Literal.Number.Float
+'\n ' Text
+'import' Keyword.Reserved
+' ' Text
+'"MinehuntCore"' Literal.String.Double
+' ' Text
+'1.0' Literal.Number.Float
+'\n\n ' Text
+'Item' Name.Other
+' ' Text
+'{' Punctuation
+'\n ' Text
+'id: field' Keyword.Declaration
+'\n ' Text
+'property' Name.Other
+' ' Text
+'int' Keyword.Reserved
+' ' Text
+'clickx:' Keyword
+' ' Text
+'0' Literal.Number.Integer
+'\n ' Text
+'property' Name.Other
+' ' Text
+'int' Keyword.Reserved
+' ' Text
+'clicky:' Keyword
+' ' Text
+'0' Literal.Number.Integer
+'\n\n ' Text
+'width:' Keyword
+' ' Text
+'450' Literal.Number.Integer
+';' Punctuation
+' ' Text
+'height:' Keyword
+' ' Text
+'450' Literal.Number.Integer
+'\n\n ' Text
+'Image' Name.Other
+' ' Text
+'{' Punctuation
+' ' Text
+'source:' Keyword
+' ' Text
+'"MinehuntCore/pics/background.png"' Literal.String.Double
+';' Punctuation
+' ' Text
+'anchors.fill:' Keyword
+' ' Text
+'parent' Name.Other
+';' Punctuation
+' ' Text
+'fillMode:' Keyword
+' ' Text
+'Image' Name.Other
+'.' Punctuation
+'Tile' Name.Other
+' ' Text
+'}' Punctuation
+'\n\n ' Text
+'Grid' Name.Other
+' ' Text
+'{' Punctuation
+'\n ' Text
+'anchors.horizontalCenter:' Keyword
+' ' Text
+'parent' Name.Other
+'.' Punctuation
+'horizontalCenter' Name.Other
+'\n ' Text
+'columns:' Keyword
+' ' Text
+'9' Literal.Number.Integer
+';' Punctuation
+' ' Text
+'spacing:' Keyword
+' ' Text
+'1' Literal.Number.Integer
+'\n\n ' Text
+'Repeater' Name.Other
+' ' Text
+'{' Punctuation
+'\n ' Text
+'id: repeater' Keyword.Declaration
+'\n ' Text
+'model:' Keyword
+' ' Text
+'tiles' Name.Other
+'\n ' Text
+'delegate:' Keyword
+' ' Text
+'Tile' Name.Other
+' ' Text
+'{' Punctuation
+'}' Punctuation
+'\n ' Text
+'}' Punctuation
+'\n ' Text
+'}' Punctuation
+'\n\n ' Text
+'Row' Name.Other
+' ' Text
+'{' Punctuation
+'\n ' Text
+'id: gamedata' Keyword.Declaration
+'\n ' Text
+'x:' Keyword
+' ' Text
+'20' Literal.Number.Integer
+';' Punctuation
+' ' Text
+'spacing:' Keyword
+' ' Text
+'20' Literal.Number.Integer
+'\n ' Text
+'anchors.bottom:' Keyword
+' ' Text
+'field' Name.Other
+'.' Punctuation
+'bottom' Name.Other
+';' Punctuation
+' ' Text
+'anchors.bottomMargin:' Keyword
+' ' Text
+'15' Literal.Number.Integer
+'\n\n ' Text
+'Image' Name.Other
+' ' Text
+'{' Punctuation
+'\n ' Text
+'source:' Keyword
+' ' Text
+'"MinehuntCore/pics/quit.png"' Literal.String.Double
+'\n ' Text
+'scale:' Keyword
+' ' Text
+'quitMouse' Name.Other
+'.' Punctuation
+'pressed' Name.Other
+' ' Text
+'?' Operator
+' ' Text
+'0.8' Literal.Number.Float
+' ' Text
+':' Operator
+' ' Text
+'1.0' Literal.Number.Float
+'\n ' Text
+'smooth:' Keyword
+' ' Text
+'quitMouse' Name.Other
+'.' Punctuation
+'pressed' Name.Other
+'\n ' Text
+'y:' Keyword
+' ' Text
+'10' Literal.Number.Integer
+'\n ' Text
+'MouseArea' Name.Other
+' ' Text
+'{' Punctuation
+'\n ' Text
+'id: quitMouse' Keyword.Declaration
+'\n ' Text
+'anchors.fill:' Keyword
+' ' Text
+'parent' Name.Other
+'\n ' Text
+'anchors.margins:' Keyword
+' ' Text
+'-' Operator
+'20' Literal.Number.Integer
+'\n ' Text
+'onClicked:' Keyword
+' ' Text
+'Qt' Name.Other
+'.' Punctuation
+'quit' Name.Other
+'(' Punctuation
+')' Punctuation
+'\n ' Text
+'}' Punctuation
+'\n ' Text
+'}' Punctuation
+'\n ' Text
+'Column' Name.Other
+' ' Text
+'{' Punctuation
+'\n ' Text
+'spacing:' Keyword
+' ' Text
+'2' Literal.Number.Integer
+'\n ' Text
+'Image' Name.Other
+' ' Text
+'{' Punctuation
+' ' Text
+'source:' Keyword
+' ' Text
+'"MinehuntCore/pics/bomb-color.png"' Literal.String.Double
+' ' Text
+'}' Punctuation
+'\n ' Text
+'Text' Name.Other
+' ' Text
+'{' Punctuation
+' ' Text
+'anchors.horizontalCenter:' Keyword
+' ' Text
+'parent' Name.Other
+'.' Punctuation
+'horizontalCenter' Name.Other
+';' Punctuation
+' ' Text
+'color:' Keyword
+' ' Text
+'"white"' Literal.String.Double
+';' Punctuation
+' ' Text
+'text:' Keyword
+' ' Text
+'numMines' Name.Other
+' ' Text
+'}' Punctuation
+'\n ' Text
+'}' Punctuation
+'\n\n ' Text
+'Column' Name.Other
+' ' Text
+'{' Punctuation
+'\n ' Text
+'spacing:' Keyword
+' ' Text
+'2' Literal.Number.Integer
+'\n ' Text
+'Image' Name.Other
+' ' Text
+'{' Punctuation
+' ' Text
+'source:' Keyword
+' ' Text
+'"MinehuntCore/pics/flag-color.png"' Literal.String.Double
+' ' Text
+'}' Punctuation
+'\n ' Text
+'Text' Name.Other
+' ' Text
+'{' Punctuation
+' ' Text
+'anchors.horizontalCenter:' Keyword
+' ' Text
+'parent' Name.Other
+'.' Punctuation
+'horizontalCenter' Name.Other
+';' Punctuation
+' ' Text
+'color:' Keyword
+' ' Text
+'"white"' Literal.String.Double
+';' Punctuation
+' ' Text
+'text:' Keyword
+' ' Text
+'numFlags' Name.Other
+' ' Text
+'}' Punctuation
+'\n ' Text
+'}' Punctuation
+'\n ' Text
+'}' Punctuation
+'\n\n ' Text
+'Image' Name.Other
+' ' Text
+'{' Punctuation
+'\n ' Text
+'anchors.bottom:' Keyword
+' ' Text
+'field' Name.Other
+'.' Punctuation
+'bottom' Name.Other
+';' Punctuation
+' ' Text
+'anchors.bottomMargin:' Keyword
+' ' Text
+'15' Literal.Number.Integer
+'\n ' Text
+'anchors.right:' Keyword
+' ' Text
+'field' Name.Other
+'.' Punctuation
+'right' Name.Other
+';' Punctuation
+' ' Text
+'anchors.rightMargin:' Keyword
+' ' Text
+'20' Literal.Number.Integer
+'\n ' Text
+'source:' Keyword
+' ' Text
+'isPlaying' Name.Other
+' ' Text
+'?' Operator
+' ' Text
+"'MinehuntCore/pics/face-smile.png'" Literal.String.Single
+' ' Text
+':' Operator
+'\n ' Text
+'hasWon' Name.Other
+' ' Text
+'?' Operator
+' ' Text
+"'MinehuntCore/pics/face-smile-big.png'" Literal.String.Single
+':' Operator
+' ' Text
+"'MinehuntCore/pics/face-sad.png'" Literal.String.Single
+'\n\n ' Text
+'MouseArea' Name.Other
+' ' Text
+'{' Punctuation
+' ' Text
+'anchors.fill:' Keyword
+' ' Text
+'parent' Name.Other
+';' Punctuation
+' ' Text
+'onPressed:' Keyword
+' ' Text
+'reset' Name.Other
+'(' Punctuation
+')' Punctuation
+' ' Text
+'}' Punctuation
+'\n ' Text
+'}' Punctuation
+'\n ' Text
+'Text' Name.Other
+' ' Text
+'{' Punctuation
+'\n ' Text
+'anchors.centerIn:' Keyword
+' ' Text
+'parent' Name.Other
+';' Punctuation
+' ' Text
+'width:' Keyword
+' ' Text
+'parent' Name.Other
+'.' Punctuation
+'width' Name.Other
+' ' Text
+'-' Operator
+' ' Text
+'20' Literal.Number.Integer
+'\n ' Text
+'horizontalAlignment:' Keyword
+' ' Text
+'Text' Name.Other
+'.' Punctuation
+'AlignHCenter' Name.Other
+'\n ' Text
+'wrapMode:' Keyword
+' ' Text
+'Text' Name.Other
+'.' Punctuation
+'WordWrap' Name.Other
+'\n ' Text
+'text:' Keyword
+' ' Text
+'"Minehunt demo has to be compiled to run.\\n\\nPlease see README."' Literal.String.Double
+'\n ' Text
+'color:' Keyword
+' ' Text
+'"white"' Literal.String.Double
+';' Punctuation
+' ' Text
+'font.bold:' Keyword
+' ' Text
+'true' Keyword.Constant
+';' Punctuation
+' ' Text
+'font.pixelSize:' Keyword
+' ' Text
+'14' Literal.Number.Integer
+'\n ' Text
+'visible:' Keyword
+' ' Text
+'tiles' Name.Other
+' ' Text
+'==' Operator
+' ' Text
+'undefined' Keyword.Constant
+'\n ' Text
+'}' Punctuation
+'\n\n ' Text
+'}' Punctuation
+'\n' Text