https://github.com/blockception/bc-vscode-words
The lexical analyzers basics used for analyzing code from VSCode documents
https://github.com/blockception/bc-vscode-words
basic hacktoberfest hacktoberfest2022 language lexical lexical-analyzer vscode
Last synced: 6 months ago
JSON representation
The lexical analyzers basics used for analyzing code from VSCode documents
- Host: GitHub
- URL: https://github.com/blockception/bc-vscode-words
- Owner: Blockception
- License: bsd-3-clause
- Created: 2021-02-15T13:38:13.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2025-04-01T22:00:05.000Z (7 months ago)
- Last Synced: 2025-04-12T03:38:54.061Z (6 months ago)
- Topics: basic, hacktoberfest, hacktoberfest2022, language, lexical, lexical-analyzer, vscode
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/bc-vscode-words
- Size: 579 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Blockception Vscode Words
[](https://github.com/Blockception/BC-VSCode-Words/actions/workflows/npm-publish.yml)
[](https://github.com/Blockception/BC-VSCode-Words/actions/workflows/npm-test.yml)
[](https://github.com/Blockception/BC-VSCode-Words/actions/workflows/tagged-release.yml)![]()
The lexical analyzers basics used for analyzing code from VSCode documents
## Examples
```ts
//Offset words contain only the offset of the word in the text
function Process(doc: TextDocument) {
let Words = RangedWord.Parse(doc, /([^ \t\r\n]+)+/gi);foreach(var W in Words) {
if (W.text === "hello") {
let offset = W.offset;
let pos = doc.positionAt(offset);
}
}
}
``````ts
//Ranged words contain the start (the character and line) and end of a word
function Process(doc: TextDocument) {
let Words = RangedWord.Parse(doc, /([^ \t\r\n]+)+/gi);foreach(var W in Words) {
if (W.text === "hello") {
let range = W.range;
}
}
}
``````ts
//Location words contain the start (the character and line) and end of a word and the uri
function Process(doc: TextDocument) {
let Words = LocationWord.ParseFromRegexDoc(doc, /([^ \t\r\n]+)+/gi);foreach(var W in Words) {
if (W.text === "hello") {
let range = W.location.range;
let uri = W.location.uri
}
}
}
```## Contributing
First, read the [contributing guide](./CONTRIBUTING.md). fork the project, clone it and run the following commands:
**Installation**
```cmd
npm ci
npm update
```