From 7db0de09dd708d732f4fcd9916b58bc3cb091778 Mon Sep 17 00:00:00 2001 From: jmeaster30 Date: Tue, 4 Apr 2023 23:24:39 -0400 Subject: [PATCH] Fixed issue with not strings not working at all. --- LICENSE | 42 +++++++++---------- .../.vscode/launch.json | 32 +++++++------- libvore-syntax-highlighter/LICENSE | 42 +++++++++---------- libvore-syntax-highlighter/README.md | 10 ++--- libvore-syntax-highlighter/package.json | 2 +- .../vsc-extension-quickstart.md | 29 +++++++++++++ libvore/engine.go | 5 ++- 7 files changed, 97 insertions(+), 65 deletions(-) create mode 100644 libvore-syntax-highlighter/vsc-extension-quickstart.md diff --git a/LICENSE b/LICENSE index 383dc77..cb0e937 100644 --- a/LICENSE +++ b/LICENSE @@ -1,21 +1,21 @@ -MIT License - -Copyright (c) 2022 John Easterday - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +MIT License + +Copyright (c) 2022 John Easterday + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/libvore-syntax-highlighter/.vscode/launch.json b/libvore-syntax-highlighter/.vscode/launch.json index 0e191b5..ee866f3 100644 --- a/libvore-syntax-highlighter/.vscode/launch.json +++ b/libvore-syntax-highlighter/.vscode/launch.json @@ -1,17 +1,17 @@ -// A launch configuration that launches the extension inside a new window -// Use IntelliSense to learn about possible attributes. -// Hover to view descriptions of existing attributes. -// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 -{ - "version": "0.2.0", - "configurations": [ - { - "name": "Extension", - "type": "extensionHost", - "request": "launch", - "args": [ - "--extensionDevelopmentPath=${workspaceFolder}" - ] - } - ] +// A launch configuration that launches the extension inside a new window +// Use IntelliSense to learn about possible attributes. +// Hover to view descriptions of existing attributes. +// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 +{ + "version": "0.2.0", + "configurations": [ + { + "name": "Extension", + "type": "extensionHost", + "request": "launch", + "args": [ + "--extensionDevelopmentPath=${workspaceFolder}" + ] + } + ] } \ No newline at end of file diff --git a/libvore-syntax-highlighter/LICENSE b/libvore-syntax-highlighter/LICENSE index 383dc77..cb0e937 100644 --- a/libvore-syntax-highlighter/LICENSE +++ b/libvore-syntax-highlighter/LICENSE @@ -1,21 +1,21 @@ -MIT License - -Copyright (c) 2022 John Easterday - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +MIT License + +Copyright (c) 2022 John Easterday + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/libvore-syntax-highlighter/README.md b/libvore-syntax-highlighter/README.md index 1e0b183..0474bcb 100644 --- a/libvore-syntax-highlighter/README.md +++ b/libvore-syntax-highlighter/README.md @@ -1,5 +1,5 @@ -# libvore-syntax-highlighter README - -This package provide syntax highlighting functionality for the Vore regex language - -Package - `vsce package` +# libvore-syntax-highlighter README + +This package provide syntax highlighting functionality for the Vore regex language + +Package - `vsce package` diff --git a/libvore-syntax-highlighter/package.json b/libvore-syntax-highlighter/package.json index 0e6f245..19df201 100644 --- a/libvore-syntax-highlighter/package.json +++ b/libvore-syntax-highlighter/package.json @@ -5,7 +5,7 @@ "version": "0.0.1", "repository": "https://github.com/jmeaster30/vore", "engines": { - "vscode": "^1.73.0" + "vscode": "^1.70.0" }, "scripts": { "build": "vsce package" diff --git a/libvore-syntax-highlighter/vsc-extension-quickstart.md b/libvore-syntax-highlighter/vsc-extension-quickstart.md new file mode 100644 index 0000000..4d89b2a --- /dev/null +++ b/libvore-syntax-highlighter/vsc-extension-quickstart.md @@ -0,0 +1,29 @@ +# Welcome to your VS Code Extension + +## What's in the folder + +* This folder contains all of the files necessary for your extension. +* `package.json` - this is the manifest file in which you declare your language support and define the location of the grammar file that has been copied into your extension. +* `syntaxes/vore.tmLanguage.json` - this is the Text mate grammar file that is used for tokenization. +* `language-configuration.json` - this is the language configuration, defining the tokens that are used for comments and brackets. + +## Get up and running straight away + +* Make sure the language configuration settings in `language-configuration.json` are accurate. +* Press `F5` to open a new window with your extension loaded. +* Create a new file with a file name suffix matching your language. +* Verify that syntax highlighting works and that the language configuration settings are working. + +## Make changes + +* You can relaunch the extension from the debug toolbar after making changes to the files listed above. +* You can also reload (`Ctrl+R` or `Cmd+R` on Mac) the VS Code window with your extension to load your changes. + +## Add more language features + +* To add features such as intellisense, hovers and validators check out the VS Code extenders documentation at https://code.visualstudio.com/docs + +## Install your extension + +* To start using your extension with Visual Studio Code copy it into the `/.vscode/extensions` folder and restart Code. +* To share your extension with the world, read on https://code.visualstudio.com/docs about publishing an extension. diff --git a/libvore/engine.go b/libvore/engine.go index 8366749..410b31f 100644 --- a/libvore/engine.go +++ b/libvore/engine.go @@ -436,7 +436,10 @@ func (es *SearchEngineState) MATCHOPTIONS(options []string, not bool) { func (es *SearchEngineState) MATCH(value string, not bool) { comp := es.READ(len(value)) - if value == comp { + if !not && value == comp { + es.CONSUME(len(value)) + es.NEXT() + } else if not && value != comp { es.CONSUME(len(value)) es.NEXT() } else {