Skip to content

Commit

Permalink
Merge pull request #60 from GabrieleMessina/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
GabrieleMessina authored Apr 8, 2024
2 parents 4a7689b + df8424d commit 210e441
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 35 deletions.
29 changes: 6 additions & 23 deletions playground/examples/grover_search.qut
Original file line number Diff line number Diff line change
@@ -1,27 +1,10 @@
// qustring a = "0*00";
// quint a = [0q, 0q, 0q, 0q, 0q, 0q, [0,1]q, [0,1]q];
qustring b = "1110111";

qustring c = "00000011";
if("1" is c){
print "Exact Match Found!";
if("01" in b){
print "Substring Match Found!";
}
else{
print "Exact Match Not Found";
}



// quint a = [0q, 0q, 0q, 0q, 0q, 0q, [0,1]q, [0,1]q];
// qustring b = "1110111";
// if("11" is a){
// print "Exact Match Found!";
// }
// else{
// print "Exact Match Not Found";
// }

// if("01" in b){
// print "Substring Match Found!";
// }
// else{
// print "Substring Match Not Found";
// }
print "Substring Match Not Found";
}
36 changes: 28 additions & 8 deletions qutes-vscode/extension.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
// The module 'vscode' contains the VS Code extensibility API
// Import the module and reference it with the alias vscode in your code below
const vscode = require('vscode');

// this method is called when your extension is activated
// your extension is activated the very first time the command is executed

/**
* @param {vscode.ExtensionContext} context
*/
function activate(context) {
let disposable = vscode.commands.registerCommand('qutes.runQutesFile', function () {
let runQutesFileCommand = vscode.commands.registerCommand('qutes.runQutesFile', function () {
let activeEditor = vscode.window.activeTextEditor;
if (!activeEditor || activeEditor.document.languageId !== 'qutes') {
return; // no active editor or the active file is not a Qutes file
Expand All @@ -32,10 +27,35 @@ function activate(context) {
// Start debugging with the defined configuration
vscode.debug.startDebugging(undefined, debugConfiguration);
});
context.subscriptions.push(disposable);

let runQutesFile100Command = vscode.commands.registerCommand('qutes.runQutesFile100', function () {
let activeEditor = vscode.window.activeTextEditor;
if (!activeEditor || activeEditor.document.languageId !== 'qutes') {
return; // no active editor or the active file is not a Qutes file
}

let filePath = activeEditor.document.uri.fsPath;

// Define a debug configuration
let debugConfiguration = {
name: "Run Qutes File",
type: "debugpy",
request: "launch",
program: "src/qutes.py",
console: "integratedTerminal",
args: ["-image","-circuit","-iter","100",filePath],
justMyCode: true

};

// Start debugging with the defined configuration
vscode.debug.startDebugging(undefined, debugConfiguration);
});

context.subscriptions.push(runQutesFileCommand);
context.subscriptions.push(runQutesFile100Command);
}

// this method is called when your extension is deactivated
function deactivate() {}

// eslint-disable-next-line no-undef
Expand Down
31 changes: 27 additions & 4 deletions qutes-vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"author": "Gabriele Messina",
"publisher": "GabrieleMessina",
"license": "MIT",
"version": "1.1.0",
"version": "1.1.1",
"engines": {
"vscode": "^1.52.0"
},
Expand Down Expand Up @@ -43,17 +43,40 @@
"commands": [
{
"command": "qutes.runQutesFile",
"title": "Run Qutes File"
"title": "Run Qutes File",
"icon": "$(run)"
},
{
"command": "qutes.runQutesFile100",
"title": "Run Qutes File 100 times",
"icon": "$(run-all)"
}
],
"menus": {
"editor/title": [
"editor/title/run": [
{
"command": "qutes.runQutesFile",
"group": "navigation",
"when": "resourceLangId == qutes"
},
{
"command": "qutes.runQutesFile100",
"group": "navigation",
"when": "resourceLangId == qutes"
}
]
],
"editor/title": [
{
"command": "qutes.runQutesFile",
"group": "navigation",
"when": "resourceLangId == qutes"
},
{
"command": "qutes.runQutesFile100",
"group": "navigation",
"when": "resourceLangId == qutes"
}
]
}
},
"scripts": {},
Expand Down

0 comments on commit 210e441

Please sign in to comment.