Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sogaiu/janet-bounds
https://github.com/sogaiu/janet-bounds
editor janet source
Last synced: 21 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/sogaiu/janet-bounds
- Owner: sogaiu
- Created: 2023-07-20T08:27:18.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-08-07T11:06:41.000Z (5 months ago)
- Last Synced: 2024-08-08T19:19:44.754Z (5 months ago)
- Topics: editor, janet, source
- Language: Janet
- Homepage:
- Size: 66.4 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# janet-bounds
Code for determining bounds of things in strings of Janet source code.
## Demo
Given the file `data/bounds-input-symbol.txt` with content:
```
Line: 1
Column: 9(defn my-fun
[x y]
(+ x (* 2 y)))
```The bounds of what is at line 1, column 9 can be determined by:
```
cat data/bounds-input-symbol.txt | janet janet-bounds/bounds.janet
```The result should be:
```
1 7 1 13
```which corresponds to the bounds of the symbol `my-fun`, which starts
at line 1, column 7 and extends to line 1, column 13.## Use
The code is currently used via Emacs Lisp code in
[janet-editor-elf](https://github.com/sogaiu/janet-editor-elf) in two
ways. One is directly via process invocation and another is
indirectly as library code via a Janet program for "wrapping" existing
forms.