Compare commits
6 Commits
v0.0.3-alp
...
59fe554259
| Author | SHA1 | Date | |
|---|---|---|---|
|
59fe554259
|
|||
|
8b93b955e8
|
|||
|
f77caf604f
|
|||
|
8b49ab6085
|
|||
|
154e557339
|
|||
|
04cce4224e
|
1
.clangd
1
.clangd
@@ -2,6 +2,7 @@ CompileFlags:
|
|||||||
Add: [
|
Add: [
|
||||||
-I/home/syed/main/crib/include,
|
-I/home/syed/main/crib/include,
|
||||||
-I/home/syed/main/crib/libs,
|
-I/home/syed/main/crib/libs,
|
||||||
|
-I/home/syed/main/crib/libs/mruby/include,
|
||||||
-std=c++23
|
-std=c++23
|
||||||
]
|
]
|
||||||
Remove: []
|
Remove: []
|
||||||
|
|||||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -17,4 +17,6 @@ bin
|
|||||||
Gemfile*
|
Gemfile*
|
||||||
.ruby-lsp/
|
.ruby-lsp/
|
||||||
|
|
||||||
|
include/scripting/ruby_compiled.h
|
||||||
|
|
||||||
__old__
|
__old__
|
||||||
|
|||||||
4
.gitmodules
vendored
4
.gitmodules
vendored
@@ -2,3 +2,7 @@
|
|||||||
path = libs/libgrapheme
|
path = libs/libgrapheme
|
||||||
url = git://git.suckless.org/libgrapheme
|
url = git://git.suckless.org/libgrapheme
|
||||||
ignore = dirty
|
ignore = dirty
|
||||||
|
[submodule "libs/mruby"]
|
||||||
|
path = libs/mruby
|
||||||
|
url = https://github.com/mruby/mruby.git
|
||||||
|
ignore = dirty
|
||||||
|
|||||||
14
Makefile
14
Makefile
@@ -20,8 +20,8 @@ CFLAGS_DEBUG :=\
|
|||||||
-O0 -fno-inline -gsplit-dwarf \
|
-O0 -fno-inline -gsplit-dwarf \
|
||||||
-g -fno-omit-frame-pointer \
|
-g -fno-omit-frame-pointer \
|
||||||
-Wno-unused-command-line-argument \
|
-Wno-unused-command-line-argument \
|
||||||
-fsanitize=address \
|
-I./include -I./libs -I/home/syed/main/crib/libs/mruby/include
|
||||||
-I./include -I./libs
|
# -fsanitize=address \
|
||||||
|
|
||||||
CFLAGS_RELEASE :=\
|
CFLAGS_RELEASE :=\
|
||||||
-static --target=x86_64-linux-musl \
|
-static --target=x86_64-linux-musl \
|
||||||
@@ -32,7 +32,7 @@ CFLAGS_RELEASE :=\
|
|||||||
-fomit-frame-pointer -DNDEBUG -s \
|
-fomit-frame-pointer -DNDEBUG -s \
|
||||||
-mllvm -vectorize-loops \
|
-mllvm -vectorize-loops \
|
||||||
-Wno-unused-command-line-argument \
|
-Wno-unused-command-line-argument \
|
||||||
-I./include -I./libs
|
-I./include -I./libs -I/home/syed/main/crib/libs/mruby/include
|
||||||
|
|
||||||
PCH_CFLAGS_DEBUG := $(CFLAGS_DEBUG) -x c++-header
|
PCH_CFLAGS_DEBUG := $(CFLAGS_DEBUG) -x c++-header
|
||||||
PCH_CFLAGS_RELEASE := $(CFLAGS_RELEASE) -x c++-header
|
PCH_CFLAGS_RELEASE := $(CFLAGS_RELEASE) -x c++-header
|
||||||
@@ -43,12 +43,12 @@ UNICODE_OBJ_DEBUG := $(patsubst libs/unicode_width/%.c,$(OBJ_DIR)/debug/unicode_
|
|||||||
UNICODE_OBJ_RELEASE := $(patsubst libs/unicode_width/%.c,$(OBJ_DIR)/release/unicode_width/%.o,$(UNICODE_SRC))
|
UNICODE_OBJ_RELEASE := $(patsubst libs/unicode_width/%.c,$(OBJ_DIR)/release/unicode_width/%.o,$(UNICODE_SRC))
|
||||||
|
|
||||||
LIBS_RELEASE := \
|
LIBS_RELEASE := \
|
||||||
libs/libgrapheme/libgrapheme.a \
|
libs/libgrapheme/libgrapheme.a ./libs/mruby/build/host/lib/libmruby.a \
|
||||||
-Wl,-Bstatic,--gc-sections -lpcre2-8 -lmruby
|
-Wl,-Bstatic,--gc-sections -lpcre2-8
|
||||||
|
|
||||||
LIBS_DEBUG := \
|
LIBS_DEBUG := \
|
||||||
libs/libgrapheme/libgrapheme.a \
|
libs/libgrapheme/libgrapheme.a ./libs/mruby/build/host/lib/libmruby.a \
|
||||||
-Wl,-Bdynamic -lpcre2-8 -lmruby
|
-Wl,-Bdynamic -lpcre2-8
|
||||||
|
|
||||||
SRC := $(wildcard $(SRC_DIR)/**/*.cc) $(wildcard $(SRC_DIR)/*.cc)
|
SRC := $(wildcard $(SRC_DIR)/**/*.cc) $(wildcard $(SRC_DIR)/*.cc)
|
||||||
OBJ_DEBUG := $(patsubst $(SRC_DIR)/%.cc,$(OBJ_DIR)/debug/%.o,$(SRC))
|
OBJ_DEBUG := $(patsubst $(SRC_DIR)/%.cc,$(OBJ_DIR)/debug/%.o,$(SRC))
|
||||||
|
|||||||
@@ -20,9 +20,8 @@ Binary can be installed with the following command:
|
|||||||
curl https://syedm.dev/crib | sh
|
curl https://syedm.dev/crib | sh
|
||||||
```
|
```
|
||||||
|
|
||||||
It requires `libmagic` to be installed (most systems have it preinstalled).<br>
|
|
||||||
Currently only for Linux.<br>
|
Currently only for Linux.<br>
|
||||||
*Tested with arch linux and ubuntu*<br>
|
*Tested with arch linux and ubuntu and void*<br>
|
||||||
|
|
||||||
## Building
|
## Building
|
||||||
|
|
||||||
@@ -99,7 +98,7 @@ The following lsp's are added by default and can be installed anywhere in your `
|
|||||||
|
|
||||||
#### Compiler
|
#### Compiler
|
||||||
|
|
||||||
`clang++` should work fine but `c++23+` is required.<br>
|
`g++` or `clang++` should work fine but `c++20+` is required.<br>
|
||||||
Can remove `ccache` if you want from the makefile.<br>
|
Can remove `ccache` if you want from the makefile.<br>
|
||||||
|
|
||||||
#### Compliling
|
#### Compliling
|
||||||
|
|||||||
44
TODO.md
44
TODO.md
@@ -2,35 +2,49 @@ Copyright 2025 Syed Daanish
|
|||||||
|
|
||||||
# TODO
|
# TODO
|
||||||
|
|
||||||
|
# memory usage for debug build (release build will be smaller by about 25%)
|
||||||
|
```
|
||||||
|
8K -> 13.2M
|
||||||
|
128K -> 13.2M (expected worst case 16.6M)
|
||||||
|
128M -> 412.0M (expected worst case 2.3G)
|
||||||
|
```
|
||||||
|
|
||||||
##### BTW Check each lsp with each of the features implemented
|
##### BTW Check each lsp with each of the features implemented
|
||||||
|
|
||||||
* [ ] Make a proper qeued system for bar contents from ruby
|
* Possibly in the future limit memory usage by parser for larger files
|
||||||
* [ ] Allow clipbaord setting & alpha in ini files
|
* Also redo lsp threads such that no mutex needed for any rope stuff
|
||||||
|
- This will mean that parsers/renderers and keystrokes will not need to be individually locked
|
||||||
|
- And so it will be much faster
|
||||||
|
- While at it also make the lsp instead of a single thread be a pool of threads blocking on their stdio
|
||||||
|
- So one lsp being slower wont affect others and fps based reading wont be necessary saving cpu
|
||||||
|
- At which point the main thread can also be blocked on user input or lsp responses and still be fast
|
||||||
|
* [ ] Add mgems for most common things and a ruby library to allow combining true ruby with mruby
|
||||||
|
* add command to set and use a file type at runtime
|
||||||
|
* [ ] color alpha in ini files
|
||||||
* [ ] Make warning before ctrl+q for saving
|
* [ ] Make warning before ctrl+q for saving
|
||||||
* [ ] **LSP Bug:** Check why `fish-lsp` is behaving so off with completions filtering.
|
* [ ] **LSP Bug:** Check why `fish-lsp` is behaving so off with completions filtering.
|
||||||
* [ ] **Line move:** fix the move line functions to work without the calculations from folds as folds are removed.
|
* [ ] **Line move:** fix the move line functions to work without the calculations from folds as folds are removed.
|
||||||
* [ ] **Editor Indentation Fix:** - Main : merger indentation with the parser for more accurate results.
|
* [ ] **Editor Indentation Fix:** - Main : merger indentation with the parser for more accurate results.
|
||||||
* [ ] Fix bug where enter at start of line with ending type crashes
|
|
||||||
* [ ] Keep cache of language maps in engine to reduce lookup time.
|
|
||||||
* [ ] In indents add function to support tab which indents if before any content and inserts a pure \t otherwise.
|
|
||||||
* [ ] And backspace which undents if before any content.
|
|
||||||
* [ ] Add block indentation support.
|
|
||||||
* [ ] Ignore comments/strings from parser when auto-indenting.
|
* [ ] Ignore comments/strings from parser when auto-indenting.
|
||||||
* [ ] These will dedent when the block immediately after them is dedented
|
* [ ] **Readme:** Update readme to show ruby based config in detail.
|
||||||
* [ ] Dont dedent if ending is valid starting is invalid but also empty
|
|
||||||
* [ ] Just leave asis if starting is empty
|
|
||||||
* [ ] **Readme:** Update readme to show ruby based config.
|
|
||||||
* [ ] **UI Refinement:**
|
* [ ] **UI Refinement:**
|
||||||
* [ ] Allow completion list to be scrolled; show only `x` max items.
|
|
||||||
* [ ] Finish autocomplete box style functions.
|
* [ ] Finish autocomplete box style functions.
|
||||||
* [ ] **Documentation UI:** Capture `Ctrl+h` / `Ctrl+l` for scrolling documentation windows.
|
* [ ] **Documentation UI:** Capture `Ctrl+h` / `Ctrl+l` for scrolling documentation windows.
|
||||||
* [ ] Redo hooks as a struct.
|
* [ ] Redo hooks as a struct.
|
||||||
* [ ] breakdown the render function into smaller functions.
|
* [ ] breakdown the render function into smaller functions.
|
||||||
|
- Might allow for VAI integration easier
|
||||||
|
|
||||||
* Try to make all functions better now that folds have been purged
|
* Try to make all functions better now that folds have been purged
|
||||||
* Cleanup syntax and renderer files
|
* Cleanup syntax and renderer files
|
||||||
|
|
||||||
* Add a thing called view which is a rect with speacial type editor . but otherwise a ruby or c++ view
|
* add `:j<n>` command to jump to line \<n> in the current file
|
||||||
|
* and many more stuff like ruby execution
|
||||||
|
* and give warning for invalid commands
|
||||||
|
* and upon escape clear the current command
|
||||||
|
* allow multiline logging which captures the input entirely and y will copy the log and anything else will exit
|
||||||
|
* it will then collapse to being the first line from the log only
|
||||||
|
|
||||||
|
* **RN** Add a thing called view which is a rect with speacial type editor . but otherwise a ruby or c++ view
|
||||||
* can be used for stuff like file manager/git manager/theme picker.
|
* can be used for stuff like file manager/git manager/theme picker.
|
||||||
* allow flushing functions in ruby to tell c++ to refresh keybinds/themes etc.
|
* allow flushing functions in ruby to tell c++ to refresh keybinds/themes etc.
|
||||||
* allow keybinds to be set in ruby
|
* allow keybinds to be set in ruby
|
||||||
@@ -72,8 +86,6 @@ move lsp configs to json and also allow configs for windows-style vs unix-style
|
|||||||
|
|
||||||
### UX
|
### UX
|
||||||
|
|
||||||
* [ ] **Editor word highlighter:** Do not recompute word under cursor if not changed.
|
|
||||||
|
|
||||||
* [ ] **Completion Filtering:**
|
* [ ] **Completion Filtering:**
|
||||||
* [ ] Stop filtering case-sensitive.
|
* [ ] Stop filtering case-sensitive.
|
||||||
* [ ] Normalize completion edits if local filtering is used.
|
* [ ] Normalize completion edits if local filtering is used.
|
||||||
@@ -103,8 +115,6 @@ move lsp configs to json and also allow configs for windows-style vs unix-style
|
|||||||
|
|
||||||
### Visuals, UI & Extensions?
|
### Visuals, UI & Extensions?
|
||||||
|
|
||||||
* [ ] **Status Bar:** Complete status bar and command runner.
|
|
||||||
|
|
||||||
* [ ] Add color picker/palette.
|
* [ ] Add color picker/palette.
|
||||||
|
|
||||||
* [ ] **Git:** Add Git integration (status, diffs).
|
* [ ] **Git:** Add Git integration (status, diffs).
|
||||||
|
|||||||
@@ -1,3 +1,10 @@
|
|||||||
|
# Files can be insluded using Kernel#require_relative
|
||||||
|
# but it can be called with binding as the second argument
|
||||||
|
# skipping it will call it with global binding which is usually fine
|
||||||
|
# Kernel#load can also be used
|
||||||
|
|
||||||
|
require_relative "theme"
|
||||||
|
|
||||||
# basic configuration
|
# basic configuration
|
||||||
# This can also be used to do speacail configs for different projects.
|
# This can also be used to do speacail configs for different projects.
|
||||||
# its ruby guys script whatever you want.
|
# its ruby guys script whatever you want.
|
||||||
@@ -12,43 +19,6 @@ C.shutdown do
|
|||||||
puts "Exiting crib..."
|
puts "Exiting crib..."
|
||||||
end
|
end
|
||||||
|
|
||||||
# this can be modified by the user during runtime through keybindings
|
|
||||||
# But i need to know how to ever read this value only when needed.
|
|
||||||
# maybe i can write a function that notifies if theme maybe changed then reload
|
|
||||||
# It can also be scripted to load different theme formats into a hash usable by crib
|
|
||||||
C.theme = {
|
|
||||||
:default => { fg: 0xEEEEEE },
|
|
||||||
:shebang => { fg: 0x7DCFFF },
|
|
||||||
:error => { fg: 0xEF5168 },
|
|
||||||
:comment => { fg: 0xAAAAAA, italic: true },
|
|
||||||
:string => { fg: 0xAAD94C },
|
|
||||||
:escape => { fg: 0x7DCFFF },
|
|
||||||
:interpolation => { fg: 0x7DCFFF },
|
|
||||||
:regexp => { fg: 0xD2A6FF },
|
|
||||||
:number => { fg: 0xE6C08A },
|
|
||||||
# rubocop:disable Lint/BooleanSymbol
|
|
||||||
:true => { fg: 0x7AE93C },
|
|
||||||
:false => { fg: 0xEF5168 },
|
|
||||||
# rubocop:enable Lint/BooleanSymbol
|
|
||||||
:char => { fg: 0xFFAF70 },
|
|
||||||
:keyword => { fg: 0xFF8F40 },
|
|
||||||
:keywordoperator => { fg: 0xF07178 },
|
|
||||||
:operator => { fg: 0xFFFFFF, italic: true },
|
|
||||||
:function => { fg: 0xFFAF70 },
|
|
||||||
:type => { fg: 0xF07178 },
|
|
||||||
:constant => { fg: 0x7DCFFF },
|
|
||||||
:variableinstance => { fg: 0x95E6CB },
|
|
||||||
:variableglobal => { fg: 0xF07178 },
|
|
||||||
:annotation => { fg: 0x7DCFFF },
|
|
||||||
:directive => { fg: 0xFF8F40 },
|
|
||||||
:label => { fg: 0xD2A6FF },
|
|
||||||
:brace1 => { fg: 0xD2A6FF },
|
|
||||||
:brace2 => { fg: 0xFFAFAF },
|
|
||||||
:brace3 => { fg: 0xFFFF00 },
|
|
||||||
:brace4 => { fg: 0x0FFF0F },
|
|
||||||
:brace5 => { fg: 0xFF0F0F }
|
|
||||||
}
|
|
||||||
|
|
||||||
# TODO: to be done once a proper api for binding and window drawing is made
|
# TODO: to be done once a proper api for binding and window drawing is made
|
||||||
# The binds will be connected to either `editor` or windows where editor can
|
# The binds will be connected to either `editor` or windows where editor can
|
||||||
# only use a preset set of stuff to bind while teh windows are purely custom
|
# only use a preset set of stuff to bind while teh windows are purely custom
|
||||||
@@ -99,7 +69,7 @@ C.extra_highlights do |_line, _idx|
|
|||||||
end
|
end
|
||||||
|
|
||||||
# The highlighter will be aplied to the language as long as the langauge is defined in C.languages
|
# The highlighter will be aplied to the language as long as the langauge is defined in C.languages
|
||||||
C.highlighters[:ruby_n] = {
|
C.highlighters[:string] = {
|
||||||
parser: ->(line, state, line_idx) {
|
parser: ->(line, state, line_idx) {
|
||||||
# the return value is a hash
|
# the return value is a hash
|
||||||
# it contains the state and the highlights
|
# it contains the state and the highlights
|
||||||
|
|||||||
36
config/theme.rb
Normal file
36
config/theme.rb
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
# this can be modified by the user during runtime through keybindings
|
||||||
|
# But i need to know how to ever read this value only when needed.
|
||||||
|
# maybe i can write a function that notifies if theme maybe changed then reload
|
||||||
|
# It can also be scripted to load different theme formats into a hash usable by crib
|
||||||
|
C.theme = {
|
||||||
|
:default => { fg: 0xEEEEEE },
|
||||||
|
:shebang => { fg: 0x7DCFFF },
|
||||||
|
:error => { fg: 0xEF5168 },
|
||||||
|
:comment => { fg: 0xAAAAAA, italic: true },
|
||||||
|
:string => { fg: 0xAAD94C },
|
||||||
|
:escape => { fg: 0x7DCFFF },
|
||||||
|
:interpolation => { fg: 0x7DCFFF },
|
||||||
|
:regexp => { fg: 0xD2A6FF },
|
||||||
|
:number => { fg: 0xE6C08A },
|
||||||
|
# rubocop:disable Lint/BooleanSymbol
|
||||||
|
:true => { fg: 0x7AE93C },
|
||||||
|
:false => { fg: 0xEF5168 },
|
||||||
|
# rubocop:enable Lint/BooleanSymbol
|
||||||
|
:char => { fg: 0xFFAF70 },
|
||||||
|
:keyword => { fg: 0xFF8F40 },
|
||||||
|
:keywordoperator => { fg: 0xF07178 },
|
||||||
|
:operator => { fg: 0xFFFFFF, italic: true },
|
||||||
|
:function => { fg: 0xFFAF70 },
|
||||||
|
:type => { fg: 0xF07178 },
|
||||||
|
:constant => { fg: 0x7DCFFF },
|
||||||
|
:variableinstance => { fg: 0x95E6CB },
|
||||||
|
:variableglobal => { fg: 0xF07178 },
|
||||||
|
:annotation => { fg: 0x7DCFFF },
|
||||||
|
:directive => { fg: 0xFF8F40 },
|
||||||
|
:label => { fg: 0xD2A6FF },
|
||||||
|
:brace1 => { fg: 0xD2A6FF },
|
||||||
|
:brace2 => { fg: 0xFFAFAF },
|
||||||
|
:brace3 => { fg: 0xFFFF00 },
|
||||||
|
:brace4 => { fg: 0x0FFF0F },
|
||||||
|
:brace5 => { fg: 0xFF0F0F }
|
||||||
|
}
|
||||||
@@ -17,6 +17,8 @@ void fetch_lsp_hover(Editor *editor);
|
|||||||
void handle_mouse(Editor *editor, KeyEvent event);
|
void handle_mouse(Editor *editor, KeyEvent event);
|
||||||
void indent_current_line(Editor *editor);
|
void indent_current_line(Editor *editor);
|
||||||
void dedent_current_line(Editor *editor);
|
void dedent_current_line(Editor *editor);
|
||||||
|
void indent_selection(Editor *editor);
|
||||||
|
void dedent_selection(Editor *editor);
|
||||||
void paste(Editor *editor);
|
void paste(Editor *editor);
|
||||||
void copy(Editor *editor);
|
void copy(Editor *editor);
|
||||||
void cut(Editor *editor);
|
void cut(Editor *editor);
|
||||||
|
|||||||
@@ -112,12 +112,18 @@ struct IndentationEngine {
|
|||||||
uint32_t set_indent(uint32_t row, int64_t indent_level);
|
uint32_t set_indent(uint32_t row, int64_t indent_level);
|
||||||
uint32_t indent_line(uint32_t row);
|
uint32_t indent_line(uint32_t row);
|
||||||
uint32_t dedent_line(uint32_t row);
|
uint32_t dedent_line(uint32_t row);
|
||||||
|
void indent_block(uint32_t start_row, uint32_t end_row, int delta);
|
||||||
void indent_block(uint32_t start, uint32_t end);
|
void indent_block(uint32_t start, uint32_t end);
|
||||||
void dedent_block(uint32_t start, uint32_t end);
|
void dedent_block(uint32_t start, uint32_t end);
|
||||||
// fixes a autocomplete block's indentation
|
// fixes a autocomplete block's indentation
|
||||||
char *block_to_asis(Coord cursor, std::string source, uint32_t *out_len);
|
char *block_to_asis(Coord cursor, std::string source, uint32_t *out_len);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
const std::vector<std::string> *start_end = nullptr;
|
||||||
|
const std::vector<std::string> *start_start = nullptr;
|
||||||
|
const std::vector<std::string> *end_full = nullptr;
|
||||||
|
const std::vector<std::string> *end_start = nullptr;
|
||||||
|
|
||||||
// TODO: Ignore comments/strings too
|
// TODO: Ignore comments/strings too
|
||||||
// returns the indent level of the line itself or of the previous non-empty
|
// returns the indent level of the line itself or of the previous non-empty
|
||||||
uint32_t indent_expected(uint32_t row);
|
uint32_t indent_expected(uint32_t row);
|
||||||
|
|||||||
@@ -115,8 +115,8 @@ LineIterator *begin_l_iter(Knot *root, uint32_t start_line);
|
|||||||
// Each subsequent call returns the next line as a null terminated string
|
// Each subsequent call returns the next line as a null terminated string
|
||||||
// `it` is the iterator returned from begin_l_iter
|
// `it` is the iterator returned from begin_l_iter
|
||||||
// After getting the necessary lines free the iterator (no need to go upto
|
// After getting the necessary lines free the iterator (no need to go upto
|
||||||
// the end) returns null if there are no more lines All return strings
|
// the end) returns null if there are no more lines
|
||||||
// `must` be freed by the caller
|
// The string must not be freed
|
||||||
char *next_line(LineIterator *it, uint32_t *out_len);
|
char *next_line(LineIterator *it, uint32_t *out_len);
|
||||||
|
|
||||||
// Returns the previous line as a null terminated string
|
// Returns the previous line as a null terminated string
|
||||||
|
|||||||
@@ -6,12 +6,17 @@
|
|||||||
#include "utils/utils.h"
|
#include "utils/utils.h"
|
||||||
|
|
||||||
struct LSPPending {
|
struct LSPPending {
|
||||||
std::string method;
|
|
||||||
Editor *editor = nullptr;
|
Editor *editor = nullptr;
|
||||||
|
std::function<void(Editor *, const json &)> callback;
|
||||||
std::function<void(Editor *, std::string, json)> callback;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// TODO: Defer any editor mutation to main thread to get rid of
|
||||||
|
// all mutex locks on the editor rope.
|
||||||
|
// struct LSPPendingResponse {
|
||||||
|
// LSPPending *pending = nullptr;
|
||||||
|
// json message;
|
||||||
|
// };
|
||||||
|
|
||||||
struct LSPOpenRequest {
|
struct LSPOpenRequest {
|
||||||
Language language;
|
Language language;
|
||||||
Editor *editor;
|
Editor *editor;
|
||||||
|
|||||||
@@ -4,12 +4,12 @@
|
|||||||
#define PCRE2_CODE_UNIT_WIDTH 8
|
#define PCRE2_CODE_UNIT_WIDTH 8
|
||||||
#define PCRE_WORKSPACE_SIZE 512
|
#define PCRE_WORKSPACE_SIZE 512
|
||||||
|
|
||||||
#include <mruby.h>
|
#include "mruby.h"
|
||||||
#include <mruby/array.h>
|
#include "mruby/array.h"
|
||||||
#include <mruby/compile.h>
|
#include "mruby/compile.h"
|
||||||
#include <mruby/hash.h>
|
#include "mruby/hash.h"
|
||||||
#include <mruby/irep.h>
|
#include "mruby/irep.h"
|
||||||
#include <mruby/string.h>
|
#include "mruby/string.h"
|
||||||
#include <nlohmann/json.hpp>
|
#include <nlohmann/json.hpp>
|
||||||
#include <pcre2.h>
|
#include <pcre2.h>
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|||||||
@@ -4,8 +4,12 @@
|
|||||||
#include "syntax/decl.h"
|
#include "syntax/decl.h"
|
||||||
#include "utils/utils.h"
|
#include "utils/utils.h"
|
||||||
|
|
||||||
|
namespace fs = std::filesystem;
|
||||||
|
|
||||||
extern std::unordered_map<std::string, std::pair<mrb_value, mrb_value>>
|
extern std::unordered_map<std::string, std::pair<mrb_value, mrb_value>>
|
||||||
custom_highlighters;
|
custom_highlighters;
|
||||||
|
extern mrb_state *mrb;
|
||||||
|
extern fs::path ruby_config_path;
|
||||||
|
|
||||||
struct BarLight {
|
struct BarLight {
|
||||||
uint32_t start;
|
uint32_t start;
|
||||||
@@ -29,14 +33,18 @@ struct BarLine {
|
|||||||
void setup_ruby_bindings(mrb_state *mrb, RClass *C_module);
|
void setup_ruby_bindings(mrb_state *mrb, RClass *C_module);
|
||||||
void ruby_start();
|
void ruby_start();
|
||||||
void ruby_shutdown();
|
void ruby_shutdown();
|
||||||
|
void ruby_copy(const char *text, size_t len);
|
||||||
|
std::string ruby_paste();
|
||||||
|
std::string ruby_file_detect(std::string filename);
|
||||||
void load_theme();
|
void load_theme();
|
||||||
void load_languages_info();
|
void load_languages_info();
|
||||||
uint8_t read_line_endings();
|
uint8_t read_line_endings();
|
||||||
void load_custom_highlighters();
|
void load_custom_highlighters();
|
||||||
mrb_value parse_custom(std::vector<Token> *tokens, mrb_value parser_block,
|
bool custom_compare(mrb_value match_block, std::string state1,
|
||||||
const char *line, uint32_t len, mrb_value state,
|
std::string state2);
|
||||||
|
std::string parse_custom(std::vector<Token> *tokens, mrb_value parser_block,
|
||||||
|
const char *line, uint32_t len, std::string state,
|
||||||
uint32_t c_line);
|
uint32_t c_line);
|
||||||
bool custom_compare(mrb_value match_block, mrb_value state1, mrb_value state2);
|
|
||||||
BarLine bar_contents(uint8_t mode, std::string lang_name, uint32_t warnings,
|
BarLine bar_contents(uint8_t mode, std::string lang_name, uint32_t warnings,
|
||||||
std::string lsp_name, std::string filename,
|
std::string lsp_name, std::string filename,
|
||||||
std::string foldername, uint32_t line, uint32_t max_line,
|
std::string foldername, uint32_t line, uint32_t max_line,
|
||||||
|
|||||||
@@ -1,3 +1,66 @@
|
|||||||
|
def command_exists?(cmd)
|
||||||
|
system("command -v #{cmd} > /dev/null 2>&1")
|
||||||
|
end
|
||||||
|
|
||||||
|
module Clipboard
|
||||||
|
@clip = ""
|
||||||
|
@os = :os_name_placed_here
|
||||||
|
|
||||||
|
class << self
|
||||||
|
def copy(text)
|
||||||
|
if @os == :windows
|
||||||
|
IO.popen("clip", "w") { |f| f.write(text) }
|
||||||
|
elsif @os == :mac
|
||||||
|
IO.popen("pbcopy", "w") { |f| f.write(text) }
|
||||||
|
elsif @os == :linux
|
||||||
|
if ENV["XDG_SESSION_TYPE"]&.downcase == "wayland" || ENV["WAYLAND_DISPLAY"]
|
||||||
|
if command_exists?("wl-copy")
|
||||||
|
IO.popen("wl-copy", "w") { |f| f.write(text) }
|
||||||
|
else
|
||||||
|
osc52_copy(text)
|
||||||
|
end
|
||||||
|
elsif ENV["XDG_SESSION_TYPE"]&.downcase == "x11" || ENV["DISPLAY"]
|
||||||
|
if command_exists?("xsel")
|
||||||
|
IO.popen("xsel --clipboard --input", "w") { |f| f.write(text) }
|
||||||
|
elsif command_exists?("xclip")
|
||||||
|
IO.popen("xclip -selection clipboard", "w") { |f| f.write(text) }
|
||||||
|
else
|
||||||
|
osc52_copy(text)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
@clip = text
|
||||||
|
end
|
||||||
|
def paste
|
||||||
|
if @os == :windows
|
||||||
|
return `powershell -NoProfile -Command Get-Clipboard`
|
||||||
|
elsif @os == :mac
|
||||||
|
return `pbpaste`
|
||||||
|
elsif @os == :linux
|
||||||
|
if ENV["XDG_SESSION_TYPE"]&.downcase == "wayland" || ENV["WAYLAND_DISPLAY"]
|
||||||
|
if command_exists?("wl-copy")
|
||||||
|
return `wl-paste`
|
||||||
|
end
|
||||||
|
elsif ENV["XDG_SESSION_TYPE"]&.downcase == "x11" || ENV["DISPLAY"]
|
||||||
|
if command_exists?("xsel")
|
||||||
|
return `xsel --clipboard --output`
|
||||||
|
elsif command_exists?("xclip")
|
||||||
|
return `xclip -selection clipboard -o`
|
||||||
|
else
|
||||||
|
return @clip
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return ""
|
||||||
|
end
|
||||||
|
def osc52_copy(text)
|
||||||
|
encoded = [text].pack("m0")
|
||||||
|
print "\e]52;c;#{encoded}\a"
|
||||||
|
text
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
module C
|
module C
|
||||||
@lsp_config = {
|
@lsp_config = {
|
||||||
"clangd" => [
|
"clangd" => [
|
||||||
@@ -224,6 +287,11 @@ module C
|
|||||||
extensions: ["sh"],
|
extensions: ["sh"],
|
||||||
filenames: ["bash_profile", "bashrc"],
|
filenames: ["bash_profile", "bashrc"],
|
||||||
lsp: "bash-language-server"
|
lsp: "bash-language-server"
|
||||||
|
},
|
||||||
|
default: {
|
||||||
|
color: 0x6d8086,
|
||||||
|
symbol: " ",
|
||||||
|
extensions: []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@theme = {
|
@theme = {
|
||||||
@@ -262,7 +330,7 @@ module C
|
|||||||
@highlighters = {}
|
@highlighters = {}
|
||||||
@b_startup = nil
|
@b_startup = nil
|
||||||
@b_shutdown = nil
|
@b_shutdown = nil
|
||||||
@b_bar = lambda do |info|
|
@b_bar = proc do |info|
|
||||||
# mode, lang_name, warnings, lsp_name, filename, foldername, line, max_line, width
|
# mode, lang_name, warnings, lsp_name, filename, foldername, line, max_line, width
|
||||||
# puts info.inspect
|
# puts info.inspect
|
||||||
mode_color = 0x82AAFF
|
mode_color = 0x82AAFF
|
||||||
@@ -285,6 +353,9 @@ module C
|
|||||||
mode_symbol = " "
|
mode_symbol = " "
|
||||||
end
|
end
|
||||||
lang_info = C.languages[info[:lang_name]]
|
lang_info = C.languages[info[:lang_name]]
|
||||||
|
if lang_info.nil?
|
||||||
|
lang_info = C.languages[:default]
|
||||||
|
end
|
||||||
filename = File.basename(info[:filename])
|
filename = File.basename(info[:filename])
|
||||||
starting = " #{mode_symbol} #{info[:mode].to_s.upcase} #{lang_info[:symbol]}#{filename}"
|
starting = " #{mode_symbol} #{info[:mode].to_s.upcase} #{lang_info[:symbol]}#{filename}"
|
||||||
highlights = []
|
highlights = []
|
||||||
@@ -294,20 +365,59 @@ module C
|
|||||||
highlights << { fg: lang_info[:color], bg: 0x24272d, start: 13, length: 2 }
|
highlights << { fg: lang_info[:color], bg: 0x24272d, start: 13, length: 2 }
|
||||||
highlights << { fg: 0xced4df, bg: 0x24272d, start: 15, length: filename.length }
|
highlights << { fg: 0xced4df, bg: 0x24272d, start: 15, length: filename.length }
|
||||||
highlights << { fg: 0x24272d, bg: 0x000000, start: 15 + filename.length, length: 1 }
|
highlights << { fg: 0x24272d, bg: 0x000000, start: 15 + filename.length, length: 1 }
|
||||||
return {
|
next {
|
||||||
text: starting,
|
text: starting,
|
||||||
highlights: highlights
|
highlights: highlights
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
@b_copy = proc do |text|
|
||||||
|
Clipboard.copy(text)
|
||||||
|
end
|
||||||
|
@b_paste = proc do
|
||||||
|
next Clipboard.paste
|
||||||
|
end
|
||||||
|
@b_file_detect = proc do |filename|
|
||||||
|
type = :default
|
||||||
|
next type unless File.exist?(filename)
|
||||||
|
first_line = File.open(filename, &:readline).chomp
|
||||||
|
if first_line.start_with?("#!")
|
||||||
|
shebang = first_line[2..].downcase
|
||||||
|
type = case shebang
|
||||||
|
when /bash/, /sh/ then :bash
|
||||||
|
when /fish/ then :fish
|
||||||
|
when /python/ then :python
|
||||||
|
when /ruby/ then :ruby
|
||||||
|
when /lua/ then :lua
|
||||||
|
else :default
|
||||||
|
end
|
||||||
|
next type
|
||||||
|
end
|
||||||
|
next type if :os_name_placed_here != :linux || :os_name_placed_here != :mac
|
||||||
|
next type if !command_exists?("file")
|
||||||
|
mimetype = `file --mime-type -b #{filename}`.chomp
|
||||||
|
type = case mimetype
|
||||||
|
when /shellscript/ then :bash
|
||||||
|
when /ruby/ then :ruby
|
||||||
|
when /diff/ then :diff
|
||||||
|
when /html/ then :html
|
||||||
|
when /python/ then :python
|
||||||
|
when /javascript/ then :javascript
|
||||||
|
when /makefile/ then :makefile
|
||||||
|
when /-c$/ then :c
|
||||||
|
else :default
|
||||||
|
end
|
||||||
|
next type
|
||||||
|
end
|
||||||
|
|
||||||
class << self
|
class << self
|
||||||
attr_accessor :theme, :lsp_config, :languages,
|
attr_accessor :theme, :lsp_config, :languages,
|
||||||
:line_endings, :highlighters
|
:line_endings, :highlighters
|
||||||
attr_reader :b_startup, :b_shutdown, :b_extra_highlights, :b_bar
|
attr_reader :b_startup, :b_shutdown, :b_extra_highlights,
|
||||||
|
:b_bar, :b_copy, :b_paste, :b_file_detect
|
||||||
|
|
||||||
# def bar=(block)
|
def bar=(&block)
|
||||||
# @b_bar = block
|
@b_bar = block
|
||||||
# end
|
end
|
||||||
|
|
||||||
def startup(&block)
|
def startup(&block)
|
||||||
@b_startup = block
|
@b_startup = block
|
||||||
@@ -317,6 +427,18 @@ module C
|
|||||||
@b_shutdown = block
|
@b_shutdown = block
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def copy(&block)
|
||||||
|
@b_copy = block
|
||||||
|
end
|
||||||
|
|
||||||
|
def paste(&block)
|
||||||
|
@b_paste = block
|
||||||
|
end
|
||||||
|
|
||||||
|
def file_detect(&block)
|
||||||
|
@b_file_detect = block
|
||||||
|
end
|
||||||
|
|
||||||
def extra_highlights(&block)
|
def extra_highlights(&block)
|
||||||
@b_extra_highlights = block
|
@b_extra_highlights = block
|
||||||
end
|
end
|
||||||
@@ -352,3 +474,22 @@ module C
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
$LOADED ||= []
|
||||||
|
|
||||||
|
module Kernel
|
||||||
|
def require_relative(path, bind = nil)
|
||||||
|
path += ".rb" unless path.end_with?(".rb")
|
||||||
|
path = File.expand_path(path, File.dirname(C.config_file))
|
||||||
|
return if $LOADED.include?(path)
|
||||||
|
$LOADED << path
|
||||||
|
code = File.read(path)
|
||||||
|
eval(code, bind || binding, path)
|
||||||
|
end
|
||||||
|
def load(path, bind = nil)
|
||||||
|
path += ".rb" unless path.end_with?(".rb")
|
||||||
|
path = File.expand_path(path, File.dirname(C.config_file))
|
||||||
|
$LOADED.delete(path)
|
||||||
|
require_relative(path, bind)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|||||||
@@ -1,611 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
constexpr unsigned char _tmp___crib_precompiled_mrb[] = {
|
|
||||||
0x52, 0x49, 0x54, 0x45, 0x30, 0x33, 0x30, 0x30, 0x00, 0x00, 0x1c, 0x69,
|
|
||||||
0x4d, 0x41, 0x54, 0x5a, 0x30, 0x30, 0x30, 0x30, 0x49, 0x52, 0x45, 0x50,
|
|
||||||
0x00, 0x00, 0x1b, 0x81, 0x30, 0x33, 0x30, 0x30, 0x00, 0x00, 0x00, 0x34,
|
|
||||||
0x00, 0x01, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13,
|
|
||||||
0x11, 0x01, 0x5d, 0x01, 0x00, 0x5e, 0x01, 0x00, 0x11, 0x01, 0x5d, 0x01,
|
|
||||||
0x01, 0x5e, 0x01, 0x01, 0x38, 0x01, 0x69, 0x00, 0x00, 0x00, 0x02, 0x00,
|
|
||||||
0x06, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x00, 0x00, 0x01, 0x43, 0x00,
|
|
||||||
0x00, 0x00, 0x03, 0xfd, 0x00, 0x01, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x01, 0x3c, 0x06, 0x01, 0x1e, 0x01, 0x00, 0x07, 0x01, 0x1e,
|
|
||||||
0x01, 0x01, 0x08, 0x01, 0x1e, 0x01, 0x02, 0x09, 0x01, 0x1e, 0x01, 0x03,
|
|
||||||
0x0a, 0x01, 0x1e, 0x01, 0x04, 0x0b, 0x01, 0x1e, 0x01, 0x05, 0x0c, 0x01,
|
|
||||||
0x1e, 0x01, 0x06, 0x0d, 0x01, 0x1e, 0x01, 0x07, 0x03, 0x01, 0x08, 0x1e,
|
|
||||||
0x01, 0x08, 0x03, 0x01, 0x09, 0x1e, 0x01, 0x09, 0x03, 0x01, 0x0a, 0x1e,
|
|
||||||
0x01, 0x0a, 0x03, 0x01, 0x0b, 0x1e, 0x01, 0x0b, 0x03, 0x01, 0x0c, 0x1e,
|
|
||||||
0x01, 0x0c, 0x03, 0x01, 0x0d, 0x1e, 0x01, 0x0d, 0x03, 0x01, 0x0e, 0x1e,
|
|
||||||
0x01, 0x0e, 0x03, 0x01, 0x0f, 0x1e, 0x01, 0x0f, 0x03, 0x01, 0x10, 0x1e,
|
|
||||||
0x01, 0x10, 0x03, 0x01, 0x11, 0x1e, 0x01, 0x11, 0x03, 0x01, 0x12, 0x1e,
|
|
||||||
0x01, 0x12, 0x03, 0x01, 0x13, 0x1e, 0x01, 0x13, 0x03, 0x01, 0x14, 0x1e,
|
|
||||||
0x01, 0x14, 0x03, 0x01, 0x15, 0x1e, 0x01, 0x15, 0x03, 0x01, 0x16, 0x1e,
|
|
||||||
0x01, 0x16, 0x03, 0x01, 0x17, 0x1e, 0x01, 0x17, 0x03, 0x01, 0x18, 0x1e,
|
|
||||||
0x01, 0x18, 0x03, 0x01, 0x19, 0x1e, 0x01, 0x19, 0x03, 0x01, 0x1a, 0x1e,
|
|
||||||
0x01, 0x1a, 0x03, 0x01, 0x1b, 0x1e, 0x01, 0x1b, 0x03, 0x01, 0x1c, 0x1e,
|
|
||||||
0x01, 0x1c, 0x03, 0x01, 0x1d, 0x1e, 0x01, 0x1d, 0x03, 0x01, 0x1e, 0x1e,
|
|
||||||
0x01, 0x1e, 0x03, 0x01, 0x1f, 0x1e, 0x01, 0x1f, 0x03, 0x01, 0x20, 0x1e,
|
|
||||||
0x01, 0x20, 0x03, 0x01, 0x21, 0x1e, 0x01, 0x21, 0x03, 0x01, 0x22, 0x1e,
|
|
||||||
0x01, 0x22, 0x03, 0x01, 0x23, 0x1e, 0x01, 0x23, 0x03, 0x01, 0x24, 0x1e,
|
|
||||||
0x01, 0x24, 0x03, 0x01, 0x25, 0x1e, 0x01, 0x25, 0x03, 0x01, 0x26, 0x1e,
|
|
||||||
0x01, 0x26, 0x03, 0x01, 0x27, 0x1e, 0x01, 0x27, 0x03, 0x01, 0x28, 0x1e,
|
|
||||||
0x01, 0x28, 0x03, 0x01, 0x29, 0x1e, 0x01, 0x29, 0x03, 0x01, 0x2a, 0x1e,
|
|
||||||
0x01, 0x2a, 0x03, 0x01, 0x2b, 0x1e, 0x01, 0x2b, 0x03, 0x01, 0x2c, 0x1e,
|
|
||||||
0x01, 0x2c, 0x03, 0x01, 0x2d, 0x1e, 0x01, 0x2d, 0x03, 0x01, 0x2e, 0x1e,
|
|
||||||
0x01, 0x2e, 0x03, 0x01, 0x2f, 0x1e, 0x01, 0x2f, 0x03, 0x01, 0x30, 0x1e,
|
|
||||||
0x01, 0x30, 0x03, 0x01, 0x31, 0x1e, 0x01, 0x31, 0x03, 0x01, 0x32, 0x1e,
|
|
||||||
0x01, 0x32, 0x03, 0x01, 0x33, 0x1e, 0x01, 0x33, 0x03, 0x01, 0x34, 0x1e,
|
|
||||||
0x01, 0x34, 0x2d, 0x01, 0x35, 0x00, 0x38, 0x01, 0x00, 0x00, 0x00, 0x36,
|
|
||||||
0x00, 0x06, 0x4b, 0x5f, 0x44, 0x41, 0x54, 0x41, 0x00, 0x00, 0x09, 0x4b,
|
|
||||||
0x5f, 0x53, 0x48, 0x45, 0x42, 0x41, 0x4e, 0x47, 0x00, 0x00, 0x09, 0x4b,
|
|
||||||
0x5f, 0x43, 0x4f, 0x4d, 0x4d, 0x45, 0x4e, 0x54, 0x00, 0x00, 0x07, 0x4b,
|
|
||||||
0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x00, 0x00, 0x08, 0x4b, 0x5f, 0x53,
|
|
||||||
0x54, 0x52, 0x49, 0x4e, 0x47, 0x00, 0x00, 0x08, 0x4b, 0x5f, 0x45, 0x53,
|
|
||||||
0x43, 0x41, 0x50, 0x45, 0x00, 0x00, 0x0f, 0x4b, 0x5f, 0x49, 0x4e, 0x54,
|
|
||||||
0x45, 0x52, 0x50, 0x4f, 0x4c, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x00,
|
|
||||||
0x08, 0x4b, 0x5f, 0x52, 0x45, 0x47, 0x45, 0x58, 0x50, 0x00, 0x00, 0x08,
|
|
||||||
0x4b, 0x5f, 0x4e, 0x55, 0x4d, 0x42, 0x45, 0x52, 0x00, 0x00, 0x06, 0x4b,
|
|
||||||
0x5f, 0x54, 0x52, 0x55, 0x45, 0x00, 0x00, 0x07, 0x4b, 0x5f, 0x46, 0x41,
|
|
||||||
0x4c, 0x53, 0x45, 0x00, 0x00, 0x06, 0x4b, 0x5f, 0x43, 0x48, 0x41, 0x52,
|
|
||||||
0x00, 0x00, 0x09, 0x4b, 0x5f, 0x4b, 0x45, 0x59, 0x57, 0x4f, 0x52, 0x44,
|
|
||||||
0x00, 0x00, 0x11, 0x4b, 0x5f, 0x4b, 0x45, 0x59, 0x57, 0x4f, 0x52, 0x44,
|
|
||||||
0x4f, 0x50, 0x45, 0x52, 0x41, 0x54, 0x4f, 0x52, 0x00, 0x00, 0x0a, 0x4b,
|
|
||||||
0x5f, 0x4f, 0x50, 0x45, 0x52, 0x41, 0x54, 0x4f, 0x52, 0x00, 0x00, 0x0a,
|
|
||||||
0x4b, 0x5f, 0x46, 0x55, 0x4e, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x00,
|
|
||||||
0x06, 0x4b, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x00, 0x00, 0x0a, 0x4b, 0x5f,
|
|
||||||
0x43, 0x4f, 0x4e, 0x53, 0x54, 0x41, 0x4e, 0x54, 0x00, 0x00, 0x12, 0x4b,
|
|
||||||
0x5f, 0x56, 0x41, 0x52, 0x49, 0x41, 0x42, 0x4c, 0x45, 0x49, 0x4e, 0x53,
|
|
||||||
0x54, 0x41, 0x4e, 0x43, 0x45, 0x00, 0x00, 0x10, 0x4b, 0x5f, 0x56, 0x41,
|
|
||||||
0x52, 0x49, 0x41, 0x42, 0x4c, 0x45, 0x47, 0x4c, 0x4f, 0x42, 0x41, 0x4c,
|
|
||||||
0x00, 0x00, 0x0c, 0x4b, 0x5f, 0x41, 0x4e, 0x4e, 0x4f, 0x54, 0x41, 0x54,
|
|
||||||
0x49, 0x4f, 0x4e, 0x00, 0x00, 0x0b, 0x4b, 0x5f, 0x44, 0x49, 0x52, 0x45,
|
|
||||||
0x43, 0x54, 0x49, 0x56, 0x45, 0x00, 0x00, 0x07, 0x4b, 0x5f, 0x4c, 0x41,
|
|
||||||
0x42, 0x45, 0x4c, 0x00, 0x00, 0x08, 0x4b, 0x5f, 0x42, 0x52, 0x41, 0x43,
|
|
||||||
0x45, 0x31, 0x00, 0x00, 0x08, 0x4b, 0x5f, 0x42, 0x52, 0x41, 0x43, 0x45,
|
|
||||||
0x32, 0x00, 0x00, 0x08, 0x4b, 0x5f, 0x42, 0x52, 0x41, 0x43, 0x45, 0x33,
|
|
||||||
0x00, 0x00, 0x08, 0x4b, 0x5f, 0x42, 0x52, 0x41, 0x43, 0x45, 0x34, 0x00,
|
|
||||||
0x00, 0x08, 0x4b, 0x5f, 0x42, 0x52, 0x41, 0x43, 0x45, 0x35, 0x00, 0x00,
|
|
||||||
0x0a, 0x4b, 0x5f, 0x48, 0x45, 0x41, 0x44, 0x49, 0x4e, 0x47, 0x31, 0x00,
|
|
||||||
0x00, 0x0a, 0x4b, 0x5f, 0x48, 0x45, 0x41, 0x44, 0x49, 0x4e, 0x47, 0x32,
|
|
||||||
0x00, 0x00, 0x0a, 0x4b, 0x5f, 0x48, 0x45, 0x41, 0x44, 0x49, 0x4e, 0x47,
|
|
||||||
0x33, 0x00, 0x00, 0x0a, 0x4b, 0x5f, 0x48, 0x45, 0x41, 0x44, 0x49, 0x4e,
|
|
||||||
0x47, 0x34, 0x00, 0x00, 0x0a, 0x4b, 0x5f, 0x48, 0x45, 0x41, 0x44, 0x49,
|
|
||||||
0x4e, 0x47, 0x35, 0x00, 0x00, 0x0a, 0x4b, 0x5f, 0x48, 0x45, 0x41, 0x44,
|
|
||||||
0x49, 0x4e, 0x47, 0x36, 0x00, 0x00, 0x0c, 0x4b, 0x5f, 0x42, 0x4c, 0x4f,
|
|
||||||
0x43, 0x4b, 0x51, 0x55, 0x4f, 0x54, 0x45, 0x00, 0x00, 0x06, 0x4b, 0x5f,
|
|
||||||
0x4c, 0x49, 0x53, 0x54, 0x00, 0x00, 0x0a, 0x4b, 0x5f, 0x4c, 0x49, 0x53,
|
|
||||||
0x54, 0x49, 0x54, 0x45, 0x4d, 0x00, 0x00, 0x06, 0x4b, 0x5f, 0x43, 0x4f,
|
|
||||||
0x44, 0x45, 0x00, 0x00, 0x0e, 0x4b, 0x5f, 0x4c, 0x41, 0x4e, 0x47, 0x55,
|
|
||||||
0x41, 0x47, 0x45, 0x4e, 0x41, 0x4d, 0x45, 0x00, 0x00, 0x0b, 0x4b, 0x5f,
|
|
||||||
0x4c, 0x49, 0x4e, 0x4b, 0x4c, 0x41, 0x42, 0x45, 0x4c, 0x00, 0x00, 0x0c,
|
|
||||||
0x4b, 0x5f, 0x49, 0x4d, 0x41, 0x47, 0x45, 0x4c, 0x41, 0x42, 0x45, 0x4c,
|
|
||||||
0x00, 0x00, 0x06, 0x4b, 0x5f, 0x4c, 0x49, 0x4e, 0x4b, 0x00, 0x00, 0x07,
|
|
||||||
0x4b, 0x5f, 0x54, 0x41, 0x42, 0x4c, 0x45, 0x00, 0x00, 0x0d, 0x4b, 0x5f,
|
|
||||||
0x54, 0x41, 0x42, 0x4c, 0x45, 0x48, 0x45, 0x41, 0x44, 0x45, 0x52, 0x00,
|
|
||||||
0x00, 0x08, 0x4b, 0x5f, 0x49, 0x54, 0x41, 0x4c, 0x49, 0x43, 0x00, 0x00,
|
|
||||||
0x06, 0x4b, 0x5f, 0x42, 0x4f, 0x4c, 0x44, 0x00, 0x00, 0x0b, 0x4b, 0x5f,
|
|
||||||
0x55, 0x4e, 0x44, 0x45, 0x52, 0x4c, 0x49, 0x4e, 0x45, 0x00, 0x00, 0x0f,
|
|
||||||
0x4b, 0x5f, 0x53, 0x54, 0x52, 0x49, 0x4b, 0x45, 0x54, 0x48, 0x52, 0x4f,
|
|
||||||
0x55, 0x47, 0x48, 0x00, 0x00, 0x10, 0x4b, 0x5f, 0x48, 0x4f, 0x52, 0x49,
|
|
||||||
0x58, 0x4f, 0x4e, 0x54, 0x41, 0x4c, 0x52, 0x55, 0x4c, 0x45, 0x00, 0x00,
|
|
||||||
0x05, 0x4b, 0x5f, 0x54, 0x41, 0x47, 0x00, 0x00, 0x0b, 0x4b, 0x5f, 0x41,
|
|
||||||
0x54, 0x54, 0x52, 0x49, 0x42, 0x55, 0x54, 0x45, 0x00, 0x00, 0x0b, 0x4b,
|
|
||||||
0x5f, 0x43, 0x48, 0x45, 0x43, 0x4b, 0x44, 0x4f, 0x4e, 0x45, 0x00, 0x00,
|
|
||||||
0x0e, 0x4b, 0x5f, 0x43, 0x48, 0x45, 0x43, 0x4b, 0x4e, 0x4f, 0x54, 0x44,
|
|
||||||
0x4f, 0x4e, 0x45, 0x00, 0x00, 0x06, 0x66, 0x72, 0x65, 0x65, 0x7a, 0x65,
|
|
||||||
0x00, 0x00, 0x00, 0x0f, 0x61, 0x00, 0x01, 0x00, 0x4c, 0x00, 0x02, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x07, 0x6f, 0x51, 0x01, 0x00, 0x51, 0x02, 0x01, 0x51,
|
|
||||||
0x03, 0x02, 0x51, 0x04, 0x03, 0x51, 0x05, 0x04, 0x51, 0x06, 0x05, 0x51,
|
|
||||||
0x07, 0x06, 0x51, 0x08, 0x07, 0x47, 0x02, 0x07, 0x51, 0x03, 0x08, 0x47,
|
|
||||||
0x04, 0x00, 0x51, 0x05, 0x09, 0x51, 0x06, 0x0a, 0x47, 0x06, 0x01, 0x51,
|
|
||||||
0x07, 0x0b, 0x51, 0x08, 0x0c, 0x47, 0x08, 0x01, 0x51, 0x09, 0x0d, 0x51,
|
|
||||||
0x0a, 0x0e, 0x47, 0x0a, 0x01, 0x51, 0x0b, 0x0f, 0x51, 0x0c, 0x0e, 0x47,
|
|
||||||
0x0c, 0x01, 0x51, 0x0d, 0x10, 0x51, 0x0e, 0x0c, 0x47, 0x0e, 0x01, 0x51,
|
|
||||||
0x0f, 0x11, 0x51, 0x10, 0x12, 0x47, 0x10, 0x01, 0x51, 0x11, 0x13, 0x51,
|
|
||||||
0x12, 0x14, 0x47, 0x12, 0x01, 0x51, 0x13, 0x15, 0x51, 0x14, 0x0e, 0x47,
|
|
||||||
0x14, 0x01, 0x51, 0x15, 0x16, 0x51, 0x16, 0x0e, 0x47, 0x16, 0x01, 0x51,
|
|
||||||
0x17, 0x17, 0x47, 0x18, 0x00, 0x51, 0x19, 0x18, 0x51, 0x1a, 0x0e, 0x47,
|
|
||||||
0x1a, 0x01, 0x51, 0x1b, 0x19, 0x47, 0x1c, 0x00, 0x51, 0x1d, 0x1a, 0x51,
|
|
||||||
0x1e, 0x0e, 0x47, 0x1e, 0x01, 0x51, 0x1f, 0x1b, 0x51, 0x20, 0x1c, 0x47,
|
|
||||||
0x20, 0x01, 0x51, 0x21, 0x1d, 0x47, 0x22, 0x00, 0x51, 0x23, 0x1e, 0x51,
|
|
||||||
0x24, 0x14, 0x51, 0x25, 0x0a, 0x47, 0x24, 0x02, 0x51, 0x25, 0x1f, 0x51,
|
|
||||||
0x26, 0x0e, 0x47, 0x26, 0x01, 0x51, 0x27, 0x20, 0x51, 0x28, 0x12, 0x47,
|
|
||||||
0x28, 0x01, 0x51, 0x29, 0x21, 0x47, 0x2a, 0x00, 0x51, 0x2b, 0x22, 0x51,
|
|
||||||
0x2c, 0x23, 0x51, 0x2d, 0x24, 0x51, 0x2e, 0x0a, 0x47, 0x2c, 0x03, 0x53,
|
|
||||||
0x01, 0x16, 0x1a, 0x01, 0x00, 0x10, 0x01, 0x01, 0x10, 0x02, 0x02, 0x0f,
|
|
||||||
0x03, 0x00, 0x55, 0x55, 0x55, 0x10, 0x04, 0x03, 0x51, 0x05, 0x25, 0x10,
|
|
||||||
0x06, 0x04, 0x51, 0x07, 0x26, 0x47, 0x07, 0x01, 0x10, 0x08, 0x05, 0x51,
|
|
||||||
0x09, 0x00, 0x53, 0x02, 0x04, 0x10, 0x03, 0x06, 0x10, 0x04, 0x02, 0x0e,
|
|
||||||
0x05, 0x59, 0x9c, 0x10, 0x06, 0x03, 0x51, 0x07, 0x27, 0x10, 0x08, 0x04,
|
|
||||||
0x51, 0x09, 0x28, 0x51, 0x0a, 0x29, 0x51, 0x0b, 0x2a, 0x47, 0x09, 0x03,
|
|
||||||
0x10, 0x0a, 0x05, 0x51, 0x0b, 0x00, 0x53, 0x04, 0x04, 0x10, 0x05, 0x07,
|
|
||||||
0x10, 0x06, 0x02, 0x0f, 0x07, 0x00, 0xa8, 0xb9, 0xcc, 0x10, 0x08, 0x03,
|
|
||||||
0x51, 0x09, 0x2b, 0x10, 0x0a, 0x04, 0x51, 0x0b, 0x2c, 0x51, 0x0c, 0x2d,
|
|
||||||
0x47, 0x0b, 0x02, 0x10, 0x0c, 0x05, 0x51, 0x0d, 0x00, 0x53, 0x06, 0x04,
|
|
||||||
0x10, 0x07, 0x08, 0x10, 0x08, 0x02, 0x0f, 0x09, 0x00, 0x36, 0xa3, 0xd9,
|
|
||||||
0x10, 0x0a, 0x03, 0x51, 0x0b, 0x2e, 0x10, 0x0c, 0x04, 0x51, 0x0d, 0x2f,
|
|
||||||
0x47, 0x0d, 0x01, 0x10, 0x0e, 0x05, 0x51, 0x0f, 0x0d, 0x53, 0x08, 0x04,
|
|
||||||
0x10, 0x09, 0x09, 0x10, 0x0a, 0x02, 0x0f, 0x0b, 0x00, 0x4d, 0x5a, 0x5e,
|
|
||||||
0x10, 0x0c, 0x03, 0x51, 0x0d, 0x30, 0x10, 0x0e, 0x04, 0x51, 0x0f, 0x31,
|
|
||||||
0x47, 0x0f, 0x01, 0x10, 0x10, 0x05, 0x51, 0x11, 0x10, 0x53, 0x0a, 0x04,
|
|
||||||
0x10, 0x0b, 0x0a, 0x10, 0x0c, 0x02, 0x0f, 0x0d, 0x00, 0x00, 0xad, 0xd8,
|
|
||||||
0x10, 0x0e, 0x03, 0x51, 0x0f, 0x32, 0x10, 0x10, 0x04, 0x51, 0x11, 0x33,
|
|
||||||
0x47, 0x11, 0x01, 0x10, 0x12, 0x05, 0x51, 0x13, 0x11, 0x53, 0x0c, 0x04,
|
|
||||||
0x10, 0x0d, 0x0b, 0x10, 0x0e, 0x02, 0x0f, 0x0f, 0x00, 0x00, 0xad, 0xd8,
|
|
||||||
0x10, 0x10, 0x03, 0x51, 0x11, 0x32, 0x10, 0x12, 0x04, 0x51, 0x13, 0x34,
|
|
||||||
0x47, 0x13, 0x01, 0x10, 0x14, 0x05, 0x51, 0x15, 0x11, 0x53, 0x0e, 0x04,
|
|
||||||
0x10, 0x0f, 0x0c, 0x10, 0x10, 0x02, 0x0f, 0x11, 0x00, 0xa0, 0x74, 0xc4,
|
|
||||||
0x10, 0x12, 0x03, 0x51, 0x13, 0x35, 0x10, 0x14, 0x04, 0x51, 0x15, 0x36,
|
|
||||||
0x51, 0x16, 0x37, 0x47, 0x15, 0x02, 0x10, 0x16, 0x05, 0x51, 0x17, 0x13,
|
|
||||||
0x53, 0x10, 0x04, 0x10, 0x11, 0x0d, 0x10, 0x12, 0x02, 0x0f, 0x13, 0x00,
|
|
||||||
0xef, 0x8a, 0x91, 0x10, 0x14, 0x03, 0x51, 0x15, 0x38, 0x10, 0x16, 0x04,
|
|
||||||
0x51, 0x17, 0x39, 0x51, 0x18, 0x3a, 0x47, 0x17, 0x02, 0x10, 0x18, 0x05,
|
|
||||||
0x51, 0x19, 0x15, 0x53, 0x12, 0x04, 0x10, 0x13, 0x0e, 0x10, 0x14, 0x02,
|
|
||||||
0x0f, 0x15, 0x00, 0xf0, 0xdf, 0x8a, 0x10, 0x16, 0x03, 0x51, 0x17, 0x3b,
|
|
||||||
0x10, 0x18, 0x04, 0x51, 0x19, 0x3c, 0x47, 0x19, 0x01, 0x10, 0x1a, 0x05,
|
|
||||||
0x51, 0x1b, 0x16, 0x53, 0x14, 0x04, 0x10, 0x15, 0x0f, 0x10, 0x16, 0x02,
|
|
||||||
0x0f, 0x17, 0x00, 0x36, 0xa3, 0xd9, 0x10, 0x18, 0x03, 0x51, 0x19, 0x3d,
|
|
||||||
0x10, 0x1a, 0x04, 0x51, 0x1b, 0x3e, 0x47, 0x1b, 0x01, 0x10, 0x1c, 0x05,
|
|
||||||
0x51, 0x1d, 0x16, 0x53, 0x16, 0x04, 0x10, 0x17, 0x10, 0x10, 0x18, 0x02,
|
|
||||||
0x0f, 0x19, 0x00, 0xcb, 0xcb, 0x41, 0x10, 0x1a, 0x03, 0x51, 0x1b, 0x3f,
|
|
||||||
0x10, 0x1c, 0x04, 0x51, 0x1d, 0x40, 0x47, 0x1d, 0x01, 0x10, 0x1e, 0x05,
|
|
||||||
0x51, 0x1f, 0x0f, 0x53, 0x18, 0x04, 0x10, 0x19, 0x11, 0x10, 0x1a, 0x02,
|
|
||||||
0x0f, 0x1b, 0x00, 0xcb, 0xcb, 0x41, 0x10, 0x1c, 0x03, 0x51, 0x1d, 0x3f,
|
|
||||||
0x10, 0x1e, 0x04, 0x51, 0x1f, 0x41, 0x47, 0x1f, 0x01, 0x10, 0x20, 0x05,
|
|
||||||
0x51, 0x21, 0x0f, 0x53, 0x1a, 0x04, 0x10, 0x1b, 0x12, 0x10, 0x1c, 0x02,
|
|
||||||
0x0f, 0x1d, 0x00, 0x6e, 0x15, 0x16, 0x10, 0x1e, 0x03, 0x51, 0x1f, 0x38,
|
|
||||||
0x10, 0x20, 0x04, 0x51, 0x21, 0x42, 0x47, 0x21, 0x01, 0x10, 0x22, 0x05,
|
|
||||||
0x51, 0x23, 0x08, 0x53, 0x1c, 0x04, 0x10, 0x1d, 0x13, 0x10, 0x1e, 0x02,
|
|
||||||
0x0f, 0x1f, 0x00, 0x36, 0xa3, 0xd9, 0x10, 0x20, 0x03, 0x51, 0x21, 0x43,
|
|
||||||
0x10, 0x22, 0x04, 0x51, 0x23, 0x44, 0x47, 0x23, 0x01, 0x10, 0x24, 0x05,
|
|
||||||
0x51, 0x25, 0x17, 0x53, 0x1e, 0x04, 0x10, 0x1f, 0x14, 0x10, 0x20, 0x02,
|
|
||||||
0x0f, 0x21, 0x00, 0x95, 0xe6, 0xcb, 0x10, 0x22, 0x03, 0x51, 0x23, 0x45,
|
|
||||||
0x10, 0x24, 0x04, 0x51, 0x25, 0x46, 0x47, 0x25, 0x01, 0x10, 0x26, 0x05,
|
|
||||||
0x51, 0x27, 0x47, 0x53, 0x20, 0x04, 0x10, 0x21, 0x15, 0x10, 0x22, 0x02,
|
|
||||||
0x0f, 0x23, 0x00, 0xde, 0xa5, 0x84, 0x10, 0x24, 0x03, 0x51, 0x25, 0x48,
|
|
||||||
0x10, 0x26, 0x04, 0x51, 0x27, 0x49, 0x47, 0x27, 0x01, 0x10, 0x28, 0x05,
|
|
||||||
0x51, 0x29, 0x19, 0x53, 0x22, 0x04, 0x10, 0x23, 0x16, 0x10, 0x24, 0x02,
|
|
||||||
0x0f, 0x25, 0x00, 0xa0, 0x74, 0xc4, 0x10, 0x26, 0x03, 0x51, 0x27, 0x4a,
|
|
||||||
0x10, 0x28, 0x04, 0x51, 0x29, 0x4b, 0x47, 0x29, 0x01, 0x10, 0x2a, 0x05,
|
|
||||||
0x51, 0x2b, 0x1a, 0x53, 0x24, 0x04, 0x10, 0x25, 0x17, 0x10, 0x26, 0x02,
|
|
||||||
0x0f, 0x27, 0x00, 0x36, 0xa3, 0xd9, 0x10, 0x28, 0x03, 0x51, 0x29, 0x4c,
|
|
||||||
0x10, 0x2a, 0x04, 0x51, 0x2b, 0x4d, 0x51, 0x2c, 0x4e, 0x47, 0x2b, 0x02,
|
|
||||||
0x10, 0x2c, 0x05, 0x51, 0x2d, 0x1b, 0x53, 0x26, 0x04, 0x10, 0x27, 0x18,
|
|
||||||
0x10, 0x28, 0x02, 0x0f, 0x29, 0x00, 0x6d, 0x80, 0x86, 0x10, 0x2a, 0x03,
|
|
||||||
0x51, 0x2b, 0x4f, 0x10, 0x2c, 0x04, 0x51, 0x2d, 0x50, 0x47, 0x2d, 0x01,
|
|
||||||
0x10, 0x2e, 0x05, 0x51, 0x2f, 0x1d, 0x53, 0x28, 0x04, 0x10, 0x29, 0x19,
|
|
||||||
0x10, 0x2a, 0x02, 0x0f, 0x2b, 0x00, 0x36, 0xa3, 0xd9, 0x10, 0x2c, 0x03,
|
|
||||||
0x51, 0x2d, 0x51, 0x10, 0x2e, 0x04, 0x51, 0x2f, 0x52, 0x47, 0x2f, 0x01,
|
|
||||||
0x10, 0x30, 0x05, 0x51, 0x31, 0x1e, 0x53, 0x2a, 0x04, 0x10, 0x2b, 0x1a,
|
|
||||||
0x10, 0x2c, 0x02, 0x0f, 0x2d, 0x00, 0x6d, 0x80, 0x86, 0x10, 0x2e, 0x03,
|
|
||||||
0x51, 0x2f, 0x4f, 0x10, 0x30, 0x04, 0x51, 0x31, 0x53, 0x51, 0x32, 0x54,
|
|
||||||
0x47, 0x31, 0x02, 0x10, 0x32, 0x05, 0x51, 0x33, 0x1f, 0x53, 0x2c, 0x04,
|
|
||||||
0x10, 0x2d, 0x1b, 0x10, 0x2e, 0x02, 0x0f, 0x2f, 0x00, 0xda, 0xd8, 0xd8,
|
|
||||||
0x10, 0x30, 0x03, 0x51, 0x31, 0x55, 0x10, 0x32, 0x04, 0x51, 0x33, 0x56,
|
|
||||||
0x47, 0x33, 0x01, 0x10, 0x34, 0x05, 0x51, 0x35, 0x20, 0x53, 0x2e, 0x04,
|
|
||||||
0x10, 0x2f, 0x1c, 0x10, 0x30, 0x02, 0x0f, 0x31, 0x00, 0x4e, 0x5c, 0x61,
|
|
||||||
0x10, 0x32, 0x03, 0x51, 0x33, 0x57, 0x10, 0x34, 0x04, 0x51, 0x35, 0x58,
|
|
||||||
0x51, 0x36, 0x59, 0x47, 0x35, 0x02, 0x10, 0x36, 0x05, 0x51, 0x37, 0x21,
|
|
||||||
0x53, 0x30, 0x04, 0x10, 0x31, 0x1d, 0x10, 0x32, 0x02, 0x0f, 0x33, 0x00,
|
|
||||||
0x6d, 0x80, 0x86, 0x10, 0x34, 0x03, 0x51, 0x35, 0x5a, 0x10, 0x36, 0x04,
|
|
||||||
0x51, 0x37, 0x5b, 0x47, 0x37, 0x01, 0x53, 0x32, 0x03, 0x10, 0x33, 0x1e,
|
|
||||||
0x10, 0x34, 0x02, 0x0f, 0x35, 0x00, 0xda, 0xd8, 0xd8, 0x10, 0x36, 0x03,
|
|
||||||
0x51, 0x37, 0x5c, 0x10, 0x38, 0x04, 0x51, 0x39, 0x5d, 0x47, 0x39, 0x01,
|
|
||||||
0x53, 0x34, 0x03, 0x10, 0x35, 0x1f, 0x10, 0x36, 0x02, 0x0f, 0x37, 0x00,
|
|
||||||
0xdd, 0x4c, 0x35, 0x10, 0x38, 0x03, 0x51, 0x39, 0x5e, 0x10, 0x3a, 0x04,
|
|
||||||
0x51, 0x3b, 0x5f, 0x51, 0x3c, 0x60, 0x47, 0x3b, 0x02, 0x53, 0x36, 0x03,
|
|
||||||
0x10, 0x37, 0x20, 0x10, 0x38, 0x02, 0x0f, 0x39, 0x00, 0xf0, 0x50, 0x32,
|
|
||||||
0x10, 0x3a, 0x03, 0x51, 0x3b, 0x61, 0x10, 0x3c, 0x04, 0x51, 0x3d, 0x62,
|
|
||||||
0x47, 0x3d, 0x01, 0x53, 0x38, 0x03, 0x10, 0x39, 0x21, 0x10, 0x3a, 0x02,
|
|
||||||
0x0f, 0x3b, 0x00, 0xf0, 0x50, 0x32, 0x10, 0x3c, 0x03, 0x51, 0x3d, 0x61,
|
|
||||||
0x10, 0x3e, 0x04, 0x51, 0x3f, 0x63, 0x47, 0x3f, 0x01, 0x53, 0x3a, 0x03,
|
|
||||||
0x10, 0x3b, 0x22, 0x10, 0x3c, 0x02, 0x0f, 0x3d, 0x00, 0x9e, 0x9e, 0x9e,
|
|
||||||
0x10, 0x3e, 0x03, 0x51, 0x3f, 0x64, 0x10, 0x40, 0x04, 0x51, 0x41, 0x65,
|
|
||||||
0x47, 0x41, 0x01, 0x53, 0x3c, 0x03, 0x10, 0x3d, 0x23, 0x10, 0x3e, 0x02,
|
|
||||||
0x0f, 0x3f, 0x00, 0x6d, 0x80, 0x86, 0x10, 0x40, 0x03, 0x51, 0x41, 0x4f,
|
|
||||||
0x10, 0x42, 0x04, 0x51, 0x43, 0x66, 0x47, 0x43, 0x01, 0x53, 0x3e, 0x03,
|
|
||||||
0x10, 0x3f, 0x24, 0x10, 0x40, 0x02, 0x0f, 0x41, 0x00, 0xff, 0x80, 0x87,
|
|
||||||
0x10, 0x42, 0x03, 0x51, 0x43, 0x67, 0x10, 0x44, 0x04, 0x51, 0x45, 0x68,
|
|
||||||
0x47, 0x45, 0x01, 0x10, 0x46, 0x25, 0x51, 0x47, 0x69, 0x47, 0x47, 0x01,
|
|
||||||
0x10, 0x48, 0x05, 0x51, 0x49, 0x09, 0x53, 0x40, 0x05, 0x10, 0x41, 0x26,
|
|
||||||
0x10, 0x42, 0x02, 0x0f, 0x43, 0x00, 0x4d, 0x5a, 0x5e, 0x10, 0x44, 0x03,
|
|
||||||
0x51, 0x45, 0x6a, 0x10, 0x46, 0x04, 0x51, 0x47, 0x6b, 0x47, 0x47, 0x01,
|
|
||||||
0x10, 0x48, 0x25, 0x51, 0x49, 0x6c, 0x51, 0x4a, 0x6d, 0x47, 0x49, 0x02,
|
|
||||||
0x10, 0x4a, 0x05, 0x51, 0x4b, 0x0b, 0x53, 0x42, 0x05, 0x53, 0x01, 0x21,
|
|
||||||
0x1a, 0x01, 0x27, 0x10, 0x01, 0x28, 0x10, 0x02, 0x29, 0x0f, 0x03, 0x00,
|
|
||||||
0xee, 0xee, 0xee, 0x53, 0x02, 0x01, 0x10, 0x03, 0x2a, 0x10, 0x04, 0x29,
|
|
||||||
0x0f, 0x05, 0x00, 0x7d, 0xcf, 0xff, 0x53, 0x04, 0x01, 0x10, 0x05, 0x2b,
|
|
||||||
0x10, 0x06, 0x29, 0x0f, 0x07, 0x00, 0xef, 0x51, 0x68, 0x53, 0x06, 0x01,
|
|
||||||
0x10, 0x07, 0x2c, 0x10, 0x08, 0x29, 0x0f, 0x09, 0x00, 0xaa, 0xaa, 0xaa,
|
|
||||||
0x10, 0x0a, 0x2d, 0x13, 0x0b, 0x53, 0x08, 0x02, 0x10, 0x09, 0x2e, 0x10,
|
|
||||||
0x0a, 0x29, 0x0f, 0x0b, 0x00, 0xaa, 0xd9, 0x4c, 0x53, 0x0a, 0x01, 0x10,
|
|
||||||
0x0b, 0x2f, 0x10, 0x0c, 0x29, 0x0f, 0x0d, 0x00, 0x7d, 0xcf, 0xff, 0x53,
|
|
||||||
0x0c, 0x01, 0x10, 0x0d, 0x30, 0x10, 0x0e, 0x29, 0x0f, 0x0f, 0x00, 0x7d,
|
|
||||||
0xcf, 0xff, 0x53, 0x0e, 0x01, 0x10, 0x0f, 0x31, 0x10, 0x10, 0x29, 0x0f,
|
|
||||||
0x11, 0x00, 0xd2, 0xa6, 0xff, 0x53, 0x10, 0x01, 0x10, 0x11, 0x32, 0x10,
|
|
||||||
0x12, 0x29, 0x0f, 0x13, 0x00, 0xe6, 0xc0, 0x8a, 0x53, 0x12, 0x01, 0x10,
|
|
||||||
0x13, 0x33, 0x10, 0x14, 0x29, 0x0f, 0x15, 0x00, 0x7a, 0xe9, 0x3c, 0x53,
|
|
||||||
0x14, 0x01, 0x10, 0x15, 0x34, 0x10, 0x16, 0x29, 0x0f, 0x17, 0x00, 0xef,
|
|
||||||
0x51, 0x68, 0x53, 0x16, 0x01, 0x10, 0x17, 0x35, 0x10, 0x18, 0x29, 0x0f,
|
|
||||||
0x19, 0x00, 0xff, 0xaf, 0x70, 0x53, 0x18, 0x01, 0x10, 0x19, 0x36, 0x10,
|
|
||||||
0x1a, 0x29, 0x0f, 0x1b, 0x00, 0xff, 0x8f, 0x40, 0x53, 0x1a, 0x01, 0x10,
|
|
||||||
0x1b, 0x37, 0x10, 0x1c, 0x29, 0x0f, 0x1d, 0x00, 0xf0, 0x71, 0x78, 0x53,
|
|
||||||
0x1c, 0x01, 0x10, 0x1d, 0x38, 0x10, 0x1e, 0x29, 0x0f, 0x1f, 0x00, 0xff,
|
|
||||||
0xff, 0xff, 0x10, 0x20, 0x2d, 0x13, 0x21, 0x53, 0x1e, 0x02, 0x10, 0x1f,
|
|
||||||
0x39, 0x10, 0x20, 0x29, 0x0f, 0x21, 0x00, 0xff, 0xaf, 0x70, 0x53, 0x20,
|
|
||||||
0x01, 0x10, 0x21, 0x3a, 0x10, 0x22, 0x29, 0x0f, 0x23, 0x00, 0xf0, 0x71,
|
|
||||||
0x78, 0x53, 0x22, 0x01, 0x10, 0x23, 0x3b, 0x10, 0x24, 0x29, 0x0f, 0x25,
|
|
||||||
0x00, 0x7d, 0xcf, 0xff, 0x53, 0x24, 0x01, 0x10, 0x25, 0x3c, 0x10, 0x26,
|
|
||||||
0x29, 0x0f, 0x27, 0x00, 0x95, 0xe6, 0xcb, 0x53, 0x26, 0x01, 0x10, 0x27,
|
|
||||||
0x3d, 0x10, 0x28, 0x29, 0x0f, 0x29, 0x00, 0xf0, 0x71, 0x78, 0x53, 0x28,
|
|
||||||
0x01, 0x10, 0x29, 0x3e, 0x10, 0x2a, 0x29, 0x0f, 0x2b, 0x00, 0x7d, 0xcf,
|
|
||||||
0xff, 0x53, 0x2a, 0x01, 0x10, 0x2b, 0x3f, 0x10, 0x2c, 0x29, 0x0f, 0x2d,
|
|
||||||
0x00, 0xff, 0x8f, 0x40, 0x53, 0x2c, 0x01, 0x10, 0x2d, 0x40, 0x10, 0x2e,
|
|
||||||
0x29, 0x0f, 0x2f, 0x00, 0xd2, 0xa6, 0xff, 0x53, 0x2e, 0x01, 0x10, 0x2f,
|
|
||||||
0x41, 0x10, 0x30, 0x29, 0x0f, 0x31, 0x00, 0xd2, 0xa6, 0xff, 0x53, 0x30,
|
|
||||||
0x01, 0x10, 0x31, 0x42, 0x10, 0x32, 0x29, 0x0f, 0x33, 0x00, 0xff, 0xaf,
|
|
||||||
0xaf, 0x53, 0x32, 0x01, 0x10, 0x33, 0x43, 0x10, 0x34, 0x29, 0x0f, 0x35,
|
|
||||||
0x00, 0xff, 0xff, 0x00, 0x53, 0x34, 0x01, 0x10, 0x35, 0x44, 0x10, 0x36,
|
|
||||||
0x29, 0x0f, 0x37, 0x00, 0x0f, 0xff, 0x0f, 0x53, 0x36, 0x01, 0x10, 0x37,
|
|
||||||
0x45, 0x10, 0x38, 0x29, 0x0f, 0x39, 0x00, 0xff, 0x0f, 0x0f, 0x53, 0x38,
|
|
||||||
0x01, 0x53, 0x01, 0x1c, 0x1a, 0x01, 0x46, 0x10, 0x01, 0x47, 0x1a, 0x01,
|
|
||||||
0x48, 0x53, 0x01, 0x00, 0x1a, 0x01, 0x49, 0x53, 0x01, 0x00, 0x1a, 0x01,
|
|
||||||
0x4a, 0x53, 0x01, 0x00, 0x1a, 0x01, 0x4b, 0x11, 0x01, 0x1a, 0x01, 0x4c,
|
|
||||||
0x11, 0x01, 0x1a, 0x01, 0x4d, 0x57, 0x02, 0x00, 0x2e, 0x01, 0x4e, 0x00,
|
|
||||||
0x1a, 0x01, 0x4f, 0x12, 0x01, 0x62, 0x01, 0x5e, 0x01, 0x01, 0x38, 0x01,
|
|
||||||
0x00, 0x6e, 0x00, 0x00, 0x06, 0x63, 0x6c, 0x61, 0x6e, 0x67, 0x64, 0x00,
|
|
||||||
0x00, 0x00, 0x12, 0x2d, 0x2d, 0x62, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f,
|
|
||||||
0x75, 0x6e, 0x64, 0x2d, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x00, 0x00, 0x00,
|
|
||||||
0x0c, 0x2d, 0x2d, 0x63, 0x6c, 0x61, 0x6e, 0x67, 0x2d, 0x74, 0x69, 0x64,
|
|
||||||
0x79, 0x00, 0x00, 0x00, 0x1b, 0x2d, 0x2d, 0x63, 0x6f, 0x6d, 0x70, 0x6c,
|
|
||||||
0x65, 0x74, 0x69, 0x6f, 0x6e, 0x2d, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x3d,
|
|
||||||
0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x00, 0x00, 0x00, 0x18,
|
|
||||||
0x2d, 0x2d, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x2d, 0x69, 0x6e, 0x73,
|
|
||||||
0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x6e, 0x65, 0x76, 0x65, 0x72,
|
|
||||||
0x00, 0x00, 0x00, 0x14, 0x2d, 0x2d, 0x70, 0x63, 0x68, 0x2d, 0x73, 0x74,
|
|
||||||
0x6f, 0x72, 0x61, 0x67, 0x65, 0x3d, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79,
|
|
||||||
0x00, 0x00, 0x00, 0x12, 0x2d, 0x2d, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2d,
|
|
||||||
0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x3d, 0x35, 0x30, 0x00, 0x00,
|
|
||||||
0x00, 0x0b, 0x2d, 0x2d, 0x6c, 0x6f, 0x67, 0x3d, 0x65, 0x72, 0x72, 0x6f,
|
|
||||||
0x72, 0x00, 0x00, 0x00, 0x08, 0x72, 0x75, 0x62, 0x79, 0x2d, 0x6c, 0x73,
|
|
||||||
0x70, 0x00, 0x00, 0x00, 0x0a, 0x73, 0x6f, 0x6c, 0x61, 0x72, 0x67, 0x72,
|
|
||||||
0x61, 0x70, 0x68, 0x00, 0x00, 0x00, 0x05, 0x73, 0x74, 0x64, 0x69, 0x6f,
|
|
||||||
0x00, 0x00, 0x00, 0x14, 0x62, 0x61, 0x73, 0x68, 0x2d, 0x6c, 0x61, 0x6e,
|
|
||||||
0x67, 0x75, 0x61, 0x67, 0x65, 0x2d, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72,
|
|
||||||
0x00, 0x00, 0x00, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x00, 0x00, 0x00,
|
|
||||||
0x1a, 0x76, 0x73, 0x63, 0x6f, 0x64, 0x65, 0x2d, 0x63, 0x73, 0x73, 0x2d,
|
|
||||||
0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2d, 0x73, 0x65, 0x72,
|
|
||||||
0x76, 0x65, 0x72, 0x00, 0x00, 0x00, 0x07, 0x2d, 0x2d, 0x73, 0x74, 0x64,
|
|
||||||
0x69, 0x6f, 0x00, 0x00, 0x00, 0x1b, 0x76, 0x73, 0x63, 0x6f, 0x64, 0x65,
|
|
||||||
0x2d, 0x6a, 0x73, 0x6f, 0x6e, 0x2d, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61,
|
|
||||||
0x67, 0x65, 0x2d, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x00, 0x00, 0x00,
|
|
||||||
0x08, 0x66, 0x69, 0x73, 0x68, 0x2d, 0x6c, 0x73, 0x70, 0x00, 0x00, 0x00,
|
|
||||||
0x05, 0x67, 0x6f, 0x70, 0x6c, 0x73, 0x00, 0x00, 0x00, 0x05, 0x73, 0x65,
|
|
||||||
0x72, 0x76, 0x65, 0x00, 0x00, 0x00, 0x17, 0x68, 0x61, 0x73, 0x6b, 0x65,
|
|
||||||
0x6c, 0x6c, 0x2d, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2d,
|
|
||||||
0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x00, 0x00, 0x00, 0x03, 0x6c, 0x73,
|
|
||||||
0x70, 0x00, 0x00, 0x00, 0x15, 0x65, 0x6d, 0x6d, 0x65, 0x74, 0x2d, 0x6c,
|
|
||||||
0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2d, 0x73, 0x65, 0x72, 0x76,
|
|
||||||
0x65, 0x72, 0x00, 0x00, 0x00, 0x1a, 0x74, 0x79, 0x70, 0x65, 0x73, 0x63,
|
|
||||||
0x72, 0x69, 0x70, 0x74, 0x2d, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67,
|
|
||||||
0x65, 0x2d, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x00, 0x00, 0x00, 0x13,
|
|
||||||
0x6c, 0x75, 0x61, 0x2d, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65,
|
|
||||||
0x2d, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x00, 0x00, 0x00, 0x12, 0x70,
|
|
||||||
0x79, 0x72, 0x69, 0x67, 0x68, 0x74, 0x2d, 0x6c, 0x61, 0x6e, 0x67, 0x73,
|
|
||||||
0x65, 0x72, 0x76, 0x65, 0x72, 0x00, 0x00, 0x00, 0x0d, 0x72, 0x75, 0x73,
|
|
||||||
0x74, 0x2d, 0x61, 0x6e, 0x61, 0x6c, 0x79, 0x7a, 0x65, 0x72, 0x00, 0x00,
|
|
||||||
0x00, 0x0c, 0x69, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x68, 0x65, 0x6e,
|
|
||||||
0x73, 0x65, 0x00, 0x00, 0x00, 0x08, 0x6d, 0x61, 0x72, 0x6b, 0x73, 0x6d,
|
|
||||||
0x61, 0x6e, 0x00, 0x00, 0x00, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72,
|
|
||||||
0x00, 0x00, 0x00, 0x15, 0x6e, 0x67, 0x69, 0x6e, 0x78, 0x2d, 0x6c, 0x61,
|
|
||||||
0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2d, 0x73, 0x65, 0x72, 0x76, 0x65,
|
|
||||||
0x72, 0x00, 0x00, 0x00, 0x05, 0x74, 0x61, 0x70, 0x6c, 0x6f, 0x00, 0x00,
|
|
||||||
0x00, 0x14, 0x79, 0x61, 0x6d, 0x6c, 0x2d, 0x6c, 0x61, 0x6e, 0x67, 0x75,
|
|
||||||
0x61, 0x67, 0x65, 0x2d, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x00, 0x00,
|
|
||||||
0x00, 0x04, 0x73, 0x71, 0x6c, 0x73, 0x00, 0x00, 0x00, 0x14, 0x6d, 0x61,
|
|
||||||
0x6b, 0x65, 0x2d, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2d,
|
|
||||||
0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x00, 0x00, 0x00, 0x13, 0x73, 0x71,
|
|
||||||
0x6c, 0x2d, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2d, 0x73,
|
|
||||||
0x65, 0x72, 0x76, 0x65, 0x72, 0x00, 0x00, 0x00, 0x02, 0x75, 0x70, 0x00,
|
|
||||||
0x00, 0x00, 0x08, 0x2d, 0x2d, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x00,
|
|
||||||
0x00, 0x00, 0x04, 0xee, 0x98, 0x9e, 0x20, 0x00, 0x00, 0x00, 0x01, 0x63,
|
|
||||||
0x00, 0x00, 0x00, 0x04, 0xee, 0x98, 0x9d, 0x20, 0x00, 0x00, 0x00, 0x03,
|
|
||||||
0x63, 0x70, 0x70, 0x00, 0x00, 0x00, 0x02, 0x63, 0x63, 0x00, 0x00, 0x00,
|
|
||||||
0x03, 0x63, 0x78, 0x78, 0x00, 0x00, 0x00, 0x04, 0xef, 0x83, 0xbd, 0x20,
|
|
||||||
0x00, 0x00, 0x00, 0x01, 0x68, 0x00, 0x00, 0x00, 0x03, 0x68, 0x70, 0x70,
|
|
||||||
0x00, 0x00, 0x00, 0x04, 0xee, 0x9a, 0xb8, 0x20, 0x00, 0x00, 0x00, 0x03,
|
|
||||||
0x63, 0x73, 0x73, 0x00, 0x00, 0x00, 0x04, 0xee, 0xb9, 0x81, 0x20, 0x00,
|
|
||||||
0x00, 0x00, 0x04, 0x66, 0x69, 0x73, 0x68, 0x00, 0x00, 0x00, 0x04, 0xee,
|
|
||||||
0x98, 0xa7, 0x20, 0x00, 0x00, 0x00, 0x02, 0x67, 0x6f, 0x00, 0x00, 0x00,
|
|
||||||
0x03, 0x6d, 0x6f, 0x64, 0x00, 0x00, 0x00, 0x04, 0xee, 0x9d, 0xb7, 0x20,
|
|
||||||
0x00, 0x00, 0x00, 0x02, 0x68, 0x73, 0x00, 0x00, 0x00, 0x03, 0x6c, 0x68,
|
|
||||||
0x73, 0x00, 0x00, 0x00, 0x04, 0xef, 0x84, 0xa1, 0x20, 0x00, 0x00, 0x00,
|
|
||||||
0x04, 0x68, 0x74, 0x6d, 0x6c, 0x00, 0x00, 0x00, 0x03, 0x68, 0x74, 0x6d,
|
|
||||||
0x00, 0x00, 0x00, 0x04, 0xef, 0x8b, 0xaf, 0x20, 0x00, 0x00, 0x00, 0x02,
|
|
||||||
0x6a, 0x73, 0x00, 0x00, 0x00, 0x04, 0xee, 0x9a, 0x9d, 0x20, 0x00, 0x00,
|
|
||||||
0x00, 0x02, 0x74, 0x73, 0x00, 0x00, 0x00, 0x02, 0x7b, 0x7d, 0x00, 0x00,
|
|
||||||
0x00, 0x04, 0x6a, 0x73, 0x6f, 0x6e, 0x00, 0x00, 0x00, 0x05, 0x6a, 0x73,
|
|
||||||
0x6f, 0x6e, 0x63, 0x00, 0x00, 0x00, 0x03, 0x65, 0x72, 0x62, 0x00, 0x00,
|
|
||||||
0x00, 0x05, 0xf3, 0xb0, 0xa2, 0xb1, 0x20, 0x00, 0x00, 0x00, 0x03, 0x6c,
|
|
||||||
0x75, 0x61, 0x00, 0x00, 0x00, 0x05, 0xf3, 0xb0, 0x8c, 0xa0, 0x20, 0x00,
|
|
||||||
0x00, 0x00, 0x02, 0x70, 0x79, 0x00, 0x00, 0x00, 0x07, 0x70, 0x79, 0x72,
|
|
||||||
0x69, 0x67, 0x68, 0x74, 0x00, 0x00, 0x00, 0x05, 0xf3, 0xb1, 0x98, 0x97,
|
|
||||||
0x20, 0x00, 0x00, 0x00, 0x02, 0x72, 0x73, 0x00, 0x00, 0x00, 0x05, 0xf3,
|
|
||||||
0xb0, 0x8c, 0x9f, 0x20, 0x00, 0x00, 0x00, 0x03, 0x70, 0x68, 0x70, 0x00,
|
|
||||||
0x00, 0x00, 0x04, 0xee, 0xba, 0xab, 0x20, 0x00, 0x00, 0x00, 0x02, 0x6d,
|
|
||||||
0x64, 0x00, 0x00, 0x00, 0x08, 0x6d, 0x61, 0x72, 0x6b, 0x64, 0x6f, 0x77,
|
|
||||||
0x6e, 0x00, 0x00, 0x00, 0x04, 0xee, 0x98, 0x95, 0x20, 0x00, 0x00, 0x00,
|
|
||||||
0x04, 0x63, 0x6f, 0x6e, 0x66, 0x00, 0x00, 0x00, 0x04, 0xee, 0x9a, 0xb2,
|
|
||||||
0x20, 0x00, 0x00, 0x00, 0x04, 0x74, 0x6f, 0x6d, 0x6c, 0x00, 0x00, 0x00,
|
|
||||||
0x03, 0x79, 0x6d, 0x6c, 0x00, 0x00, 0x00, 0x04, 0x79, 0x61, 0x6d, 0x6c,
|
|
||||||
0x00, 0x00, 0x00, 0x04, 0xee, 0x99, 0x8d, 0x20, 0x00, 0x00, 0x00, 0x03,
|
|
||||||
0x73, 0x71, 0x6c, 0x00, 0x00, 0x00, 0x04, 0xee, 0x99, 0xb3, 0x20, 0x00,
|
|
||||||
0x00, 0x00, 0x08, 0x4d, 0x61, 0x6b, 0x65, 0x66, 0x69, 0x6c, 0x65, 0x00,
|
|
||||||
0x00, 0x00, 0x08, 0x6d, 0x61, 0x6b, 0x65, 0x66, 0x69, 0x6c, 0x65, 0x00,
|
|
||||||
0x00, 0x00, 0x04, 0xee, 0x99, 0x9f, 0x20, 0x00, 0x00, 0x00, 0x02, 0x67,
|
|
||||||
0x64, 0x00, 0x00, 0x00, 0x04, 0xef, 0x80, 0xad, 0x20, 0x00, 0x00, 0x00,
|
|
||||||
0x03, 0x6d, 0x61, 0x6e, 0x00, 0x00, 0x00, 0x04, 0xee, 0x9c, 0xa8, 0x20,
|
|
||||||
0x00, 0x00, 0x00, 0x04, 0x64, 0x69, 0x66, 0x66, 0x00, 0x00, 0x00, 0x05,
|
|
||||||
0x70, 0x61, 0x74, 0x63, 0x68, 0x00, 0x00, 0x00, 0x04, 0xee, 0x99, 0x9d,
|
|
||||||
0x20, 0x00, 0x00, 0x00, 0x0d, 0x67, 0x69, 0x74, 0x61, 0x74, 0x74, 0x72,
|
|
||||||
0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x00, 0x00, 0x00, 0x09, 0x67, 0x69,
|
|
||||||
0x74, 0x69, 0x67, 0x6e, 0x6f, 0x72, 0x65, 0x00, 0x00, 0x00, 0x02, 0x2e,
|
|
||||||
0x2a, 0x00, 0x00, 0x00, 0x05, 0x72, 0x65, 0x67, 0x65, 0x78, 0x00, 0x00,
|
|
||||||
0x00, 0x03, 0x69, 0x6e, 0x69, 0x00, 0x00, 0x00, 0x05, 0xf3, 0xb0, 0xb4,
|
|
||||||
0xad, 0x20, 0x00, 0x00, 0x00, 0x02, 0x72, 0x62, 0x00, 0x00, 0x00, 0x07,
|
|
||||||
0x47, 0x65, 0x6d, 0x66, 0x69, 0x6c, 0x65, 0x00, 0x00, 0x00, 0x04, 0xee,
|
|
||||||
0xaf, 0x8a, 0x20, 0x00, 0x00, 0x00, 0x02, 0x73, 0x68, 0x00, 0x00, 0x00,
|
|
||||||
0x0c, 0x62, 0x61, 0x73, 0x68, 0x5f, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c,
|
|
||||||
0x65, 0x00, 0x00, 0x00, 0x06, 0x62, 0x61, 0x73, 0x68, 0x72, 0x63, 0x00,
|
|
||||||
0x00, 0x50, 0x00, 0x0b, 0x40, 0x6c, 0x73, 0x70, 0x5f, 0x63, 0x6f, 0x6e,
|
|
||||||
0x66, 0x69, 0x67, 0x00, 0x00, 0x01, 0x63, 0x00, 0x00, 0x05, 0x63, 0x6f,
|
|
||||||
0x6c, 0x6f, 0x72, 0x00, 0x00, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c,
|
|
||||||
0x00, 0x00, 0x0a, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e,
|
|
||||||
0x73, 0x00, 0x00, 0x03, 0x6c, 0x73, 0x70, 0x00, 0x00, 0x03, 0x63, 0x70,
|
|
||||||
0x70, 0x00, 0x00, 0x01, 0x68, 0x00, 0x00, 0x03, 0x63, 0x73, 0x73, 0x00,
|
|
||||||
0x00, 0x04, 0x66, 0x69, 0x73, 0x68, 0x00, 0x00, 0x02, 0x67, 0x6f, 0x00,
|
|
||||||
0x00, 0x05, 0x67, 0x6f, 0x6d, 0x6f, 0x64, 0x00, 0x00, 0x07, 0x68, 0x61,
|
|
||||||
0x73, 0x6b, 0x65, 0x6c, 0x6c, 0x00, 0x00, 0x04, 0x68, 0x74, 0x6d, 0x6c,
|
|
||||||
0x00, 0x00, 0x0a, 0x6a, 0x61, 0x76, 0x61, 0x73, 0x63, 0x72, 0x69, 0x70,
|
|
||||||
0x74, 0x00, 0x00, 0x0a, 0x74, 0x79, 0x70, 0x65, 0x73, 0x63, 0x72, 0x69,
|
|
||||||
0x70, 0x74, 0x00, 0x00, 0x04, 0x6a, 0x73, 0x6f, 0x6e, 0x00, 0x00, 0x05,
|
|
||||||
0x6a, 0x73, 0x6f, 0x6e, 0x63, 0x00, 0x00, 0x03, 0x65, 0x72, 0x62, 0x00,
|
|
||||||
0x00, 0x03, 0x6c, 0x75, 0x61, 0x00, 0x00, 0x06, 0x70, 0x79, 0x74, 0x68,
|
|
||||||
0x6f, 0x6e, 0x00, 0x00, 0x04, 0x72, 0x75, 0x73, 0x74, 0x00, 0x00, 0x03,
|
|
||||||
0x70, 0x68, 0x70, 0x00, 0x00, 0x08, 0x6d, 0x61, 0x72, 0x6b, 0x64, 0x6f,
|
|
||||||
0x77, 0x6e, 0x00, 0x00, 0x05, 0x6e, 0x67, 0x69, 0x6e, 0x78, 0x00, 0x00,
|
|
||||||
0x04, 0x74, 0x6f, 0x6d, 0x6c, 0x00, 0x00, 0x04, 0x79, 0x61, 0x6d, 0x6c,
|
|
||||||
0x00, 0x00, 0x03, 0x73, 0x71, 0x6c, 0x00, 0x00, 0x04, 0x6d, 0x61, 0x6b,
|
|
||||||
0x65, 0x00, 0x00, 0x08, 0x67, 0x64, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74,
|
|
||||||
0x00, 0x00, 0x03, 0x6d, 0x61, 0x6e, 0x00, 0x00, 0x04, 0x64, 0x69, 0x66,
|
|
||||||
0x66, 0x00, 0x00, 0x0d, 0x67, 0x69, 0x74, 0x61, 0x74, 0x74, 0x72, 0x69,
|
|
||||||
0x62, 0x75, 0x74, 0x65, 0x73, 0x00, 0x00, 0x09, 0x67, 0x69, 0x74, 0x69,
|
|
||||||
0x67, 0x6e, 0x6f, 0x72, 0x65, 0x00, 0x00, 0x05, 0x72, 0x65, 0x67, 0x65,
|
|
||||||
0x78, 0x00, 0x00, 0x03, 0x69, 0x6e, 0x69, 0x00, 0x00, 0x04, 0x72, 0x75,
|
|
||||||
0x62, 0x79, 0x00, 0x00, 0x09, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d,
|
|
||||||
0x65, 0x73, 0x00, 0x00, 0x04, 0x62, 0x61, 0x73, 0x68, 0x00, 0x00, 0x0a,
|
|
||||||
0x40, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x73, 0x00, 0x00,
|
|
||||||
0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x00, 0x00, 0x02, 0x66,
|
|
||||||
0x67, 0x00, 0x00, 0x07, 0x73, 0x68, 0x65, 0x62, 0x61, 0x6e, 0x67, 0x00,
|
|
||||||
0x00, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x00, 0x00, 0x07, 0x63, 0x6f,
|
|
||||||
0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x00, 0x00, 0x06, 0x69, 0x74, 0x61, 0x6c,
|
|
||||||
0x69, 0x63, 0x00, 0x00, 0x06, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x00,
|
|
||||||
0x00, 0x06, 0x65, 0x73, 0x63, 0x61, 0x70, 0x65, 0x00, 0x00, 0x0d, 0x69,
|
|
||||||
0x6e, 0x74, 0x65, 0x72, 0x70, 0x6f, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e,
|
|
||||||
0x00, 0x00, 0x06, 0x72, 0x65, 0x67, 0x65, 0x78, 0x70, 0x00, 0x00, 0x06,
|
|
||||||
0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x00, 0x00, 0x04, 0x74, 0x72, 0x75,
|
|
||||||
0x65, 0x00, 0x00, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x00, 0x00, 0x04,
|
|
||||||
0x63, 0x68, 0x61, 0x72, 0x00, 0x00, 0x07, 0x6b, 0x65, 0x79, 0x77, 0x6f,
|
|
||||||
0x72, 0x64, 0x00, 0x00, 0x0f, 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64,
|
|
||||||
0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x00, 0x00, 0x08, 0x6f,
|
|
||||||
0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x00, 0x00, 0x08, 0x66, 0x75,
|
|
||||||
0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x00, 0x00, 0x04, 0x74, 0x79, 0x70,
|
|
||||||
0x65, 0x00, 0x00, 0x08, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74,
|
|
||||||
0x00, 0x00, 0x10, 0x76, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x69,
|
|
||||||
0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x00, 0x00, 0x0e, 0x76, 0x61,
|
|
||||||
0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c,
|
|
||||||
0x00, 0x00, 0x0a, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f,
|
|
||||||
0x6e, 0x00, 0x00, 0x09, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x76,
|
|
||||||
0x65, 0x00, 0x00, 0x05, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x00, 0x00, 0x06,
|
|
||||||
0x62, 0x72, 0x61, 0x63, 0x65, 0x31, 0x00, 0x00, 0x06, 0x62, 0x72, 0x61,
|
|
||||||
0x63, 0x65, 0x32, 0x00, 0x00, 0x06, 0x62, 0x72, 0x61, 0x63, 0x65, 0x33,
|
|
||||||
0x00, 0x00, 0x06, 0x62, 0x72, 0x61, 0x63, 0x65, 0x34, 0x00, 0x00, 0x06,
|
|
||||||
0x62, 0x72, 0x61, 0x63, 0x65, 0x35, 0x00, 0x00, 0x06, 0x40, 0x74, 0x68,
|
|
||||||
0x65, 0x6d, 0x65, 0x00, 0x00, 0x09, 0x61, 0x75, 0x74, 0x6f, 0x5f, 0x75,
|
|
||||||
0x6e, 0x69, 0x78, 0x00, 0x00, 0x0d, 0x40, 0x6c, 0x69, 0x6e, 0x65, 0x5f,
|
|
||||||
0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x73, 0x00, 0x00, 0x0d, 0x40, 0x6b,
|
|
||||||
0x65, 0x79, 0x5f, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x73, 0x00,
|
|
||||||
0x00, 0x0a, 0x40, 0x6b, 0x65, 0x79, 0x5f, 0x62, 0x69, 0x6e, 0x64, 0x73,
|
|
||||||
0x00, 0x00, 0x0d, 0x40, 0x68, 0x69, 0x67, 0x68, 0x6c, 0x69, 0x67, 0x68,
|
|
||||||
0x74, 0x65, 0x72, 0x73, 0x00, 0x00, 0x0a, 0x40, 0x62, 0x5f, 0x73, 0x74,
|
|
||||||
0x61, 0x72, 0x74, 0x75, 0x70, 0x00, 0x00, 0x0b, 0x40, 0x62, 0x5f, 0x73,
|
|
||||||
0x68, 0x75, 0x74, 0x64, 0x6f, 0x77, 0x6e, 0x00, 0x00, 0x06, 0x6c, 0x61,
|
|
||||||
0x6d, 0x62, 0x64, 0x61, 0x00, 0x00, 0x06, 0x40, 0x62, 0x5f, 0x62, 0x61,
|
|
||||||
0x72, 0x00, 0x00, 0x00, 0x03, 0x47, 0x00, 0x09, 0x00, 0x14, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x02, 0x17, 0x34, 0x04, 0x00, 0x00, 0x0f, 0x03,
|
|
||||||
0x00, 0x82, 0xaa, 0xff, 0x51, 0x04, 0x00, 0x01, 0x09, 0x01, 0x10, 0x0a,
|
|
||||||
0x00, 0x23, 0x09, 0x10, 0x0a, 0x01, 0x01, 0x0b, 0x09, 0x2f, 0x0a, 0x02,
|
|
||||||
0x01, 0x26, 0x0a, 0x00, 0x03, 0x25, 0x00, 0x0c, 0x0f, 0x03, 0x00, 0x82,
|
|
||||||
0xaa, 0xff, 0x51, 0x04, 0x01, 0x25, 0x00, 0x74, 0x10, 0x0a, 0x03, 0x01,
|
|
||||||
0x0b, 0x09, 0x2f, 0x0a, 0x02, 0x01, 0x26, 0x0a, 0x00, 0x03, 0x25, 0x00,
|
|
||||||
0x0c, 0x0f, 0x03, 0x00, 0xff, 0x8f, 0x40, 0x51, 0x04, 0x02, 0x25, 0x00,
|
|
||||||
0x57, 0x10, 0x0a, 0x04, 0x01, 0x0b, 0x09, 0x2f, 0x0a, 0x02, 0x01, 0x26,
|
|
||||||
0x0a, 0x00, 0x03, 0x25, 0x00, 0x0c, 0x0f, 0x03, 0x00, 0x9a, 0xde, 0x7a,
|
|
||||||
0x51, 0x04, 0x03, 0x25, 0x00, 0x3a, 0x10, 0x0a, 0x05, 0x01, 0x0b, 0x09,
|
|
||||||
0x2f, 0x0a, 0x02, 0x01, 0x26, 0x0a, 0x00, 0x03, 0x25, 0x00, 0x0c, 0x0f,
|
|
||||||
0x03, 0x00, 0xff, 0xd7, 0x00, 0x51, 0x04, 0x04, 0x25, 0x00, 0x1d, 0x10,
|
|
||||||
0x0a, 0x06, 0x01, 0x0b, 0x09, 0x2f, 0x0a, 0x02, 0x01, 0x26, 0x0a, 0x00,
|
|
||||||
0x03, 0x25, 0x00, 0x0c, 0x0f, 0x03, 0x00, 0xf2, 0x9c, 0xc3, 0x51, 0x04,
|
|
||||||
0x05, 0x25, 0x00, 0x00, 0x1d, 0x09, 0x07, 0x2f, 0x09, 0x08, 0x00, 0x01,
|
|
||||||
0x0a, 0x01, 0x10, 0x0b, 0x09, 0x23, 0x0a, 0x23, 0x09, 0x01, 0x05, 0x09,
|
|
||||||
0x1d, 0x09, 0x0a, 0x01, 0x0a, 0x01, 0x10, 0x0b, 0x0b, 0x23, 0x0a, 0x2f,
|
|
||||||
0x09, 0x0c, 0x01, 0x01, 0x06, 0x09, 0x51, 0x09, 0x06, 0x01, 0x0a, 0x04,
|
|
||||||
0x52, 0x09, 0x51, 0x0a, 0x06, 0x52, 0x09, 0x01, 0x0a, 0x01, 0x10, 0x0b,
|
|
||||||
0x00, 0x23, 0x0a, 0x2f, 0x0a, 0x0d, 0x00, 0x2f, 0x0a, 0x0e, 0x00, 0x52,
|
|
||||||
0x09, 0x51, 0x0a, 0x07, 0x52, 0x09, 0x01, 0x0a, 0x05, 0x10, 0x0b, 0x0f,
|
|
||||||
0x23, 0x0a, 0x52, 0x09, 0x51, 0x0a, 0x08, 0x52, 0x09, 0x01, 0x0a, 0x06,
|
|
||||||
0x52, 0x09, 0x51, 0x0a, 0x09, 0x52, 0x09, 0x01, 0x07, 0x09, 0x47, 0x08,
|
|
||||||
0x00, 0x01, 0x09, 0x08, 0x10, 0x0a, 0x10, 0x0f, 0x0b, 0x00, 0x0b, 0x0e,
|
|
||||||
0x14, 0x10, 0x0c, 0x11, 0x01, 0x0d, 0x03, 0x10, 0x0e, 0x12, 0x08, 0x0f,
|
|
||||||
0x10, 0x10, 0x13, 0x06, 0x11, 0x10, 0x12, 0x14, 0x03, 0x13, 0x0a, 0x53,
|
|
||||||
0x0a, 0x05, 0x2f, 0x09, 0x15, 0x01, 0x01, 0x09, 0x08, 0x10, 0x0a, 0x10,
|
|
||||||
0x01, 0x0b, 0x03, 0x10, 0x0c, 0x11, 0x0f, 0x0d, 0x00, 0x33, 0x36, 0x3c,
|
|
||||||
0x10, 0x0e, 0x13, 0x03, 0x0f, 0x0a, 0x10, 0x10, 0x14, 0x07, 0x11, 0x53,
|
|
||||||
0x0a, 0x04, 0x2f, 0x09, 0x15, 0x01, 0x01, 0x09, 0x08, 0x10, 0x0a, 0x10,
|
|
||||||
0x0f, 0x0b, 0x00, 0x33, 0x36, 0x3c, 0x10, 0x0c, 0x11, 0x0f, 0x0d, 0x00,
|
|
||||||
0x24, 0x27, 0x2d, 0x10, 0x0e, 0x13, 0x03, 0x0f, 0x0b, 0x10, 0x10, 0x14,
|
|
||||||
0x07, 0x11, 0x53, 0x0a, 0x04, 0x2f, 0x09, 0x15, 0x01, 0x01, 0x09, 0x08,
|
|
||||||
0x10, 0x0a, 0x10, 0x01, 0x0b, 0x05, 0x10, 0x0c, 0x16, 0x23, 0x0b, 0x10,
|
|
||||||
0x0c, 0x11, 0x0f, 0x0d, 0x00, 0x24, 0x27, 0x2d, 0x10, 0x0e, 0x13, 0x03,
|
|
||||||
0x0f, 0x0d, 0x10, 0x10, 0x14, 0x08, 0x11, 0x53, 0x0a, 0x04, 0x2f, 0x09,
|
|
||||||
0x15, 0x01, 0x01, 0x09, 0x08, 0x10, 0x0a, 0x10, 0x0f, 0x0b, 0x00, 0xce,
|
|
||||||
0xd4, 0xdf, 0x10, 0x0c, 0x11, 0x0f, 0x0d, 0x00, 0x24, 0x27, 0x2d, 0x10,
|
|
||||||
0x0e, 0x13, 0x03, 0x0f, 0x0f, 0x10, 0x10, 0x14, 0x01, 0x11, 0x06, 0x2f,
|
|
||||||
0x11, 0x14, 0x00, 0x53, 0x0a, 0x04, 0x2f, 0x09, 0x15, 0x01, 0x01, 0x09,
|
|
||||||
0x08, 0x10, 0x0a, 0x10, 0x0f, 0x0b, 0x00, 0x24, 0x27, 0x2d, 0x10, 0x0c,
|
|
||||||
0x11, 0x06, 0x0d, 0x10, 0x0e, 0x13, 0x03, 0x0f, 0x0f, 0x01, 0x10, 0x06,
|
|
||||||
0x2f, 0x10, 0x14, 0x00, 0x3c, 0x0f, 0x10, 0x10, 0x14, 0x07, 0x11, 0x53,
|
|
||||||
0x0a, 0x04, 0x2f, 0x09, 0x15, 0x01, 0x10, 0x09, 0x17, 0x01, 0x0a, 0x07,
|
|
||||||
0x10, 0x0b, 0x18, 0x01, 0x0c, 0x08, 0x53, 0x09, 0x02, 0x39, 0x09, 0x38,
|
|
||||||
0x09, 0x00, 0x0a, 0x00, 0x00, 0x02, 0x20, 0x20, 0x00, 0x00, 0x00, 0x04,
|
|
||||||
0xee, 0x99, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x05, 0xf3, 0xb1, 0x93, 0xa7,
|
|
||||||
0x20, 0x00, 0x00, 0x00, 0x05, 0xf3, 0xb1, 0xa9, 0xa7, 0x20, 0x00, 0x00,
|
|
||||||
0x00, 0x04, 0xef, 0x84, 0xa0, 0x20, 0x00, 0x00, 0x00, 0x04, 0xee, 0xba,
|
|
||||||
0xa2, 0x20, 0x00, 0x00, 0x00, 0x01, 0x20, 0x00, 0x00, 0x00, 0x08, 0x20,
|
|
||||||
0xee, 0x82, 0xb4, 0xee, 0x82, 0xb4, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x03, 0xee, 0x82, 0xb4, 0x00, 0x00, 0x19, 0x00, 0x04, 0x6d,
|
|
||||||
0x6f, 0x64, 0x65, 0x00, 0x00, 0x06, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c,
|
|
||||||
0x00, 0x00, 0x03, 0x3d, 0x3d, 0x3d, 0x00, 0x00, 0x06, 0x69, 0x6e, 0x73,
|
|
||||||
0x65, 0x72, 0x74, 0x00, 0x00, 0x06, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74,
|
|
||||||
0x00, 0x00, 0x06, 0x72, 0x75, 0x6e, 0x6e, 0x65, 0x72, 0x00, 0x00, 0x06,
|
|
||||||
0x6a, 0x75, 0x6d, 0x70, 0x65, 0x72, 0x00, 0x00, 0x01, 0x43, 0x00, 0x00,
|
|
||||||
0x09, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x73, 0x00, 0x00,
|
|
||||||
0x09, 0x6c, 0x61, 0x6e, 0x67, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x00, 0x00,
|
|
||||||
0x04, 0x46, 0x69, 0x6c, 0x65, 0x00, 0x00, 0x08, 0x66, 0x69, 0x6c, 0x65,
|
|
||||||
0x6e, 0x61, 0x6d, 0x65, 0x00, 0x00, 0x08, 0x62, 0x61, 0x73, 0x65, 0x6e,
|
|
||||||
0x61, 0x6d, 0x65, 0x00, 0x00, 0x04, 0x74, 0x6f, 0x5f, 0x73, 0x00, 0x00,
|
|
||||||
0x06, 0x75, 0x70, 0x63, 0x61, 0x73, 0x65, 0x00, 0x00, 0x06, 0x73, 0x79,
|
|
||||||
0x6d, 0x62, 0x6f, 0x6c, 0x00, 0x00, 0x02, 0x66, 0x67, 0x00, 0x00, 0x02,
|
|
||||||
0x62, 0x67, 0x00, 0x00, 0x05, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x00, 0x00,
|
|
||||||
0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x00, 0x00, 0x06, 0x6c, 0x65, 0x6e,
|
|
||||||
0x67, 0x74, 0x68, 0x00, 0x00, 0x02, 0x3c, 0x3c, 0x00, 0x00, 0x05, 0x63,
|
|
||||||
0x6f, 0x6c, 0x6f, 0x72, 0x00, 0x00, 0x04, 0x74, 0x65, 0x78, 0x74, 0x00,
|
|
||||||
0x00, 0x0a, 0x68, 0x69, 0x67, 0x68, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x73,
|
|
||||||
0x00, 0x00, 0x00, 0x01, 0x1b, 0x00, 0x01, 0x00, 0x08, 0x00, 0x04, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x45, 0x10, 0x02, 0x00, 0x10, 0x03, 0x01, 0x10,
|
|
||||||
0x04, 0x02, 0x10, 0x05, 0x03, 0x10, 0x06, 0x04, 0x2d, 0x01, 0x05, 0x05,
|
|
||||||
0x10, 0x02, 0x06, 0x10, 0x03, 0x07, 0x10, 0x04, 0x08, 0x10, 0x05, 0x09,
|
|
||||||
0x2d, 0x01, 0x0a, 0x04, 0x63, 0x01, 0x58, 0x02, 0x00, 0x5f, 0x01, 0x0b,
|
|
||||||
0x63, 0x01, 0x58, 0x02, 0x01, 0x5f, 0x01, 0x0c, 0x63, 0x01, 0x58, 0x02,
|
|
||||||
0x02, 0x5f, 0x01, 0x0d, 0x63, 0x01, 0x58, 0x02, 0x03, 0x5f, 0x01, 0x0e,
|
|
||||||
0x38, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x05, 0x74, 0x68, 0x65, 0x6d,
|
|
||||||
0x65, 0x00, 0x00, 0x0a, 0x6c, 0x73, 0x70, 0x5f, 0x63, 0x6f, 0x6e, 0x66,
|
|
||||||
0x69, 0x67, 0x00, 0x00, 0x09, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67,
|
|
||||||
0x65, 0x73, 0x00, 0x00, 0x0c, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x65, 0x6e,
|
|
||||||
0x64, 0x69, 0x6e, 0x67, 0x73, 0x00, 0x00, 0x0c, 0x68, 0x69, 0x67, 0x68,
|
|
||||||
0x6c, 0x69, 0x67, 0x68, 0x74, 0x65, 0x72, 0x73, 0x00, 0x00, 0x0d, 0x61,
|
|
||||||
0x74, 0x74, 0x72, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72,
|
|
||||||
0x00, 0x00, 0x09, 0x62, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x75, 0x70,
|
|
||||||
0x00, 0x00, 0x0a, 0x62, 0x5f, 0x73, 0x68, 0x75, 0x74, 0x64, 0x6f, 0x77,
|
|
||||||
0x6e, 0x00, 0x00, 0x12, 0x62, 0x5f, 0x65, 0x78, 0x74, 0x72, 0x61, 0x5f,
|
|
||||||
0x68, 0x69, 0x67, 0x68, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x73, 0x00, 0x00,
|
|
||||||
0x05, 0x62, 0x5f, 0x62, 0x61, 0x72, 0x00, 0x00, 0x0b, 0x61, 0x74, 0x74,
|
|
||||||
0x72, 0x5f, 0x72, 0x65, 0x61, 0x64, 0x65, 0x72, 0x00, 0x00, 0x07, 0x73,
|
|
||||||
0x74, 0x61, 0x72, 0x74, 0x75, 0x70, 0x00, 0x00, 0x08, 0x73, 0x68, 0x75,
|
|
||||||
0x74, 0x64, 0x6f, 0x77, 0x6e, 0x00, 0x00, 0x10, 0x65, 0x78, 0x74, 0x72,
|
|
||||||
0x61, 0x5f, 0x68, 0x69, 0x67, 0x68, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x73,
|
|
||||||
0x00, 0x00, 0x04, 0x62, 0x69, 0x6e, 0x64, 0x00, 0x00, 0x00, 0x00, 0x2d,
|
|
||||||
0x00, 0x02, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c,
|
|
||||||
0x34, 0x00, 0x00, 0x01, 0x01, 0x02, 0x01, 0x1a, 0x02, 0x00, 0x38, 0x02,
|
|
||||||
0x00, 0x00, 0x00, 0x01, 0x00, 0x0a, 0x40, 0x62, 0x5f, 0x73, 0x74, 0x61,
|
|
||||||
0x72, 0x74, 0x75, 0x70, 0x00, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x02, 0x00,
|
|
||||||
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x34, 0x00, 0x00,
|
|
||||||
0x01, 0x01, 0x02, 0x01, 0x1a, 0x02, 0x00, 0x38, 0x02, 0x00, 0x00, 0x00,
|
|
||||||
0x01, 0x00, 0x0b, 0x40, 0x62, 0x5f, 0x73, 0x68, 0x75, 0x74, 0x64, 0x6f,
|
|
||||||
0x77, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x02, 0x00, 0x03, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x34, 0x00, 0x00, 0x01, 0x01,
|
|
||||||
0x02, 0x01, 0x1a, 0x02, 0x00, 0x38, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00,
|
|
||||||
0x13, 0x40, 0x62, 0x5f, 0x65, 0x78, 0x74, 0x72, 0x61, 0x5f, 0x68, 0x69,
|
|
||||||
0x67, 0x68, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x73, 0x00, 0x00, 0x00, 0x01,
|
|
||||||
0x43, 0x00, 0x07, 0x00, 0x0a, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0xc1, 0x34, 0x04, 0x40, 0x01, 0x25, 0x00, 0x06, 0x25, 0x00, 0x05, 0x25,
|
|
||||||
0x00, 0x04, 0x11, 0x02, 0x11, 0x03, 0x01, 0x07, 0x01, 0x1d, 0x08, 0x00,
|
|
||||||
0x2f, 0x07, 0x01, 0x01, 0x26, 0x07, 0x00, 0x07, 0x01, 0x07, 0x01, 0x48,
|
|
||||||
0x01, 0x07, 0x01, 0x01, 0x07, 0x02, 0x28, 0x07, 0x00, 0x03, 0x25, 0x00,
|
|
||||||
0x33, 0x12, 0x05, 0x1d, 0x07, 0x02, 0x2f, 0x07, 0x03, 0x00, 0x01, 0x06,
|
|
||||||
0x07, 0x01, 0x07, 0x06, 0x10, 0x08, 0x04, 0x57, 0x09, 0x00, 0x30, 0x07,
|
|
||||||
0x05, 0x01, 0x2d, 0x07, 0x06, 0x00, 0x27, 0x07, 0x00, 0x0d, 0x01, 0x07,
|
|
||||||
0x06, 0x01, 0x08, 0x04, 0x30, 0x07, 0x07, 0x00, 0x25, 0x00, 0x02, 0x11,
|
|
||||||
0x07, 0x25, 0x00, 0x5c, 0x2d, 0x07, 0x06, 0x00, 0x27, 0x07, 0x00, 0x22,
|
|
||||||
0x01, 0x07, 0x02, 0x1d, 0x08, 0x00, 0x2f, 0x07, 0x01, 0x01, 0x26, 0x07,
|
|
||||||
0x00, 0x07, 0x01, 0x07, 0x02, 0x48, 0x02, 0x07, 0x01, 0x01, 0x07, 0x01,
|
|
||||||
0x57, 0x08, 0x01, 0x30, 0x07, 0x08, 0x00, 0x25, 0x00, 0x32, 0x01, 0x07,
|
|
||||||
0x03, 0x1d, 0x08, 0x09, 0x2f, 0x07, 0x01, 0x01, 0x27, 0x07, 0x00, 0x22,
|
|
||||||
0x01, 0x07, 0x02, 0x1d, 0x08, 0x00, 0x2f, 0x07, 0x01, 0x01, 0x26, 0x07,
|
|
||||||
0x00, 0x07, 0x01, 0x07, 0x02, 0x48, 0x02, 0x07, 0x01, 0x01, 0x07, 0x01,
|
|
||||||
0x57, 0x08, 0x02, 0x30, 0x07, 0x08, 0x00, 0x25, 0x00, 0x02, 0x11, 0x07,
|
|
||||||
0x38, 0x07, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x05, 0x41, 0x72, 0x72, 0x61,
|
|
||||||
0x79, 0x00, 0x00, 0x05, 0x69, 0x73, 0x5f, 0x61, 0x3f, 0x00, 0x00, 0x06,
|
|
||||||
0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x00, 0x00, 0x03, 0x6e, 0x65, 0x77,
|
|
||||||
0x00, 0x00, 0x03, 0x73, 0x65, 0x74, 0x00, 0x00, 0x17, 0x64, 0x65, 0x66,
|
|
||||||
0x69, 0x6e, 0x65, 0x5f, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x74, 0x6f,
|
|
||||||
0x6e, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x00, 0x00, 0x0c, 0x62,
|
|
||||||
0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x67, 0x69, 0x76, 0x65, 0x6e, 0x3f, 0x00,
|
|
||||||
0x00, 0x0d, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x65,
|
|
||||||
0x78, 0x65, 0x63, 0x00, 0x00, 0x04, 0x65, 0x61, 0x63, 0x68, 0x00, 0x00,
|
|
||||||
0x06, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x00, 0x00, 0x00, 0x00, 0x3e,
|
|
||||||
0x00, 0x04, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23,
|
|
||||||
0x34, 0x04, 0x20, 0x01, 0x25, 0x00, 0x03, 0x25, 0x00, 0x02, 0x11, 0x02,
|
|
||||||
0x21, 0x04, 0x05, 0x00, 0x21, 0x05, 0x01, 0x00, 0x01, 0x06, 0x01, 0x01,
|
|
||||||
0x07, 0x02, 0x01, 0x08, 0x03, 0x30, 0x04, 0x00, 0x03, 0x38, 0x04, 0x00,
|
|
||||||
0x00, 0x00, 0x01, 0x00, 0x04, 0x62, 0x69, 0x6e, 0x64, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x2c, 0x00, 0x03, 0x00, 0x05, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x11, 0x34, 0x04, 0x00, 0x00, 0x21, 0x03, 0x02, 0x00, 0x57, 0x04,
|
|
||||||
0x00, 0x30, 0x03, 0x00, 0x00, 0x38, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00,
|
|
||||||
0x04, 0x65, 0x61, 0x63, 0x68, 0x00, 0x00, 0x00, 0x00, 0x8d, 0x00, 0x03,
|
|
||||||
0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x59, 0x34, 0x04,
|
|
||||||
0x00, 0x00, 0x19, 0x03, 0x00, 0x21, 0x04, 0x01, 0x00, 0x01, 0x05, 0x03,
|
|
||||||
0x01, 0x06, 0x04, 0x2f, 0x05, 0x01, 0x01, 0x26, 0x05, 0x00, 0x07, 0x53,
|
|
||||||
0x05, 0x00, 0x2f, 0x03, 0x02, 0x02, 0x19, 0x03, 0x00, 0x21, 0x04, 0x01,
|
|
||||||
0x00, 0x23, 0x03, 0x01, 0x04, 0x01, 0x01, 0x05, 0x03, 0x01, 0x06, 0x04,
|
|
||||||
0x2f, 0x05, 0x01, 0x01, 0x26, 0x05, 0x00, 0x07, 0x47, 0x05, 0x00, 0x2f,
|
|
||||||
0x03, 0x02, 0x02, 0x19, 0x03, 0x00, 0x21, 0x04, 0x01, 0x00, 0x23, 0x03,
|
|
||||||
0x01, 0x04, 0x01, 0x23, 0x03, 0x21, 0x04, 0x04, 0x01, 0x2f, 0x03, 0x03,
|
|
||||||
0x01, 0x38, 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x0d, 0x40, 0x6b, 0x65,
|
|
||||||
0x79, 0x5f, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x73, 0x00, 0x00,
|
|
||||||
0x02, 0x5b, 0x5d, 0x00, 0x00, 0x03, 0x5b, 0x5d, 0x3d, 0x00, 0x00, 0x02,
|
|
||||||
0x3c, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x03, 0x00, 0x05, 0x00,
|
|
||||||
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x34, 0x04, 0x00, 0x00, 0x21,
|
|
||||||
0x03, 0x02, 0x00, 0x57, 0x04, 0x00, 0x30, 0x03, 0x00, 0x00, 0x38, 0x03,
|
|
||||||
0x00, 0x00, 0x00, 0x01, 0x00, 0x04, 0x65, 0x61, 0x63, 0x68, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x8a, 0x00, 0x03, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x59, 0x34, 0x04, 0x00, 0x00, 0x19, 0x03, 0x00, 0x21, 0x04,
|
|
||||||
0x01, 0x00, 0x01, 0x05, 0x03, 0x01, 0x06, 0x04, 0x2f, 0x05, 0x01, 0x01,
|
|
||||||
0x26, 0x05, 0x00, 0x07, 0x53, 0x05, 0x00, 0x2f, 0x03, 0x02, 0x02, 0x19,
|
|
||||||
0x03, 0x00, 0x21, 0x04, 0x01, 0x00, 0x23, 0x03, 0x01, 0x04, 0x01, 0x01,
|
|
||||||
0x05, 0x03, 0x01, 0x06, 0x04, 0x2f, 0x05, 0x01, 0x01, 0x26, 0x05, 0x00,
|
|
||||||
0x07, 0x47, 0x05, 0x00, 0x2f, 0x03, 0x02, 0x02, 0x19, 0x03, 0x00, 0x21,
|
|
||||||
0x04, 0x01, 0x00, 0x23, 0x03, 0x01, 0x04, 0x01, 0x23, 0x03, 0x21, 0x04,
|
|
||||||
0x03, 0x01, 0x2f, 0x03, 0x03, 0x01, 0x38, 0x03, 0x00, 0x00, 0x00, 0x04,
|
|
||||||
0x00, 0x0a, 0x40, 0x6b, 0x65, 0x79, 0x5f, 0x62, 0x69, 0x6e, 0x64, 0x73,
|
|
||||||
0x00, 0x00, 0x02, 0x5b, 0x5d, 0x00, 0x00, 0x03, 0x5b, 0x5d, 0x3d, 0x00,
|
|
||||||
0x00, 0x02, 0x3c, 0x3c, 0x00, 0x4c, 0x56, 0x41, 0x52, 0x00, 0x00, 0x00,
|
|
||||||
0xcc, 0x00, 0x00, 0x00, 0x12, 0x00, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x00,
|
|
||||||
0x0a, 0x6d, 0x6f, 0x64, 0x65, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x00,
|
|
||||||
0x0b, 0x6d, 0x6f, 0x64, 0x65, 0x5f, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c,
|
|
||||||
0x00, 0x09, 0x6c, 0x61, 0x6e, 0x67, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x00,
|
|
||||||
0x08, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x00, 0x08, 0x73,
|
|
||||||
0x74, 0x61, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x00, 0x0a, 0x68, 0x69, 0x67,
|
|
||||||
0x68, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x73, 0x00, 0x05, 0x62, 0x6c, 0x6f,
|
|
||||||
0x63, 0x6b, 0x00, 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x73, 0x00, 0x04, 0x6b,
|
|
||||||
0x65, 0x79, 0x73, 0x00, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x00,
|
|
||||||
0x03, 0x61, 0x70, 0x70, 0x00, 0x03, 0x64, 0x73, 0x6c, 0x00, 0x01, 0x6b,
|
|
||||||
0x00, 0x03, 0x61, 0x63, 0x74, 0x00, 0x03, 0x62, 0x6c, 0x6b, 0x00, 0x04,
|
|
||||||
0x6d, 0x6f, 0x64, 0x65, 0x00, 0x03, 0x6b, 0x65, 0x79, 0x00, 0x00, 0xff,
|
|
||||||
0xff, 0x00, 0x01, 0x00, 0x02, 0x00, 0x03, 0x00, 0x04, 0x00, 0x05, 0x00,
|
|
||||||
0x06, 0x00, 0x07, 0x00, 0x07, 0x00, 0x07, 0x00, 0x08, 0x00, 0x09, 0x00,
|
|
||||||
0x0a, 0x00, 0x07, 0x00, 0x0b, 0x00, 0x0c, 0x00, 0x0d, 0x00, 0x0e, 0x00,
|
|
||||||
0x0f, 0x00, 0x10, 0xff, 0xff, 0x00, 0x11, 0xff, 0xff, 0x00, 0x10, 0xff,
|
|
||||||
0xff, 0x00, 0x11, 0xff, 0xff, 0x45, 0x4e, 0x44, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x08
|
|
||||||
};
|
|
||||||
constexpr unsigned int _tmp___crib_precompiled_mrb_len = 7273;
|
|
||||||
@@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
#include "io/knot.h"
|
#include "io/knot.h"
|
||||||
#include "io/sysio.h"
|
#include "io/sysio.h"
|
||||||
|
#include "pch.h"
|
||||||
#include "syntax/trie.h"
|
#include "syntax/trie.h"
|
||||||
|
|
||||||
struct Highlight {
|
struct Highlight {
|
||||||
@@ -40,9 +41,4 @@ struct LineData {
|
|||||||
std::shared_ptr<void> out_state{nullptr};
|
std::shared_ptr<void> out_state{nullptr};
|
||||||
};
|
};
|
||||||
|
|
||||||
struct CustomState {
|
|
||||||
mrb_value state;
|
|
||||||
CustomState(mrb_value s) : state(s) {}
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
#ifndef SYNTAX_LANGS_H
|
#ifndef SYNTAX_LANGS_H
|
||||||
#define SYNTAX_LANGS_H
|
#define SYNTAX_LANGS_H
|
||||||
|
|
||||||
|
#include "scripting/decl.h"
|
||||||
#include "syntax/decl.h"
|
#include "syntax/decl.h"
|
||||||
|
|
||||||
#define DEF_LANG(name) \
|
#define DEF_LANG(name) \
|
||||||
|
|||||||
@@ -5,17 +5,12 @@
|
|||||||
|
|
||||||
struct LineTree {
|
struct LineTree {
|
||||||
void clear() {
|
void clear() {
|
||||||
std::unique_lock lock(mtx);
|
|
||||||
clear_node(root);
|
clear_node(root);
|
||||||
root = nullptr;
|
root = nullptr;
|
||||||
stack_size = 0;
|
stack_size = 0;
|
||||||
}
|
}
|
||||||
void build(uint32_t x) {
|
void build(uint32_t x) { root = build_node(x); }
|
||||||
std::unique_lock lock(mtx);
|
|
||||||
root = build_node(x);
|
|
||||||
}
|
|
||||||
LineData *at(uint32_t x) {
|
LineData *at(uint32_t x) {
|
||||||
std::shared_lock lock(mtx);
|
|
||||||
LineNode *n = root;
|
LineNode *n = root;
|
||||||
while (n) {
|
while (n) {
|
||||||
uint32_t left_size = n->left ? n->left->size : 0;
|
uint32_t left_size = n->left ? n->left->size : 0;
|
||||||
@@ -31,7 +26,6 @@ struct LineTree {
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
LineData *start_iter(uint32_t x) {
|
LineData *start_iter(uint32_t x) {
|
||||||
std::shared_lock lock(mtx);
|
|
||||||
stack_size = 0;
|
stack_size = 0;
|
||||||
LineNode *n = root;
|
LineNode *n = root;
|
||||||
while (n) {
|
while (n) {
|
||||||
@@ -52,7 +46,6 @@ struct LineTree {
|
|||||||
}
|
}
|
||||||
void end_iter() { stack_size = 0; }
|
void end_iter() { stack_size = 0; }
|
||||||
LineData *next() {
|
LineData *next() {
|
||||||
std::shared_lock lock(mtx);
|
|
||||||
while (stack_size) {
|
while (stack_size) {
|
||||||
auto &f = stack[stack_size - 1];
|
auto &f = stack[stack_size - 1];
|
||||||
LineNode *n = f.node;
|
LineNode *n = f.node;
|
||||||
@@ -73,21 +66,16 @@ struct LineTree {
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
void insert(uint32_t x, uint32_t y) {
|
void insert(uint32_t x, uint32_t y) {
|
||||||
std::unique_lock lock(mtx);
|
|
||||||
if (x > subtree_size(root))
|
if (x > subtree_size(root))
|
||||||
x = subtree_size(root);
|
x = subtree_size(root);
|
||||||
root = insert_node(root, x, y);
|
root = insert_node(root, x, y);
|
||||||
}
|
}
|
||||||
void erase(uint32_t x, uint32_t y) {
|
void erase(uint32_t x, uint32_t y) {
|
||||||
std::unique_lock lock(mtx);
|
|
||||||
if (x + y > subtree_size(root))
|
if (x + y > subtree_size(root))
|
||||||
x = subtree_size(root) - y;
|
x = subtree_size(root) - y;
|
||||||
root = erase_node(root, x, y);
|
root = erase_node(root, x, y);
|
||||||
}
|
}
|
||||||
uint32_t count() {
|
uint32_t count() { return subtree_size(root); }
|
||||||
std::shared_lock lock(mtx);
|
|
||||||
return subtree_size(root);
|
|
||||||
}
|
|
||||||
~LineTree() { clear(); }
|
~LineTree() { clear(); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -117,7 +105,6 @@ private:
|
|||||||
LineNode *root = nullptr;
|
LineNode *root = nullptr;
|
||||||
Frame stack[32];
|
Frame stack[32];
|
||||||
std::atomic<uint8_t> stack_size = 0;
|
std::atomic<uint8_t> stack_size = 0;
|
||||||
std::shared_mutex mtx;
|
|
||||||
static constexpr uint32_t LEAF_TARGET = 256;
|
static constexpr uint32_t LEAF_TARGET = 256;
|
||||||
LineTree::LineNode *erase_node(LineNode *n, uint32_t x, uint32_t y) {
|
LineTree::LineNode *erase_node(LineNode *n, uint32_t x, uint32_t y) {
|
||||||
if (!n || y == 0)
|
if (!n || y == 0)
|
||||||
|
|||||||
@@ -17,15 +17,13 @@ struct Parser {
|
|||||||
mrb_value parser_block = mrb_nil_value();
|
mrb_value parser_block = mrb_nil_value();
|
||||||
mrb_value match_block = mrb_nil_value();
|
mrb_value match_block = mrb_nil_value();
|
||||||
bool is_custom{false};
|
bool is_custom{false};
|
||||||
std::atomic<uint32_t> scroll_max{UINT32_MAX - 2048};
|
std::atomic<uint32_t> scroll_max{0};
|
||||||
std::atomic<bool> scroll_dirty{false};
|
std::atomic<bool> scroll_dirty{false};
|
||||||
std::mutex mutex;
|
|
||||||
std::mutex data_mutex;
|
|
||||||
LineTree line_tree;
|
LineTree line_tree;
|
||||||
UniqueQueue<uint32_t> dirty_lines;
|
UniqueQueue<uint32_t> dirty_lines;
|
||||||
|
|
||||||
Parser(Editor *editor, std::string n_lang, uint32_t n_scroll_max);
|
Parser(Editor *editor, std::string n_lang, uint32_t n_scroll_max);
|
||||||
void edit(uint32_t start_line, uint32_t old_end_line, uint32_t inserted_rows);
|
void edit(uint32_t start_line, uint32_t removed_rows, uint32_t inserted_rows);
|
||||||
void work();
|
void work();
|
||||||
void scroll(uint32_t line);
|
void scroll(uint32_t line);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -10,11 +10,8 @@ struct Bar {
|
|||||||
std::string command = "";
|
std::string command = "";
|
||||||
std::string log_line = "";
|
std::string log_line = "";
|
||||||
uint32_t cursor = 0;
|
uint32_t cursor = 0;
|
||||||
BarLine bar_line;
|
|
||||||
std::mutex mtx;
|
|
||||||
|
|
||||||
void init(Coord screen) { this->screen = screen; }
|
void init(Coord screen) { this->screen = screen; }
|
||||||
void work();
|
|
||||||
void render();
|
void render();
|
||||||
void handle(KeyEvent event);
|
void handle(KeyEvent event);
|
||||||
void log(std::string message);
|
void log(std::string message);
|
||||||
|
|||||||
@@ -155,9 +155,6 @@ std::string get_exe_dir();
|
|||||||
char *load_file(const char *path, uint32_t *out_len, bool *out_eol);
|
char *load_file(const char *path, uint32_t *out_len, bool *out_eol);
|
||||||
Language language_for_file(const char *filename);
|
Language language_for_file(const char *filename);
|
||||||
|
|
||||||
void copy_to_clipboard(const char *text, size_t len);
|
|
||||||
char *get_from_clipboard(uint32_t *out_len);
|
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
inline T *safe_get(std::map<uint16_t, T> &m, uint16_t key) {
|
inline T *safe_get(std::map<uint16_t, T> &m, uint16_t key) {
|
||||||
auto it = m.find(key);
|
auto it = m.find(key);
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ set -eu
|
|||||||
|
|
||||||
install() {
|
install() {
|
||||||
BINARY_NAME="crib"
|
BINARY_NAME="crib"
|
||||||
BIN_URL="https://git.syedm.dev/SyedM/crib/releases/download/v0.0.2-alpha/crib"
|
BIN_URL="https://git.syedm.dev/SyedM/crib/releases/download/v0.0.4-alpha/crib"
|
||||||
|
|
||||||
echo "Install or update locally (~/.local/bin) or globally (/usr/bin)? [l/g]"
|
echo "Install or update locally (~/.local/bin) or globally (/usr/bin)? [l/g]"
|
||||||
read -r choice </dev/tty
|
read -r choice </dev/tty
|
||||||
|
|||||||
1
libs/mruby
vendored
Submodule
1
libs/mruby
vendored
Submodule
Submodule libs/mruby added at 7d08c6246d
@@ -22,15 +22,12 @@ colorize() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Example of error handling
|
# Example of error handling
|
||||||
|
|
||||||
handle_error() {
|
handle_error() {
|
||||||
log ERROR "An error occurred on line $1"
|
log ERROR "An error occurred on line $1"
|
||||||
}
|
}
|
||||||
trap 'handle_error $LINENO' ERR
|
trap 'handle_error $LINENO' ERR
|
||||||
|
|
||||||
# Multiline string test
|
# Multiline string test
|
||||||
read -r -d '' MULTI <<'CPP'
|
read -r -d '' MULTI <<'CPP'
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -78,8 +78,7 @@ void completion_request(Editor *editor) {
|
|||||||
editor->completion.version = editor->lsp_version;
|
editor->completion.version = editor->lsp_version;
|
||||||
LSPPending *pending = new LSPPending();
|
LSPPending *pending = new LSPPending();
|
||||||
pending->editor = editor;
|
pending->editor = editor;
|
||||||
pending->method = "textDocument/completion";
|
pending->callback = [](Editor *editor, const json &message) {
|
||||||
pending->callback = [](Editor *editor, std::string, json message) {
|
|
||||||
auto &session = editor->completion;
|
auto &session = editor->completion;
|
||||||
std::unique_lock lock(session.mtx);
|
std::unique_lock lock(session.mtx);
|
||||||
std::vector<json> items_json;
|
std::vector<json> items_json;
|
||||||
@@ -359,8 +358,7 @@ void completion_resolve_doc(Editor *editor) {
|
|||||||
item.documentation = "";
|
item.documentation = "";
|
||||||
LSPPending *pending = new LSPPending();
|
LSPPending *pending = new LSPPending();
|
||||||
pending->editor = editor;
|
pending->editor = editor;
|
||||||
pending->method = "completionItem/resolve";
|
pending->callback = [](Editor *editor, const json &message) {
|
||||||
pending->callback = [](Editor *editor, std::string, json message) {
|
|
||||||
std::unique_lock lock(editor->completion.mtx);
|
std::unique_lock lock(editor->completion.mtx);
|
||||||
auto &item = editor->completion.items[editor->completion.select];
|
auto &item = editor->completion.items[editor->completion.select];
|
||||||
if (message["result"].contains("documentation")) {
|
if (message["result"].contains("documentation")) {
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ void edit_erase(Editor *editor, Coord pos, int64_t len) {
|
|||||||
editor->root = erase(editor->root, start, byte_pos - start);
|
editor->root = erase(editor->root, start, byte_pos - start);
|
||||||
lock_2.unlock();
|
lock_2.unlock();
|
||||||
if (editor->parser)
|
if (editor->parser)
|
||||||
editor->parser->edit(start_row, end_row, 0);
|
editor->parser->edit(start_row, end_row - start_row, 0);
|
||||||
if (do_lsp) {
|
if (do_lsp) {
|
||||||
if (editor->lsp->incremental_sync) {
|
if (editor->lsp->incremental_sync) {
|
||||||
json message = {
|
json message = {
|
||||||
@@ -125,7 +125,7 @@ void edit_erase(Editor *editor, Coord pos, int64_t len) {
|
|||||||
editor->root = erase(editor->root, byte_pos, end - byte_pos);
|
editor->root = erase(editor->root, byte_pos, end - byte_pos);
|
||||||
lock_2.unlock();
|
lock_2.unlock();
|
||||||
if (editor->parser)
|
if (editor->parser)
|
||||||
editor->parser->edit(start_row, end_row, 0);
|
editor->parser->edit(start_row, end_row - start_row, 0);
|
||||||
if (do_lsp) {
|
if (do_lsp) {
|
||||||
if (editor->lsp->incremental_sync) {
|
if (editor->lsp->incremental_sync) {
|
||||||
json message = {
|
json message = {
|
||||||
@@ -184,7 +184,7 @@ void edit_insert(Editor *editor, Coord pos, char *data, uint32_t len) {
|
|||||||
apply_hook_insertion(editor, pos.row, rows);
|
apply_hook_insertion(editor, pos.row, rows);
|
||||||
lock_2.unlock();
|
lock_2.unlock();
|
||||||
if (editor->parser)
|
if (editor->parser)
|
||||||
editor->parser->edit(pos.row, pos.row, rows);
|
editor->parser->edit(pos.row, 0, rows);
|
||||||
if (editor->lsp) {
|
if (editor->lsp) {
|
||||||
if (editor->lsp->incremental_sync) {
|
if (editor->lsp->incremental_sync) {
|
||||||
json message = {
|
json message = {
|
||||||
@@ -245,8 +245,10 @@ void edit_replace(Editor *editor, Coord start, Coord end, const char *text,
|
|||||||
for (uint32_t i = 0; i < len; i++)
|
for (uint32_t i = 0; i < len; i++)
|
||||||
if (text[i] == '\n')
|
if (text[i] == '\n')
|
||||||
rows++;
|
rows++;
|
||||||
|
if (rows > 0)
|
||||||
|
rows--;
|
||||||
if (editor->parser)
|
if (editor->parser)
|
||||||
editor->parser->edit(start.row, end.row - 1, rows);
|
editor->parser->edit(start.row, end.row - start.row, rows);
|
||||||
if (editor->lsp) {
|
if (editor->lsp) {
|
||||||
if (editor->lsp->incremental_sync) {
|
if (editor->lsp->incremental_sync) {
|
||||||
json message = {
|
json message = {
|
||||||
|
|||||||
@@ -97,9 +97,8 @@ void save_file(Editor *editor) {
|
|||||||
{"trimFinalNewlines", true}}}}}};
|
{"trimFinalNewlines", true}}}}}};
|
||||||
LSPPending *pending = new LSPPending();
|
LSPPending *pending = new LSPPending();
|
||||||
pending->editor = editor;
|
pending->editor = editor;
|
||||||
pending->method = "textDocument/formatting";
|
pending->callback = [save_msg, version](Editor *editor,
|
||||||
pending->callback = [save_msg, version](Editor *editor, std::string,
|
const json &message) {
|
||||||
json message) {
|
|
||||||
if (version != editor->lsp_version)
|
if (version != editor->lsp_version)
|
||||||
return;
|
return;
|
||||||
auto &edits = message["result"];
|
auto &edits = message["result"];
|
||||||
|
|||||||
@@ -153,8 +153,7 @@ void handle_editor_event(Editor *editor, KeyEvent event) {
|
|||||||
if (event.key_type == KEY_CHAR) {
|
if (event.key_type == KEY_CHAR) {
|
||||||
if (event.len == 1) {
|
if (event.len == 1) {
|
||||||
if (event.c[0] == '\t') {
|
if (event.c[0] == '\t') {
|
||||||
edit_insert(editor, editor->cursor, (char *)" ", 2);
|
editor->indents.insert_tab(editor->cursor);
|
||||||
cursor_right(editor, 2);
|
|
||||||
} else if (event.c[0] == '\n' || event.c[0] == '\r') {
|
} else if (event.c[0] == '\n' || event.c[0] == '\r') {
|
||||||
editor->indents.insert_new_line(editor->cursor);
|
editor->indents.insert_new_line(editor->cursor);
|
||||||
} else if (event.c[0] == CTRL('W')) {
|
} else if (event.c[0] == CTRL('W')) {
|
||||||
@@ -205,6 +204,14 @@ void handle_editor_event(Editor *editor, KeyEvent event) {
|
|||||||
paste(editor);
|
paste(editor);
|
||||||
mode = NORMAL;
|
mode = NORMAL;
|
||||||
break;
|
break;
|
||||||
|
case '<':
|
||||||
|
case ',':
|
||||||
|
dedent_selection(editor);
|
||||||
|
break;
|
||||||
|
case '>':
|
||||||
|
case '.':
|
||||||
|
indent_selection(editor);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -4,14 +4,20 @@
|
|||||||
#include "lsp/lsp.h"
|
#include "lsp/lsp.h"
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "utils/utils.h"
|
#include "utils/utils.h"
|
||||||
|
#include <sys/types.h>
|
||||||
|
|
||||||
void cut(Editor *editor) {
|
void cut(Editor *editor) {
|
||||||
|
if (ABS((int64_t)editor->cursor.row - (int64_t)editor->selection.row) >
|
||||||
|
1500) {
|
||||||
|
bar.log("Selection too large!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (mode != SELECT)
|
if (mode != SELECT)
|
||||||
return;
|
return;
|
||||||
Coord start;
|
Coord start;
|
||||||
uint32_t len;
|
uint32_t len;
|
||||||
char *text = get_selection(editor, &len, &start);
|
char *text = get_selection(editor, &len, &start);
|
||||||
copy_to_clipboard(text, len);
|
ruby_copy(text, len);
|
||||||
len = count_clusters(text, len, 0, len);
|
len = count_clusters(text, len, 0, len);
|
||||||
edit_erase(editor, start, len);
|
edit_erase(editor, start, len);
|
||||||
free(text);
|
free(text);
|
||||||
@@ -19,26 +25,29 @@ void cut(Editor *editor) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void copy(Editor *editor) {
|
void copy(Editor *editor) {
|
||||||
|
if (ABS((int64_t)editor->cursor.row - (int64_t)editor->selection.row) >
|
||||||
|
1500) {
|
||||||
|
bar.log("Selection too large!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (mode != SELECT)
|
if (mode != SELECT)
|
||||||
return;
|
return;
|
||||||
uint32_t len;
|
uint32_t len;
|
||||||
char *text = get_selection(editor, &len, nullptr);
|
char *text = get_selection(editor, &len, nullptr);
|
||||||
copy_to_clipboard(text, len);
|
ruby_copy(text, len);
|
||||||
free(text);
|
free(text);
|
||||||
editor->selection_active = false;
|
editor->selection_active = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void paste(Editor *editor) {
|
void paste(Editor *editor) {
|
||||||
uint32_t len;
|
|
||||||
if (mode == NORMAL) {
|
if (mode == NORMAL) {
|
||||||
char *text = get_from_clipboard(&len);
|
std::string text = ruby_paste();
|
||||||
if (text) {
|
if (text.empty())
|
||||||
insert_str(editor, text, len);
|
return;
|
||||||
free(text);
|
insert_str(editor, (char *)text.c_str(), text.length());
|
||||||
}
|
|
||||||
} else if (mode == SELECT) {
|
} else if (mode == SELECT) {
|
||||||
char *text = get_from_clipboard(&len);
|
std::string text = ruby_paste();
|
||||||
if (text) {
|
if (!text.empty()) {
|
||||||
Coord start, end;
|
Coord start, end;
|
||||||
selection_bounds(editor, &start, &end);
|
selection_bounds(editor, &start, &end);
|
||||||
uint32_t start_byte =
|
uint32_t start_byte =
|
||||||
@@ -46,8 +55,7 @@ void paste(Editor *editor) {
|
|||||||
uint32_t end_byte =
|
uint32_t end_byte =
|
||||||
line_to_byte(editor->root, end.row, nullptr) + end.col;
|
line_to_byte(editor->root, end.row, nullptr) + end.col;
|
||||||
edit_erase(editor, start, end_byte - start_byte);
|
edit_erase(editor, start, end_byte - start_byte);
|
||||||
edit_insert(editor, editor->cursor, text, len);
|
edit_insert(editor, editor->cursor, (char *)text.c_str(), text.length());
|
||||||
free(text);
|
|
||||||
}
|
}
|
||||||
editor->selection_active = false;
|
editor->selection_active = false;
|
||||||
}
|
}
|
||||||
@@ -75,6 +83,53 @@ void dedent_current_line(Editor *editor) {
|
|||||||
editor->cursor.row = start.row;
|
editor->cursor.row = start.row;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void move_coord_by_delta(Coord &c, uint32_t row, int64_t delta) {
|
||||||
|
if (c.row == row) {
|
||||||
|
int64_t new_col = (int64_t)c.col + delta;
|
||||||
|
c.col = (uint32_t)MAX(new_col, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void indent_selection(Editor *editor) {
|
||||||
|
uint32_t top = MIN(editor->cursor.row, editor->selection.row);
|
||||||
|
uint32_t bot = MAX(editor->cursor.row, editor->selection.row);
|
||||||
|
if (bot - top > 1500) {
|
||||||
|
bar.log("Can't indent more than 1500 lines at once!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (bot - top >= 2)
|
||||||
|
editor->indents.indent_block(top + 1, bot - 1);
|
||||||
|
uint32_t delta_top = editor->indents.indent_line(top);
|
||||||
|
uint32_t delta_bot =
|
||||||
|
(bot == top) ? delta_top : editor->indents.indent_line(bot);
|
||||||
|
move_coord_by_delta(editor->cursor, top, delta_top);
|
||||||
|
move_coord_by_delta(editor->selection, top, delta_top);
|
||||||
|
if (bot != top) {
|
||||||
|
move_coord_by_delta(editor->cursor, bot, delta_bot);
|
||||||
|
move_coord_by_delta(editor->selection, bot, delta_bot);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void dedent_selection(Editor *editor) {
|
||||||
|
uint32_t top = MIN(editor->cursor.row, editor->selection.row);
|
||||||
|
uint32_t bot = MAX(editor->cursor.row, editor->selection.row);
|
||||||
|
if (bot - top > 1500) {
|
||||||
|
bar.log("Can't dedent more than 1500 lines at once!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (bot - top >= 2)
|
||||||
|
editor->indents.dedent_block(top + 1, bot - 1);
|
||||||
|
uint32_t delta_top = editor->indents.dedent_line(top);
|
||||||
|
uint32_t delta_bot =
|
||||||
|
(bot == top) ? delta_top : editor->indents.dedent_line(bot);
|
||||||
|
move_coord_by_delta(editor->cursor, top, -(int64_t)delta_top);
|
||||||
|
move_coord_by_delta(editor->selection, top, -(int64_t)delta_top);
|
||||||
|
if (bot != top) {
|
||||||
|
move_coord_by_delta(editor->cursor, bot, -(int64_t)delta_bot);
|
||||||
|
move_coord_by_delta(editor->selection, bot, -(int64_t)delta_bot);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void insert_char(Editor *editor, char c) {
|
void insert_char(Editor *editor, char c) {
|
||||||
uint32_t col = editor->cursor.col;
|
uint32_t col = editor->cursor.col;
|
||||||
LineIterator *it = begin_l_iter(editor->root, editor->cursor.row);
|
LineIterator *it = begin_l_iter(editor->root, editor->cursor.row);
|
||||||
@@ -158,9 +213,7 @@ void insert_char(Editor *editor, char c) {
|
|||||||
{"trimFinalNewlines", true}}}}}};
|
{"trimFinalNewlines", true}}}}}};
|
||||||
LSPPending *pending = new LSPPending();
|
LSPPending *pending = new LSPPending();
|
||||||
pending->editor = editor;
|
pending->editor = editor;
|
||||||
pending->method = "textDocument/onTypeFormatting";
|
pending->callback = [version](Editor *editor, const json &message) {
|
||||||
pending->callback = [version](Editor *editor, std::string,
|
|
||||||
json message) {
|
|
||||||
if (version != editor->lsp_version)
|
if (version != editor->lsp_version)
|
||||||
return;
|
return;
|
||||||
auto &edits = message["result"];
|
auto &edits = message["result"];
|
||||||
@@ -204,11 +257,32 @@ void backspace_edit(Editor *editor) {
|
|||||||
LineIterator *it = begin_l_iter(editor->root, editor->cursor.row);
|
LineIterator *it = begin_l_iter(editor->root, editor->cursor.row);
|
||||||
if (!it)
|
if (!it)
|
||||||
return;
|
return;
|
||||||
char *line = next_line(it, nullptr);
|
uint32_t len;
|
||||||
char prev_char = line[prev_pos.col];
|
char *line = next_line(it, &len);
|
||||||
char next_char = line[editor->cursor.col];
|
if (!line) {
|
||||||
free(it->buffer);
|
free(it->buffer);
|
||||||
free(it);
|
free(it);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (len > 0 && line[len - 1] == '\n')
|
||||||
|
--len;
|
||||||
|
char prev_char = (prev_pos.col < len) ? line[prev_pos.col] : 0;
|
||||||
|
char next_char = (editor->cursor.col < len) ? line[editor->cursor.col] : 0;
|
||||||
|
bool before_content = false;
|
||||||
|
if (editor->cursor.col > 0) {
|
||||||
|
before_content = true;
|
||||||
|
for (uint32_t i = 0; i < editor->cursor.col; i++)
|
||||||
|
if (line[i] != ' ' && line[i] != '\t') {
|
||||||
|
before_content = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
free(it->buffer);
|
||||||
|
free(it);
|
||||||
|
if (before_content) {
|
||||||
|
dedent_current_line(editor);
|
||||||
|
return;
|
||||||
|
}
|
||||||
bool is_pair = (prev_char == '{' && next_char == '}') ||
|
bool is_pair = (prev_char == '{' && next_char == '}') ||
|
||||||
(prev_char == '(' && next_char == ')') ||
|
(prev_char == '(' && next_char == ')') ||
|
||||||
(prev_char == '[' && next_char == ']') ||
|
(prev_char == '[' && next_char == ']') ||
|
||||||
@@ -315,8 +389,7 @@ void fetch_lsp_hover(Editor *editor) {
|
|||||||
{"position", {{"line", editor->cursor.row}, {"character", col}}}}}};
|
{"position", {{"line", editor->cursor.row}, {"character", col}}}}}};
|
||||||
LSPPending *pending = new LSPPending();
|
LSPPending *pending = new LSPPending();
|
||||||
pending->editor = editor;
|
pending->editor = editor;
|
||||||
pending->method = "textDocument/hover";
|
pending->callback = [](Editor *editor, const json &hover) {
|
||||||
pending->callback = [](Editor *editor, std::string, json hover) {
|
|
||||||
if (hover.contains("result") && !hover["result"].is_null()) {
|
if (hover.contains("result") && !hover["result"].is_null()) {
|
||||||
auto &contents = hover["result"]["contents"];
|
auto &contents = hover["result"]["contents"];
|
||||||
std::string hover_text = "";
|
std::string hover_text = "";
|
||||||
|
|||||||
@@ -38,6 +38,18 @@ void IndentationEngine::compute_indent(Editor *n_editor) {
|
|||||||
indent = 2;
|
indent = 2;
|
||||||
free(it->buffer);
|
free(it->buffer);
|
||||||
free(it);
|
free(it);
|
||||||
|
auto x = kLangtoBlockStartsEnd.find(editor->lang.name);
|
||||||
|
if (x != kLangtoBlockStartsEnd.end())
|
||||||
|
start_end = &x->second;
|
||||||
|
x = kLangtoBlockStartsStart.find(editor->lang.name);
|
||||||
|
if (x != kLangtoBlockStartsStart.end())
|
||||||
|
start_start = &x->second;
|
||||||
|
x = kLangtoBlockEndsFull.find(editor->lang.name);
|
||||||
|
if (x != kLangtoBlockEndsFull.end())
|
||||||
|
end_full = &x->second;
|
||||||
|
x = kLangtoBlockEndsStart.find(editor->lang.name);
|
||||||
|
if (x != kLangtoBlockEndsStart.end())
|
||||||
|
end_start = &x->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t IndentationEngine::indent_real(char *line, uint32_t len) {
|
uint32_t IndentationEngine::indent_real(char *line, uint32_t len) {
|
||||||
@@ -75,18 +87,16 @@ uint32_t IndentationEngine::indent_expected(uint32_t row) {
|
|||||||
if (len == 0)
|
if (len == 0)
|
||||||
continue;
|
continue;
|
||||||
c_indent = indent_real(line, len);
|
c_indent = indent_real(line, len);
|
||||||
auto is_end_set = kLangtoBlockStartsEnd.find(editor->lang.name);
|
|
||||||
auto is_start_set = kLangtoBlockStartsStart.find(editor->lang.name);
|
|
||||||
bool is_end = false;
|
bool is_end = false;
|
||||||
if (is_end_set != kLangtoBlockStartsEnd.end())
|
if (start_end)
|
||||||
for (auto end : is_end_set->second)
|
for (auto end : *start_end)
|
||||||
if (ends_with(line, end)) {
|
if (ends_with(line, end)) {
|
||||||
c_indent++;
|
c_indent++;
|
||||||
is_end = true;
|
is_end = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!is_end && is_start_set != kLangtoBlockStartsStart.end())
|
if (!is_end && start_start)
|
||||||
for (auto end : is_start_set->second)
|
for (auto end : *start_start)
|
||||||
if (starts_with(line, end)) {
|
if (starts_with(line, end)) {
|
||||||
c_indent++;
|
c_indent++;
|
||||||
break;
|
break;
|
||||||
@@ -195,6 +205,100 @@ uint32_t IndentationEngine::dedent_line(uint32_t row) {
|
|||||||
return (uint32_t)ABS((int64_t)ws_len - (new_indent * indent));
|
return (uint32_t)ABS((int64_t)ws_len - (new_indent * indent));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void IndentationEngine::indent_block(uint32_t start_row, uint32_t end_row) {
|
||||||
|
indent_block(start_row, end_row, +1);
|
||||||
|
}
|
||||||
|
|
||||||
|
void IndentationEngine::dedent_block(uint32_t start_row, uint32_t end_row) {
|
||||||
|
indent_block(start_row, end_row, -1);
|
||||||
|
}
|
||||||
|
|
||||||
|
void IndentationEngine::indent_block(uint32_t start_row, uint32_t end_row,
|
||||||
|
int delta) {
|
||||||
|
if (start_row > end_row)
|
||||||
|
std::swap(start_row, end_row);
|
||||||
|
uint32_t start_len, end_len;
|
||||||
|
uint32_t start_off = line_to_byte(editor->root, start_row, &start_len);
|
||||||
|
uint32_t end_off = line_to_byte(editor->root, end_row, &end_len);
|
||||||
|
uint32_t total_len = (end_off - start_off) + end_len;
|
||||||
|
char *block = read(editor->root, start_off, total_len);
|
||||||
|
if (!block)
|
||||||
|
return;
|
||||||
|
uint32_t cap = total_len + 128;
|
||||||
|
char *out = (char *)malloc(cap);
|
||||||
|
uint32_t out_len = 0;
|
||||||
|
char *p = block;
|
||||||
|
char *end = block + total_len;
|
||||||
|
while (p < end) {
|
||||||
|
char *line_start = p;
|
||||||
|
while (p < end && *p != '\n')
|
||||||
|
p++;
|
||||||
|
uint32_t len = (uint32_t)(p - line_start);
|
||||||
|
uint32_t ws = 0;
|
||||||
|
while (ws < len && (line_start[ws] == ' ' || line_start[ws] == '\t'))
|
||||||
|
ws++;
|
||||||
|
uint32_t real_indent = indent_real(line_start, len);
|
||||||
|
int64_t new_indent = (int64_t)real_indent + delta;
|
||||||
|
if (new_indent < 0)
|
||||||
|
new_indent = 0;
|
||||||
|
uint32_t indent_chars = (indent == 1) ? new_indent : new_indent * indent;
|
||||||
|
uint32_t new_line_len = indent_chars + (len - ws);
|
||||||
|
if (out_len + new_line_len + 2 >= cap) {
|
||||||
|
cap = (cap * 2) + new_line_len + 32;
|
||||||
|
out = (char *)realloc(out, cap);
|
||||||
|
}
|
||||||
|
if (indent == 1) {
|
||||||
|
memset(out + out_len, '\t', indent_chars);
|
||||||
|
out_len += indent_chars;
|
||||||
|
} else {
|
||||||
|
memset(out + out_len, ' ', indent_chars);
|
||||||
|
out_len += indent_chars;
|
||||||
|
}
|
||||||
|
memcpy(out + out_len, line_start + ws, len - ws);
|
||||||
|
out_len += (len - ws);
|
||||||
|
if (p < end && *p == '\n') {
|
||||||
|
out[out_len++] = '\n';
|
||||||
|
p++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
free(block);
|
||||||
|
edit_replace(editor, {start_row, 0}, {end_row, end_len}, out, out_len);
|
||||||
|
free(out);
|
||||||
|
}
|
||||||
|
|
||||||
|
void IndentationEngine::insert_tab(Coord cursor) {
|
||||||
|
std::shared_lock lock(editor->knot_mtx);
|
||||||
|
LineIterator *it = begin_l_iter(editor->root, cursor.row);
|
||||||
|
if (!it)
|
||||||
|
return;
|
||||||
|
uint32_t len;
|
||||||
|
char *line = next_line(it, &len);
|
||||||
|
if (!line) {
|
||||||
|
free(it->buffer);
|
||||||
|
free(it);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
lock.unlock();
|
||||||
|
if (len > 0 && line[len - 1] == '\n')
|
||||||
|
--len;
|
||||||
|
uint32_t ws_len = 0;
|
||||||
|
while (ws_len < len && (line[ws_len] == ' ' || line[ws_len] == '\t'))
|
||||||
|
ws_len++;
|
||||||
|
std::string insert;
|
||||||
|
if (cursor.col <= ws_len) {
|
||||||
|
if (indent == 1)
|
||||||
|
insert = "\t";
|
||||||
|
else
|
||||||
|
insert.assign(indent - ((cursor.col) % indent), ' ');
|
||||||
|
} else {
|
||||||
|
insert = "\t";
|
||||||
|
}
|
||||||
|
free(it->buffer);
|
||||||
|
free(it);
|
||||||
|
edit_insert(editor, cursor, (char *)insert.c_str(), insert.size());
|
||||||
|
editor->cursor.col += insert.size();
|
||||||
|
}
|
||||||
|
|
||||||
void IndentationEngine::insert_new_line(Coord cursor) {
|
void IndentationEngine::insert_new_line(Coord cursor) {
|
||||||
std::string formatted;
|
std::string formatted;
|
||||||
std::shared_lock lock(editor->knot_mtx);
|
std::shared_lock lock(editor->knot_mtx);
|
||||||
@@ -212,22 +316,20 @@ void IndentationEngine::insert_new_line(Coord cursor) {
|
|||||||
if (len > 0 && line[len - 1] == '\n')
|
if (len > 0 && line[len - 1] == '\n')
|
||||||
--len;
|
--len;
|
||||||
if (cursor.col >= len) {
|
if (cursor.col >= len) {
|
||||||
auto is_end_full = kLangtoBlockEndsFull.find(editor->lang.name);
|
|
||||||
auto is_end_start = kLangtoBlockEndsStart.find(editor->lang.name);
|
|
||||||
bool end_matched = false;
|
bool end_matched = false;
|
||||||
if (is_end_full != kLangtoBlockEndsFull.end())
|
if (end_full)
|
||||||
for (auto end : is_end_full->second)
|
for (auto end : *end_full)
|
||||||
if (end == trim(line)) {
|
if (end == trim(line)) {
|
||||||
cursor.col = set_indent(
|
cursor.col = set_indent(
|
||||||
cursor.row, (int64_t)indent_expected(cursor.row) - (int64_t)1);
|
cursor.row, (int64_t)indent_expected(cursor.row) - (int64_t)1);
|
||||||
end_matched = true;
|
end_matched = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!end_matched && is_end_start != kLangtoBlockEndsStart.end())
|
if (!end_matched && end_start)
|
||||||
for (auto end : is_end_start->second)
|
for (auto end : *end_start)
|
||||||
if (starts_with(trim(line), end)) {
|
if (starts_with(trim(line), end)) {
|
||||||
cursor.col =
|
cursor.col = set_indent(
|
||||||
set_indent(cursor.row, (int64_t)indent_expected(cursor.row) - 1);
|
cursor.row, (int64_t)indent_expected(cursor.row) - (int64_t)1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
lock.lock();
|
lock.lock();
|
||||||
@@ -248,37 +350,32 @@ void IndentationEngine::insert_new_line(Coord cursor) {
|
|||||||
}
|
}
|
||||||
std::string ending = trim(std::string(line + cursor.col, len - cursor.col));
|
std::string ending = trim(std::string(line + cursor.col, len - cursor.col));
|
||||||
std::string before = trim(std::string(line, cursor.col));
|
std::string before = trim(std::string(line, cursor.col));
|
||||||
uint32_t c_indent = indent_real(line, len);
|
int64_t c_indent = indent_real(line, len);
|
||||||
if (!ending.empty()) {
|
if (!ending.empty()) {
|
||||||
bool ending_valid = false;
|
bool ending_valid = false;
|
||||||
bool starting_valid = false;
|
bool starting_valid = false;
|
||||||
auto is_end_full = kLangtoBlockEndsFull.find(editor->lang.name);
|
if (end_full)
|
||||||
auto is_end_start = kLangtoBlockEndsStart.find(editor->lang.name);
|
for (auto end : *end_full)
|
||||||
auto is_end_set = kLangtoBlockStartsEnd.find(editor->lang.name);
|
|
||||||
auto is_start_set = kLangtoBlockStartsStart.find(editor->lang.name);
|
|
||||||
if (is_end_full != kLangtoBlockEndsFull.end())
|
|
||||||
for (auto end : is_end_full->second)
|
|
||||||
if (ending == end) {
|
if (ending == end) {
|
||||||
ending_valid = true;
|
ending_valid = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!ending_valid && is_end_start != kLangtoBlockEndsStart.end())
|
if (!ending_valid && end_start)
|
||||||
for (auto end : is_end_start->second)
|
for (auto end : *end_start)
|
||||||
if (starts_with(ending, end)) {
|
if (starts_with(ending, end)) {
|
||||||
ending_valid = true;
|
ending_valid = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (is_end_set != kLangtoBlockStartsEnd.end())
|
if (start_end)
|
||||||
for (auto end : is_end_set->second)
|
for (auto end : *start_end)
|
||||||
if (ends_with(before, end)) {
|
if (ends_with(before, end)) {
|
||||||
c_indent++;
|
|
||||||
starting_valid = true;
|
starting_valid = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!starting_valid && is_start_set != kLangtoBlockStartsStart.end())
|
if (!starting_valid && start_start)
|
||||||
for (auto end : is_start_set->second)
|
for (auto end : *start_start)
|
||||||
if (starts_with(before, end)) {
|
if (starts_with(before, end)) {
|
||||||
c_indent++;
|
starting_valid = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (ending_valid && starting_valid)
|
if (ending_valid && starting_valid)
|
||||||
@@ -286,30 +383,30 @@ void IndentationEngine::insert_new_line(Coord cursor) {
|
|||||||
(indent == 1 ? std::string(c_indent, '\t')
|
(indent == 1 ? std::string(c_indent, '\t')
|
||||||
: std::string(c_indent * indent, ' ')) +
|
: std::string(c_indent * indent, ' ')) +
|
||||||
ending;
|
ending;
|
||||||
else if (ending_valid && c_indent)
|
else if (ending_valid)
|
||||||
c_indent--;
|
c_indent--;
|
||||||
}
|
}
|
||||||
auto is_end_set = kLangtoBlockStartsEnd.find(editor->lang.name);
|
|
||||||
auto is_start_set = kLangtoBlockStartsStart.find(editor->lang.name);
|
|
||||||
bool is_end = false;
|
bool is_end = false;
|
||||||
if (is_end_set != kLangtoBlockStartsEnd.end())
|
if (start_end)
|
||||||
for (auto end : is_end_set->second)
|
for (auto end : *start_end)
|
||||||
if (ends_with(before, end)) {
|
if (ends_with(before, end)) {
|
||||||
c_indent++;
|
c_indent++;
|
||||||
is_end = true;
|
is_end = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!is_end && is_start_set != kLangtoBlockStartsStart.end())
|
if (!is_end && start_start)
|
||||||
for (auto end : is_start_set->second)
|
for (auto end : *start_start)
|
||||||
if (starts_with(before, end)) {
|
if (starts_with(before, end)) {
|
||||||
c_indent++;
|
c_indent++;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if (c_indent < 0)
|
||||||
|
c_indent = 0;
|
||||||
formatted = "\n" +
|
formatted = "\n" +
|
||||||
(indent == 1 ? std::string(c_indent, '\t')
|
(indent == 1 ? std::string(c_indent, '\t')
|
||||||
: std::string(c_indent * indent, ' ')) +
|
: std::string(c_indent * indent, ' ')) +
|
||||||
ending;
|
ending;
|
||||||
Coord new_cursor = {cursor.row + 1, c_indent * indent};
|
Coord new_cursor = {cursor.row + 1, (uint32_t)c_indent * indent};
|
||||||
edit_replace(editor, cursor, {cursor.row, len}, formatted.data(),
|
edit_replace(editor, cursor, {cursor.row, len}, formatted.data(),
|
||||||
formatted.size());
|
formatted.size());
|
||||||
editor->cursor = new_cursor;
|
editor->cursor = new_cursor;
|
||||||
@@ -348,8 +445,7 @@ void IndentationEngine::insert_new_line(Coord cursor) {
|
|||||||
{"trimFinalNewlines", true}}}}}};
|
{"trimFinalNewlines", true}}}}}};
|
||||||
LSPPending *pending = new LSPPending();
|
LSPPending *pending = new LSPPending();
|
||||||
pending->editor = editor;
|
pending->editor = editor;
|
||||||
pending->method = "textDocument/onTypeFormatting";
|
pending->callback = [version](Editor *editor, const json &message) {
|
||||||
pending->callback = [version](Editor *editor, std::string, json message) {
|
|
||||||
if (version != editor->lsp_version)
|
if (version != editor->lsp_version)
|
||||||
return;
|
return;
|
||||||
auto &edits = message["result"];
|
auto &edits = message["result"];
|
||||||
|
|||||||
@@ -25,9 +25,6 @@ void render_editor(Editor *editor) {
|
|||||||
while (warn_it != editor->warnings.end() &&
|
while (warn_it != editor->warnings.end() &&
|
||||||
warn_it->line < editor->scroll.row)
|
warn_it->line < editor->scroll.row)
|
||||||
++warn_it;
|
++warn_it;
|
||||||
std::unique_lock<std::mutex> lock;
|
|
||||||
if (editor->parser)
|
|
||||||
lock = std::unique_lock<std::mutex>(editor->parser->mutex);
|
|
||||||
LineData *line_data = nullptr;
|
LineData *line_data = nullptr;
|
||||||
auto get_type = [&](uint32_t col) {
|
auto get_type = [&](uint32_t col) {
|
||||||
if (!line_data)
|
if (!line_data)
|
||||||
@@ -450,8 +447,6 @@ void render_editor(Editor *editor) {
|
|||||||
global_byte_offset += line_len + 1;
|
global_byte_offset += line_len + 1;
|
||||||
line_index++;
|
line_index++;
|
||||||
}
|
}
|
||||||
if (lock.owns_lock())
|
|
||||||
lock.unlock();
|
|
||||||
while (rendered_rows < editor->size.row) {
|
while (rendered_rows < editor->size.row) {
|
||||||
for (uint32_t col = 0; col < editor->size.col; col++)
|
for (uint32_t col = 0; col < editor->size.col; col++)
|
||||||
update(editor->position.row + rendered_rows, editor->position.col + col,
|
update(editor->position.row + rendered_rows, editor->position.col + col,
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
#include "lsp/lsp.h"
|
#include "lsp/lsp.h"
|
||||||
#include "main.h"
|
|
||||||
|
|
||||||
Queue<LSPOpenRequest> lsp_open_queue;
|
Queue<LSPOpenRequest> lsp_open_queue;
|
||||||
|
|
||||||
|
|||||||
@@ -53,9 +53,8 @@ std::shared_ptr<LSPInstance> get_or_init_lsp(std::string lsp_id) {
|
|||||||
if (!init_lsp(lsp))
|
if (!init_lsp(lsp))
|
||||||
return nullptr;
|
return nullptr;
|
||||||
LSPPending *pending = new LSPPending();
|
LSPPending *pending = new LSPPending();
|
||||||
pending->method = "initialize";
|
|
||||||
pending->editor = nullptr;
|
pending->editor = nullptr;
|
||||||
pending->callback = [lsp, lsp_id](Editor *, std::string, json msg) {
|
pending->callback = [lsp, lsp_id](Editor *, const json &msg) {
|
||||||
if (msg.contains("result") && msg["result"].contains("capabilities")) {
|
if (msg.contains("result") && msg["result"].contains("capabilities")) {
|
||||||
auto &caps = msg["result"]["capabilities"];
|
auto &caps = msg["result"]["capabilities"];
|
||||||
// if (caps.contains("positionEncoding")) {
|
// if (caps.contains("positionEncoding")) {
|
||||||
|
|||||||
@@ -143,7 +143,7 @@ void lsp_worker() {
|
|||||||
LSPPending *pend = it->second;
|
LSPPending *pend = it->second;
|
||||||
lock.unlock();
|
lock.unlock();
|
||||||
if (pend->callback)
|
if (pend->callback)
|
||||||
pend->callback(pend->editor, pend->method, *msg);
|
pend->callback(pend->editor, *msg);
|
||||||
delete pend;
|
delete pend;
|
||||||
lock.lock();
|
lock.lock();
|
||||||
lsp->pending.erase(it);
|
lsp->pending.erase(it);
|
||||||
|
|||||||
60
src/main.cc
60
src/main.cc
@@ -37,7 +37,30 @@ inline uint8_t index_of(Editor *ed) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void input_listener() {
|
int main(int argc, char *argv[]) {
|
||||||
|
ruby_start();
|
||||||
|
load_theme();
|
||||||
|
load_languages_info();
|
||||||
|
load_custom_highlighters();
|
||||||
|
|
||||||
|
Coord screen = start_screen();
|
||||||
|
const char *filename = (argc > 1) ? argv[1] : "";
|
||||||
|
uint8_t eol = read_line_endings();
|
||||||
|
Editor *editor =
|
||||||
|
new_editor(filename, {0, 0}, {screen.row - 2, screen.col}, eol);
|
||||||
|
bar.init(screen);
|
||||||
|
|
||||||
|
if (!editor) {
|
||||||
|
end_screen();
|
||||||
|
fprintf(stderr, "Failed to load editor\n");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
editors.push_back(editor);
|
||||||
|
current_editor = editors.size() - 1;
|
||||||
|
|
||||||
|
std::thread lsp_thread(background_lsp);
|
||||||
|
|
||||||
while (running) {
|
while (running) {
|
||||||
KeyEvent event = throttle(1ms, read_key);
|
KeyEvent event = throttle(1ms, read_key);
|
||||||
if (event.key_type == KEY_NONE)
|
if (event.key_type == KEY_NONE)
|
||||||
@@ -67,44 +90,11 @@ void input_listener() {
|
|||||||
if ((event.key_type == KEY_CHAR || event.key_type == KEY_PASTE) && event.c)
|
if ((event.key_type == KEY_CHAR || event.key_type == KEY_PASTE) && event.c)
|
||||||
free(event.c);
|
free(event.c);
|
||||||
render:
|
render:
|
||||||
|
throttle(4ms, editor_worker, editors[current_editor]);
|
||||||
bar.render();
|
bar.render();
|
||||||
render_editor(editors[current_editor]);
|
render_editor(editors[current_editor]);
|
||||||
throttle(4ms, render);
|
throttle(4ms, render);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
int main(int argc, char *argv[]) {
|
|
||||||
ruby_start();
|
|
||||||
load_theme();
|
|
||||||
load_languages_info();
|
|
||||||
load_custom_highlighters();
|
|
||||||
|
|
||||||
Coord screen = start_screen();
|
|
||||||
const char *filename = (argc > 1) ? argv[1] : "";
|
|
||||||
uint8_t eol = read_line_endings();
|
|
||||||
Editor *editor =
|
|
||||||
new_editor(filename, {0, 0}, {screen.row - 2, screen.col}, eol);
|
|
||||||
bar.init(screen);
|
|
||||||
|
|
||||||
if (!editor) {
|
|
||||||
end_screen();
|
|
||||||
fprintf(stderr, "Failed to load editor\n");
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
editors.push_back(editor);
|
|
||||||
current_editor = editors.size() - 1;
|
|
||||||
|
|
||||||
std::thread input_thread(input_listener);
|
|
||||||
std::thread lsp_thread(background_lsp);
|
|
||||||
|
|
||||||
while (running) {
|
|
||||||
throttle(16ms, editor_worker, editors[current_editor]);
|
|
||||||
bar.work();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (input_thread.joinable())
|
|
||||||
input_thread.join();
|
|
||||||
|
|
||||||
if (lsp_thread.joinable())
|
if (lsp_thread.joinable())
|
||||||
lsp_thread.join();
|
lsp_thread.join();
|
||||||
|
|||||||
@@ -19,14 +19,29 @@ while read -r line; do
|
|||||||
fi
|
fi
|
||||||
done <"$INPUT"
|
done <"$INPUT"
|
||||||
|
|
||||||
|
OS="$(uname -s)"
|
||||||
|
OS_TYPE="unknown"
|
||||||
|
|
||||||
|
case "$OS" in
|
||||||
|
Linux*)
|
||||||
|
OS_TYPE="linux"
|
||||||
|
;;
|
||||||
|
Darwin*)
|
||||||
|
OS_TYPE="mac"
|
||||||
|
;;
|
||||||
|
CYGWIN* | MINGW* | MSYS*)
|
||||||
|
OS_TYPE="windows"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
{
|
{
|
||||||
echo " freeze"
|
echo " freeze"
|
||||||
echo "end"
|
echo "end"
|
||||||
echo
|
echo
|
||||||
cat "$SCRIPT_DIR/../include/scripting/libcrib.rb"
|
cat "$SCRIPT_DIR/../include/scripting/libcrib.rb" | sed "s/os_name_placed_here/$OS_TYPE/g"
|
||||||
} >>"$TMP"
|
} >>"$TMP"
|
||||||
|
|
||||||
mrbc -o$OUTPUT $TMP
|
"$SCRIPT_DIR/../libs/mruby/bin/mrbc" -o$OUTPUT $TMP
|
||||||
|
|
||||||
{
|
{
|
||||||
echo "#pragma once"
|
echo "#pragma once"
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
#include "main.h"
|
|
||||||
#include "scripting/decl.h"
|
#include "scripting/decl.h"
|
||||||
|
|
||||||
mrb_value get_mode(mrb_state *mrb, mrb_value self) {
|
mrb_value get_config_file(mrb_state *mrb, mrb_value self) {
|
||||||
return mrb_fixnum_value(mode);
|
return mrb_str_new_cstr(mrb, ruby_config_path.string().c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
void setup_ruby_bindings(mrb_state *mrb, RClass *C_module) {
|
void setup_ruby_bindings(mrb_state *mrb, RClass *C_module) {
|
||||||
mrb_define_module_function(mrb, C_module, "mode", get_mode, MRB_ARGS_NONE());
|
mrb_define_module_function(mrb, C_module, "config_file", get_config_file,
|
||||||
|
MRB_ARGS_NONE());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
|
#include "io/sysio.h"
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
#include "pch.h"
|
||||||
#include "scripting/decl.h"
|
#include "scripting/decl.h"
|
||||||
#include "scripting/ruby_compiled.h"
|
#include "scripting/ruby_compiled.h"
|
||||||
#include "utils/utils.h"
|
#include "utils/utils.h"
|
||||||
#include <mruby/boxing_word.h>
|
|
||||||
|
|
||||||
std::unordered_map<std::string, std::pair<mrb_value, mrb_value>>
|
std::unordered_map<std::string, std::pair<mrb_value, mrb_value>>
|
||||||
custom_highlighters;
|
custom_highlighters;
|
||||||
@@ -27,8 +28,7 @@ struct R_Language {
|
|||||||
|
|
||||||
mrb_state *mrb = nullptr;
|
mrb_state *mrb = nullptr;
|
||||||
RClass *C_module;
|
RClass *C_module;
|
||||||
|
fs::path ruby_config_path;
|
||||||
namespace fs = std::filesystem;
|
|
||||||
|
|
||||||
void ruby_start() {
|
void ruby_start() {
|
||||||
mrb = mrb_open();
|
mrb = mrb_open();
|
||||||
@@ -60,6 +60,7 @@ void ruby_start() {
|
|||||||
if (fs::exists(p)) {
|
if (fs::exists(p)) {
|
||||||
FILE *f = fopen(p.string().c_str(), "r");
|
FILE *f = fopen(p.string().c_str(), "r");
|
||||||
if (f) {
|
if (f) {
|
||||||
|
ruby_config_path = p;
|
||||||
mrb_load_file(mrb, f);
|
mrb_load_file(mrb, f);
|
||||||
if (mrb->exc)
|
if (mrb->exc)
|
||||||
exit(1);
|
exit(1);
|
||||||
@@ -72,6 +73,39 @@ void ruby_start() {
|
|||||||
mrb_value block = mrb_funcall(mrb, mod_val, "b_startup", 0);
|
mrb_value block = mrb_funcall(mrb, mod_val, "b_startup", 0);
|
||||||
if (!mrb_nil_p(block))
|
if (!mrb_nil_p(block))
|
||||||
mrb_funcall(mrb, block, "call", 0);
|
mrb_funcall(mrb, block, "call", 0);
|
||||||
|
mrb_garbage_collect(mrb);
|
||||||
|
}
|
||||||
|
|
||||||
|
static mrb_value sym_fg;
|
||||||
|
static mrb_value sym_bg;
|
||||||
|
static mrb_value sym_flags;
|
||||||
|
static mrb_value sym_start;
|
||||||
|
static mrb_value sym_length;
|
||||||
|
static mrb_value sym_mode;
|
||||||
|
static mrb_value sym_lang_name;
|
||||||
|
static mrb_value sym_filename;
|
||||||
|
static mrb_value sym_width;
|
||||||
|
static mrb_value sym_normal;
|
||||||
|
static mrb_value sym_insert;
|
||||||
|
static mrb_value sym_select;
|
||||||
|
static mrb_value sym_runner;
|
||||||
|
static mrb_value sym_jumper;
|
||||||
|
|
||||||
|
inline void initialize_symbols() {
|
||||||
|
sym_fg = mrb_symbol_value(mrb_intern_cstr(mrb, "fg"));
|
||||||
|
sym_bg = mrb_symbol_value(mrb_intern_cstr(mrb, "bg"));
|
||||||
|
sym_flags = mrb_symbol_value(mrb_intern_cstr(mrb, "flags"));
|
||||||
|
sym_start = mrb_symbol_value(mrb_intern_cstr(mrb, "start"));
|
||||||
|
sym_length = mrb_symbol_value(mrb_intern_cstr(mrb, "length"));
|
||||||
|
sym_mode = mrb_symbol_value(mrb_intern_cstr(mrb, "mode"));
|
||||||
|
sym_lang_name = mrb_symbol_value(mrb_intern_cstr(mrb, "lang_name"));
|
||||||
|
sym_filename = mrb_symbol_value(mrb_intern_cstr(mrb, "filename"));
|
||||||
|
sym_width = mrb_symbol_value(mrb_intern_cstr(mrb, "width"));
|
||||||
|
sym_normal = mrb_symbol_value(mrb_intern_cstr(mrb, "normal"));
|
||||||
|
sym_insert = mrb_symbol_value(mrb_intern_cstr(mrb, "insert"));
|
||||||
|
sym_select = mrb_symbol_value(mrb_intern_cstr(mrb, "select"));
|
||||||
|
sym_runner = mrb_symbol_value(mrb_intern_cstr(mrb, "runner"));
|
||||||
|
sym_jumper = mrb_symbol_value(mrb_intern_cstr(mrb, "jumper"));
|
||||||
}
|
}
|
||||||
|
|
||||||
inline static std::vector<BarLight>
|
inline static std::vector<BarLight>
|
||||||
@@ -84,14 +118,11 @@ convert_highlights(mrb_state *mrb, mrb_value highlights_val) {
|
|||||||
mrb_value item = mrb_ary_ref(mrb, highlights_val, i);
|
mrb_value item = mrb_ary_ref(mrb, highlights_val, i);
|
||||||
if (!mrb_hash_p(item))
|
if (!mrb_hash_p(item))
|
||||||
continue;
|
continue;
|
||||||
auto get_sym = [&](const char *name) {
|
mrb_value fg_v = mrb_hash_get(mrb, item, sym_fg);
|
||||||
return mrb_symbol_value(mrb_intern_cstr(mrb, name));
|
mrb_value bg_v = mrb_hash_get(mrb, item, sym_bg);
|
||||||
};
|
mrb_value flags_v = mrb_hash_get(mrb, item, sym_flags);
|
||||||
mrb_value fg_v = mrb_hash_get(mrb, item, get_sym("fg"));
|
mrb_value start_v = mrb_hash_get(mrb, item, sym_start);
|
||||||
mrb_value bg_v = mrb_hash_get(mrb, item, get_sym("bg"));
|
mrb_value length_v = mrb_hash_get(mrb, item, sym_length);
|
||||||
mrb_value flags_v = mrb_hash_get(mrb, item, get_sym("flags"));
|
|
||||||
mrb_value start_v = mrb_hash_get(mrb, item, get_sym("start"));
|
|
||||||
mrb_value length_v = mrb_hash_get(mrb, item, get_sym("length"));
|
|
||||||
BarLight bl{};
|
BarLight bl{};
|
||||||
if (!mrb_nil_p(fg_v))
|
if (!mrb_nil_p(fg_v))
|
||||||
bl.highlight.fg = (uint32_t)mrb_fixnum(fg_v);
|
bl.highlight.fg = (uint32_t)mrb_fixnum(fg_v);
|
||||||
@@ -113,43 +144,54 @@ BarLine bar_contents(uint8_t mode, std::string lang_name, uint32_t warnings,
|
|||||||
std::string foldername, uint32_t line, uint32_t max_line,
|
std::string foldername, uint32_t line, uint32_t max_line,
|
||||||
uint32_t width) {
|
uint32_t width) {
|
||||||
BarLine bar_line;
|
BarLine bar_line;
|
||||||
|
static bool initialed = false;
|
||||||
|
if (!initialed) {
|
||||||
|
initialize_symbols();
|
||||||
|
initialed = true;
|
||||||
|
}
|
||||||
|
int ai = mrb_gc_arena_save(mrb);
|
||||||
mrb_value info = mrb_hash_new(mrb);
|
mrb_value info = mrb_hash_new(mrb);
|
||||||
mrb_value key_mode = mrb_symbol_value(mrb_intern_cstr(mrb, "mode"));
|
mrb_value key_mode = sym_mode;
|
||||||
mrb_value val_mode;
|
mrb_value val_mode;
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
case NORMAL:
|
case NORMAL:
|
||||||
val_mode = mrb_symbol_value(mrb_intern_cstr(mrb, "normal"));
|
val_mode = sym_normal;
|
||||||
break;
|
break;
|
||||||
case INSERT:
|
case INSERT:
|
||||||
val_mode = mrb_symbol_value(mrb_intern_cstr(mrb, "insert"));
|
val_mode = sym_insert;
|
||||||
break;
|
break;
|
||||||
case SELECT:
|
case SELECT:
|
||||||
val_mode = mrb_symbol_value(mrb_intern_cstr(mrb, "select"));
|
val_mode = sym_select;
|
||||||
break;
|
break;
|
||||||
case RUNNER:
|
case RUNNER:
|
||||||
val_mode = mrb_symbol_value(mrb_intern_cstr(mrb, "runner"));
|
val_mode = sym_runner;
|
||||||
break;
|
break;
|
||||||
case JUMPER:
|
case JUMPER:
|
||||||
val_mode = mrb_symbol_value(mrb_intern_cstr(mrb, "jumper"));
|
val_mode = sym_jumper;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
mrb_hash_set(mrb, info, key_mode, val_mode);
|
mrb_hash_set(mrb, info, key_mode, val_mode);
|
||||||
mrb_value key_lang_name = mrb_symbol_value(mrb_intern_cstr(mrb, "lang_name"));
|
mrb_value key_lang_name = sym_lang_name;
|
||||||
mrb_value val_lang_name =
|
mrb_value val_lang_name =
|
||||||
mrb_symbol_value(mrb_intern_cstr(mrb, lang_name.c_str()));
|
mrb_symbol_value(mrb_intern_cstr(mrb, lang_name.c_str()));
|
||||||
mrb_hash_set(mrb, info, key_lang_name, val_lang_name);
|
mrb_hash_set(mrb, info, key_lang_name, val_lang_name);
|
||||||
mrb_value key_filename = mrb_symbol_value(mrb_intern_cstr(mrb, "filename"));
|
mrb_value key_filename = sym_filename;
|
||||||
mrb_value val_filename =
|
mrb_value val_filename =
|
||||||
mrb_str_new(mrb, filename.c_str(), filename.length());
|
mrb_str_new(mrb, filename.c_str(), filename.length());
|
||||||
mrb_hash_set(mrb, info, key_filename, val_filename);
|
mrb_hash_set(mrb, info, key_filename, val_filename);
|
||||||
mrb_value key_width = mrb_symbol_value(mrb_intern_cstr(mrb, "width"));
|
mrb_value key_width = sym_width;
|
||||||
mrb_value val_width = mrb_fixnum_value(width);
|
mrb_value val_width = mrb_fixnum_value(width);
|
||||||
mrb_hash_set(mrb, info, key_width, val_width);
|
mrb_hash_set(mrb, info, key_width, val_width);
|
||||||
mrb_value mod_val = mrb_obj_value(C_module);
|
mrb_value mod_val = mrb_obj_value(C_module);
|
||||||
mrb_value block = mrb_funcall(mrb, mod_val, "b_bar", 0);
|
mrb_value block = mrb_funcall(mrb, mod_val, "b_bar", 0);
|
||||||
mrb_value val_line = mrb_funcall(mrb, block, "call", 1, info);
|
mrb_value val_line = mrb_funcall(mrb, block, "call", 1, info);
|
||||||
if (mrb->exc)
|
if (mrb->exc) {
|
||||||
|
end_screen();
|
||||||
|
fputs("Error when executing Ruby code:\n", stderr);
|
||||||
|
mrb_print_error(mrb);
|
||||||
|
mrb_close(mrb);
|
||||||
exit(1);
|
exit(1);
|
||||||
|
}
|
||||||
mrb_value text_val = mrb_hash_get(
|
mrb_value text_val = mrb_hash_get(
|
||||||
mrb, val_line, mrb_symbol_value(mrb_intern_cstr(mrb, "text")));
|
mrb, val_line, mrb_symbol_value(mrb_intern_cstr(mrb, "text")));
|
||||||
const char *ptr = RSTRING_PTR(text_val);
|
const char *ptr = RSTRING_PTR(text_val);
|
||||||
@@ -158,9 +200,129 @@ BarLine bar_contents(uint8_t mode, std::string lang_name, uint32_t warnings,
|
|||||||
mrb_value highlights_val = mrb_hash_get(
|
mrb_value highlights_val = mrb_hash_get(
|
||||||
mrb, val_line, mrb_symbol_value(mrb_intern_cstr(mrb, "highlights")));
|
mrb, val_line, mrb_symbol_value(mrb_intern_cstr(mrb, "highlights")));
|
||||||
bar_line.highlights = convert_highlights(mrb, highlights_val);
|
bar_line.highlights = convert_highlights(mrb, highlights_val);
|
||||||
|
mrb_gc_arena_restore(mrb, ai);
|
||||||
return bar_line;
|
return bar_line;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string serialize_value(mrb_state *mrb, mrb_value val) {
|
||||||
|
int ai = mrb_gc_arena_save(mrb);
|
||||||
|
mrb_value marshal_module = mrb_obj_value(mrb_module_get(mrb, "Marshal"));
|
||||||
|
mrb_value dumped = mrb_funcall(mrb, marshal_module, "dump", 1, val);
|
||||||
|
if (mrb->exc) {
|
||||||
|
end_screen();
|
||||||
|
fputs("Error when executing Ruby code:\n", stderr);
|
||||||
|
mrb_print_error(mrb);
|
||||||
|
mrb_close(mrb);
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
std::string bytes(RSTRING_PTR(dumped), RSTRING_LEN(dumped));
|
||||||
|
mrb_gc_arena_restore(mrb, ai);
|
||||||
|
return bytes;
|
||||||
|
}
|
||||||
|
|
||||||
|
mrb_value deserialize_value(mrb_state *mrb, std::string bytes) {
|
||||||
|
if (bytes.empty())
|
||||||
|
return mrb_nil_value();
|
||||||
|
mrb_value marshal_module = mrb_obj_value(mrb_module_get(mrb, "Marshal"));
|
||||||
|
mrb_value val = mrb_funcall(mrb, marshal_module, "load", 1,
|
||||||
|
mrb_str_new(mrb, bytes.c_str(), bytes.length()));
|
||||||
|
if (mrb->exc) {
|
||||||
|
end_screen();
|
||||||
|
fputs("Error when executing Ruby code:\n", stderr);
|
||||||
|
mrb_print_error(mrb);
|
||||||
|
mrb_close(mrb);
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ruby_copy(const char *text, size_t len) {
|
||||||
|
int ai = mrb_gc_arena_save(mrb);
|
||||||
|
if (C_module == nullptr)
|
||||||
|
return;
|
||||||
|
mrb_value mod_val = mrb_obj_value(C_module);
|
||||||
|
mrb_value block = mrb_funcall(mrb, mod_val, "b_copy", 0);
|
||||||
|
if (!mrb_nil_p(block))
|
||||||
|
mrb_funcall(mrb, block, "call", 1, mrb_str_new(mrb, text, len));
|
||||||
|
if (mrb->exc) {
|
||||||
|
end_screen();
|
||||||
|
fputs("Error when executing Ruby code:\n", stderr);
|
||||||
|
mrb_print_error(mrb);
|
||||||
|
mrb_close(mrb);
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
mrb_gc_arena_restore(mrb, ai);
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string ruby_file_detect(std::string filename) {
|
||||||
|
int ai = mrb_gc_arena_save(mrb);
|
||||||
|
if (C_module == nullptr)
|
||||||
|
return "";
|
||||||
|
mrb_value mod_val = mrb_obj_value(C_module);
|
||||||
|
mrb_value block = mrb_funcall(mrb, mod_val, "b_file_detect", 0);
|
||||||
|
if (mrb->exc) {
|
||||||
|
end_screen();
|
||||||
|
fputs("Error when executing Ruby code:\n", stderr);
|
||||||
|
mrb_print_error(mrb);
|
||||||
|
mrb_close(mrb);
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
if (!mrb_nil_p(block)) {
|
||||||
|
mrb_value val =
|
||||||
|
mrb_funcall(mrb, block, "call", 1,
|
||||||
|
mrb_str_new(mrb, filename.c_str(), filename.length()));
|
||||||
|
if (mrb->exc) {
|
||||||
|
end_screen();
|
||||||
|
fputs("Error when executing Ruby code:\n", stderr);
|
||||||
|
mrb_print_error(mrb);
|
||||||
|
mrb_close(mrb);
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
mrb_value s_val = mrb_funcall(mrb, val, "to_s", 0);
|
||||||
|
if (mrb->exc) {
|
||||||
|
end_screen();
|
||||||
|
fputs("Error when executing Ruby code:\n", stderr);
|
||||||
|
mrb_print_error(mrb);
|
||||||
|
mrb_close(mrb);
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
if (mrb_string_p(s_val)) {
|
||||||
|
std::string result = std::string(RSTRING_PTR(s_val), RSTRING_LEN(s_val));
|
||||||
|
mrb_gc_arena_restore(mrb, ai);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
mrb_gc_arena_restore(mrb, ai);
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string ruby_paste() {
|
||||||
|
int ai = mrb_gc_arena_save(mrb);
|
||||||
|
if (C_module == nullptr)
|
||||||
|
return "";
|
||||||
|
mrb_value mod_val = mrb_obj_value(C_module);
|
||||||
|
mrb_value block = mrb_funcall(mrb, mod_val, "b_paste", 0);
|
||||||
|
if (!mrb_nil_p(block)) {
|
||||||
|
mrb_value val = mrb_funcall(mrb, block, "call", 0);
|
||||||
|
if (mrb->exc) {
|
||||||
|
end_screen();
|
||||||
|
fputs("Error when executing Ruby code:\n", stderr);
|
||||||
|
mrb_print_error(mrb);
|
||||||
|
mrb_close(mrb);
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
if (mrb_string_p(val)) {
|
||||||
|
std::string result = std::string(RSTRING_PTR(val), RSTRING_LEN(val));
|
||||||
|
mrb_gc_arena_restore(mrb, ai);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
mrb_gc_arena_restore(mrb, ai);
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
mrb_gc_arena_restore(mrb, ai);
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
void ruby_shutdown() {
|
void ruby_shutdown() {
|
||||||
if (C_module == nullptr)
|
if (C_module == nullptr)
|
||||||
return;
|
return;
|
||||||
@@ -211,25 +373,36 @@ void load_custom_highlighters() {
|
|||||||
mrb_hash_get(mrb, val_hash, mrb_symbol_value(matcher_sym));
|
mrb_hash_get(mrb, val_hash, mrb_symbol_value(matcher_sym));
|
||||||
custom_highlighters[key] = {parse_block, match_block};
|
custom_highlighters[key] = {parse_block, match_block};
|
||||||
}
|
}
|
||||||
|
mrb_garbage_collect(mrb);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool custom_compare(mrb_value match_block, mrb_value state1, mrb_value state2) {
|
bool custom_compare(mrb_value match_block, std::string state1,
|
||||||
|
std::string state2) {
|
||||||
|
if (state1.empty() || state2.empty())
|
||||||
|
return false;
|
||||||
|
int ai = mrb_gc_arena_save(mrb);
|
||||||
if (mrb_type(match_block) != MRB_TT_PROC)
|
if (mrb_type(match_block) != MRB_TT_PROC)
|
||||||
return false;
|
return false;
|
||||||
mrb_value ret = mrb_funcall(mrb, match_block, "call", 2, state1, state2);
|
mrb_value ret =
|
||||||
return mrb_test(ret);
|
mrb_funcall(mrb, match_block, "call", 2, deserialize_value(mrb, state1),
|
||||||
|
deserialize_value(mrb, state2));
|
||||||
|
bool result = mrb_test(ret);
|
||||||
|
mrb_gc_arena_restore(mrb, ai);
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
mrb_value parse_custom(std::vector<Token> *tokens, mrb_value parser_block,
|
std::string parse_custom(std::vector<Token> *tokens, mrb_value parser_block,
|
||||||
const char *line, uint32_t len, mrb_value state,
|
const char *line, uint32_t len, std::string state,
|
||||||
uint32_t c_line) {
|
uint32_t c_line) {
|
||||||
|
int ai = mrb_gc_arena_save(mrb);
|
||||||
tokens->clear();
|
tokens->clear();
|
||||||
if (mrb_nil_p(parser_block))
|
if (mrb_nil_p(parser_block))
|
||||||
return mrb_nil_value();
|
return "";
|
||||||
mrb_value ruby_line = mrb_str_new(mrb, line, len);
|
mrb_value ruby_line = mrb_str_new(mrb, line, len);
|
||||||
mrb_value line_idx = mrb_fixnum_value(c_line);
|
mrb_value line_idx = mrb_fixnum_value(c_line);
|
||||||
mrb_value tokens_and_state_hash =
|
mrb_value tokens_and_state_hash =
|
||||||
mrb_funcall(mrb, parser_block, "call", 3, ruby_line, state, line_idx);
|
mrb_funcall(mrb, parser_block, "call", 3, ruby_line,
|
||||||
|
deserialize_value(mrb, state), line_idx);
|
||||||
mrb_sym tokens_sym = mrb_intern_lit(mrb, "tokens");
|
mrb_sym tokens_sym = mrb_intern_lit(mrb, "tokens");
|
||||||
mrb_value tokens_rb =
|
mrb_value tokens_rb =
|
||||||
mrb_hash_get(mrb, tokens_and_state_hash, mrb_symbol_value(tokens_sym));
|
mrb_hash_get(mrb, tokens_and_state_hash, mrb_symbol_value(tokens_sym));
|
||||||
@@ -249,7 +422,13 @@ mrb_value parse_custom(std::vector<Token> *tokens, mrb_value parser_block,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
mrb_sym state_sym = mrb_intern_lit(mrb, "state");
|
mrb_sym state_sym = mrb_intern_lit(mrb, "state");
|
||||||
return mrb_hash_get(mrb, tokens_and_state_hash, mrb_symbol_value(state_sym));
|
mrb_value state_rb =
|
||||||
|
mrb_hash_get(mrb, tokens_and_state_hash, mrb_symbol_value(state_sym));
|
||||||
|
std::string result;
|
||||||
|
if (mrb_type(state_rb) == MRB_TT_STRING)
|
||||||
|
result = std::string(RSTRING_PTR(state_rb), RSTRING_LEN(state_rb));
|
||||||
|
mrb_gc_arena_restore(mrb, ai);
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
static std::vector<R_ThemeEntry> read_theme() {
|
static std::vector<R_ThemeEntry> read_theme() {
|
||||||
@@ -298,6 +477,7 @@ static std::vector<R_ThemeEntry> read_theme() {
|
|||||||
entry.strikethrough = mrb_test(strikethrough);
|
entry.strikethrough = mrb_test(strikethrough);
|
||||||
result.push_back(entry);
|
result.push_back(entry);
|
||||||
}
|
}
|
||||||
|
mrb_garbage_collect(mrb);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -366,6 +546,7 @@ std::vector<LSP> read_lsps() {
|
|||||||
std::vector<std::string> args = array_to_vector(args_array);
|
std::vector<std::string> args = array_to_vector(args_array);
|
||||||
result.push_back({cmd, args});
|
result.push_back({cmd, args});
|
||||||
}
|
}
|
||||||
|
mrb_garbage_collect(mrb);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -406,6 +587,7 @@ std::vector<R_Language> read_languages() {
|
|||||||
lang.lsp_command = std::string(RSTRING_PTR(lsp), RSTRING_LEN(lsp));
|
lang.lsp_command = std::string(RSTRING_PTR(lsp), RSTRING_LEN(lsp));
|
||||||
result.push_back(lang);
|
result.push_back(lang);
|
||||||
}
|
}
|
||||||
|
mrb_garbage_collect(mrb);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -26,176 +26,123 @@ Parser::Parser(Editor *n_editor, std::string n_lang, uint32_t n_scroll_max) {
|
|||||||
assert("unknown lang should be checked by caller" && 0);
|
assert("unknown lang should be checked by caller" && 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
edit(0, 0, editor->root->line_count);
|
edit(0, 0, editor->root->line_count + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Parser::edit(uint32_t start_line, uint32_t old_end_line,
|
void Parser::edit(uint32_t start_line, uint32_t removed_rows,
|
||||||
uint32_t inserted_rows) {
|
uint32_t inserted_rows) {
|
||||||
std::lock_guard lock(data_mutex);
|
int64_t delta = (int64_t)inserted_rows - (int64_t)removed_rows;
|
||||||
if (((int64_t)old_end_line - (int64_t)start_line) > 0)
|
if (delta < 0)
|
||||||
line_tree.erase(start_line, old_end_line - start_line);
|
line_tree.erase(start_line, (uint32_t)(-delta));
|
||||||
if (inserted_rows > 0)
|
else if (delta > 0)
|
||||||
line_tree.insert(start_line, inserted_rows);
|
line_tree.insert(start_line, (uint32_t)delta);
|
||||||
if (start_line > 0)
|
uint32_t span = MAX(removed_rows, inserted_rows);
|
||||||
dirty_lines.push(start_line - 1);
|
uint32_t begin = (start_line > 0) ? start_line - 1 : 0;
|
||||||
dirty_lines.push(start_line);
|
uint32_t end = start_line + span;
|
||||||
dirty_lines.push(start_line + 1);
|
for (uint32_t line = begin; line <= end + 1; ++line)
|
||||||
|
dirty_lines.push(line);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Parser::work() {
|
void Parser::work() {
|
||||||
if (!editor || !editor->root)
|
if (!editor || !editor->root)
|
||||||
return;
|
return;
|
||||||
std::shared_lock k_lock(editor->knot_mtx);
|
std::vector<uint32_t> batch;
|
||||||
k_lock.unlock();
|
|
||||||
uint32_t capacity = 256;
|
|
||||||
char *text = (char *)calloc((capacity + 1), sizeof(char));
|
|
||||||
std::unique_lock lock_data(data_mutex);
|
|
||||||
lock_data.unlock();
|
|
||||||
std::unique_lock lock(mutex);
|
|
||||||
lock.unlock();
|
|
||||||
uint32_t c_line;
|
uint32_t c_line;
|
||||||
while (dirty_lines.pop(c_line)) {
|
while (dirty_lines.pop(c_line))
|
||||||
if (!running.load(std::memory_order_relaxed)) {
|
batch.push_back(c_line);
|
||||||
free(text);
|
uint32_t i = MAX(0, (int64_t)scroll_max - 60);
|
||||||
return;
|
LineData *l_iter = line_tree.start_iter(i);
|
||||||
|
while (l_iter && i < scroll_max + 10) {
|
||||||
|
if (!l_iter->out_state)
|
||||||
|
batch.push_back(i);
|
||||||
|
i++;
|
||||||
|
l_iter = line_tree.next();
|
||||||
}
|
}
|
||||||
if (c_line > scroll_max + 40) {
|
line_tree.end_iter();
|
||||||
|
for (uint32_t c_line : batch) {
|
||||||
|
if (!running.load(std::memory_order_relaxed))
|
||||||
|
break;
|
||||||
|
uint32_t min_line = scroll_max > 60 ? scroll_max - 60 : 0;
|
||||||
|
uint32_t max_line = scroll_max + 10;
|
||||||
|
if (c_line < min_line || c_line > max_line) {
|
||||||
dirty_lines.push(c_line);
|
dirty_lines.push(c_line);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (scroll_max > 50 && c_line < scroll_max - 50) {
|
uint32_t scroll_snapshot = scroll_max;
|
||||||
dirty_lines.push(c_line);
|
std::shared_ptr<void> prev_state = nullptr;
|
||||||
|
uint32_t line_count;
|
||||||
|
line_count = line_tree.count();
|
||||||
|
if (c_line > 0 && c_line < line_count)
|
||||||
|
prev_state = line_tree.at(c_line - 1)->out_state;
|
||||||
|
std::shared_lock k_lock(editor->knot_mtx);
|
||||||
|
LineIterator *it = begin_l_iter(editor->root, c_line);
|
||||||
|
if (!it)
|
||||||
continue;
|
continue;
|
||||||
|
uint32_t cur_line = c_line;
|
||||||
|
while (cur_line < line_count) {
|
||||||
|
if (!running.load(std::memory_order_relaxed))
|
||||||
|
break;
|
||||||
|
if (scroll_snapshot != scroll_max) {
|
||||||
|
LineData *line_data = line_tree.at(cur_line);
|
||||||
|
if (line_data && !line_data->out_state)
|
||||||
|
dirty_lines.push(cur_line);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
uint32_t line_count = line_tree.count();
|
if (cur_line < min_line || cur_line > max_line) {
|
||||||
lock_data.lock();
|
dirty_lines.push(cur_line);
|
||||||
std::shared_ptr<void> prev_state =
|
break;
|
||||||
(c_line > 0) && c_line < line_tree.count()
|
|
||||||
? line_tree.at(c_line - 1)->out_state
|
|
||||||
: nullptr;
|
|
||||||
lock_data.unlock();
|
|
||||||
while (c_line < line_count) {
|
|
||||||
if (!running.load(std::memory_order_relaxed)) {
|
|
||||||
free(text);
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
if (scroll_dirty.exchange(false, std::memory_order_acq_rel)) {
|
uint32_t len;
|
||||||
dirty_lines.push(c_line);
|
char *line = next_line(it, &len);
|
||||||
c_line = scroll_max < 50 ? 0 : scroll_max - 50;
|
if (!line)
|
||||||
}
|
break;
|
||||||
k_lock.lock();
|
LineData *line_data = line_tree.at(cur_line);
|
||||||
if (c_line > editor->root->line_count) {
|
|
||||||
k_lock.unlock();
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
uint32_t r_offset, r_len;
|
|
||||||
r_offset = line_to_byte(editor->root, c_line, &r_len);
|
|
||||||
if (r_len > capacity) {
|
|
||||||
capacity = r_len;
|
|
||||||
text = (char *)realloc(text, capacity + 1);
|
|
||||||
memset(text, 0, capacity + 1);
|
|
||||||
}
|
|
||||||
read_into(editor->root, r_offset, r_len, text);
|
|
||||||
k_lock.unlock();
|
|
||||||
if (c_line < scroll_max &&
|
|
||||||
((scroll_max > 100 && c_line > scroll_max - 100) || c_line < 100))
|
|
||||||
lock.lock();
|
|
||||||
if (line_tree.count() < c_line) {
|
|
||||||
if (lock.owns_lock())
|
|
||||||
lock.unlock();
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
lock_data.lock();
|
|
||||||
LineData *line_data = line_tree.at(c_line);
|
|
||||||
if (!line_data) {
|
if (!line_data) {
|
||||||
lock_data.unlock();
|
cur_line++;
|
||||||
if (lock.owns_lock())
|
|
||||||
lock.unlock();
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
std::shared_ptr<void> new_state{nullptr};
|
std::shared_ptr<void> new_state;
|
||||||
if (is_custom) {
|
if (is_custom) {
|
||||||
mrb_value state = mrb_nil_value();
|
std::string state = "";
|
||||||
if (prev_state) {
|
if (prev_state)
|
||||||
std::shared_ptr<CustomState> state_ptr =
|
state = std::static_pointer_cast<std::string>(prev_state)->c_str();
|
||||||
std::static_pointer_cast<CustomState>(prev_state);
|
std::string out_state = parse_custom(&line_data->tokens, parser_block,
|
||||||
state = state_ptr->state;
|
line, len, state, cur_line);
|
||||||
}
|
new_state = std::make_shared<std::string>(out_state);
|
||||||
mrb_value out_state = parse_custom(&line_data->tokens, parser_block,
|
|
||||||
text, r_len, state, c_line);
|
|
||||||
std::shared_ptr<CustomState> out_state_ptr =
|
|
||||||
std::make_shared<CustomState>(out_state);
|
|
||||||
new_state = out_state_ptr;
|
|
||||||
} else {
|
} else {
|
||||||
new_state =
|
new_state =
|
||||||
parse_func(&line_data->tokens, prev_state, text, r_len, c_line);
|
parse_func(&line_data->tokens, prev_state, line, len, cur_line);
|
||||||
}
|
}
|
||||||
line_data->in_state = prev_state;
|
line_data->in_state = prev_state;
|
||||||
line_data->out_state = new_state;
|
line_data->out_state = new_state;
|
||||||
if (!running.load(std::memory_order_relaxed)) {
|
bool done = false;
|
||||||
free(text);
|
if (cur_line + 1 < line_count) {
|
||||||
return;
|
LineData *next_line_data = line_tree.at(cur_line + 1);
|
||||||
|
if (next_line_data) {
|
||||||
|
if (is_custom) {
|
||||||
|
std::string a =
|
||||||
|
prev_state
|
||||||
|
? std::static_pointer_cast<std::string>(new_state)->c_str()
|
||||||
|
: "";
|
||||||
|
std::string b = next_line_data->in_state
|
||||||
|
? std::static_pointer_cast<std::string>(
|
||||||
|
next_line_data->in_state)
|
||||||
|
->c_str()
|
||||||
|
: "";
|
||||||
|
done = custom_compare(match_block, a, b);
|
||||||
|
} else {
|
||||||
|
done = state_match_func(new_state, next_line_data->in_state);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
prev_state = new_state;
|
prev_state = new_state;
|
||||||
c_line++;
|
cur_line++;
|
||||||
if (c_line < line_count && c_line > scroll_max + 50 && scroll_max < 50 &&
|
if (done)
|
||||||
c_line < scroll_max + 50) {
|
|
||||||
lock_data.unlock();
|
|
||||||
if (lock.owns_lock())
|
|
||||||
lock.unlock();
|
|
||||||
if (c_line > 0)
|
|
||||||
dirty_lines.push(c_line - 1);
|
|
||||||
dirty_lines.push(c_line);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (c_line < line_count && (line_data = line_tree.at(c_line))) {
|
free(it->buffer);
|
||||||
bool done = false;
|
free(it);
|
||||||
if (is_custom) {
|
|
||||||
mrb_value in_state_v = mrb_nil_value();
|
|
||||||
if (prev_state)
|
|
||||||
in_state_v =
|
|
||||||
std::static_pointer_cast<CustomState>(prev_state)->state;
|
|
||||||
mrb_value out_state_v = mrb_nil_value();
|
|
||||||
if (line_data->in_state)
|
|
||||||
out_state_v =
|
|
||||||
std::static_pointer_cast<CustomState>(line_data->in_state)
|
|
||||||
->state;
|
|
||||||
done = custom_compare(match_block, in_state_v, out_state_v);
|
|
||||||
} else {
|
|
||||||
done = state_match_func(prev_state, line_data->in_state);
|
|
||||||
}
|
}
|
||||||
if (done) {
|
|
||||||
lock_data.unlock();
|
|
||||||
if (lock.owns_lock())
|
|
||||||
lock.unlock();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
lock_data.unlock();
|
|
||||||
if (lock.owns_lock())
|
|
||||||
lock.unlock();
|
|
||||||
}
|
|
||||||
if (!running.load(std::memory_order_relaxed)) {
|
|
||||||
free(text);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
free(text);
|
|
||||||
lock_data.lock();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Parser::scroll(uint32_t line) {
|
void Parser::scroll(uint32_t line) { scroll_max = line; }
|
||||||
if (line != scroll_max) {
|
|
||||||
scroll_max = line;
|
|
||||||
uint32_t c_line = line > 50 ? line - 50 : 0;
|
|
||||||
if (c_line >= line_tree.count())
|
|
||||||
return;
|
|
||||||
std::unique_lock lock_data(data_mutex);
|
|
||||||
if (line_tree.at(c_line)->in_state || line_tree.at(c_line)->out_state)
|
|
||||||
return;
|
|
||||||
scroll_dirty = true;
|
|
||||||
dirty_lines.push(c_line);
|
|
||||||
} else {
|
|
||||||
scroll_max = line;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -4,24 +4,16 @@
|
|||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "syntax/decl.h"
|
#include "syntax/decl.h"
|
||||||
|
|
||||||
void Bar::work() {
|
void Bar::log(std::string message) { log_line = message; }
|
||||||
std::lock_guard<std::mutex> lock(mtx);
|
|
||||||
|
void Bar::render() {
|
||||||
|
USING(LSPInstance);
|
||||||
Editor *editor = editors[current_editor];
|
Editor *editor = editors[current_editor];
|
||||||
bar_line =
|
BarLine bar_line =
|
||||||
bar_contents(mode, editor->lang.name, editor->warnings.size(),
|
bar_contents(mode, editor->lang.name, editor->warnings.size(),
|
||||||
editor->lsp ? editor->lsp->lsp->command : "",
|
editor->lsp ? editor->lsp->lsp->command : "",
|
||||||
editor->filename, editor->filename, editor->cursor.row + 1,
|
editor->filename, editor->filename, editor->cursor.row + 1,
|
||||||
editor->root->line_count + 1, screen.col);
|
editor->root->line_count + 1, screen.col);
|
||||||
}
|
|
||||||
|
|
||||||
void Bar::log(std::string message) {
|
|
||||||
std::lock_guard<std::mutex> lock(mtx);
|
|
||||||
log_line = message;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Bar::render() {
|
|
||||||
std::lock_guard<std::mutex> lock(mtx);
|
|
||||||
USING(LSPInstance);
|
|
||||||
uint32_t row = screen.row - 2;
|
uint32_t row = screen.row - 2;
|
||||||
uint32_t width = screen.col;
|
uint32_t width = screen.col;
|
||||||
std::string &line = bar_line.line;
|
std::string &line = bar_line.line;
|
||||||
@@ -59,6 +51,7 @@ void Bar::render() {
|
|||||||
void Bar::handle(KeyEvent event) {
|
void Bar::handle(KeyEvent event) {
|
||||||
if (event.key_type == KEY_CHAR && event.len == 1) {
|
if (event.key_type == KEY_CHAR && event.len == 1) {
|
||||||
if (event.c[0] == 0x1B) {
|
if (event.c[0] == 0x1B) {
|
||||||
|
command = "";
|
||||||
mode = NORMAL;
|
mode = NORMAL;
|
||||||
} else if (event.c[0] == '\n' || event.c[0] == '\r') {
|
} else if (event.c[0] == '\n' || event.c[0] == '\r') {
|
||||||
command = trim(command);
|
command = trim(command);
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#include "scripting/decl.h"
|
||||||
#include "utils/utils.h"
|
#include "utils/utils.h"
|
||||||
|
|
||||||
std::unordered_map<std::string, Language> languages;
|
std::unordered_map<std::string, Language> languages;
|
||||||
@@ -107,60 +108,16 @@ static std::string file_extension(const char *filename) {
|
|||||||
|
|
||||||
Language language_for_file(const char *filename) {
|
Language language_for_file(const char *filename) {
|
||||||
std::string ext = file_extension(filename);
|
std::string ext = file_extension(filename);
|
||||||
std::string lang_name;
|
|
||||||
if (!ext.empty()) {
|
if (!ext.empty()) {
|
||||||
auto it = language_extensions.find(ext);
|
auto it = language_extensions.find(ext);
|
||||||
if (it != language_extensions.end())
|
if (it != language_extensions.end())
|
||||||
return languages.find(it->second)->second;
|
return languages.find(it->second)->second;
|
||||||
}
|
}
|
||||||
|
std::string lang_name = ruby_file_detect(filename);
|
||||||
|
if (!lang_name.empty()) {
|
||||||
|
auto it = languages.find(lang_name);
|
||||||
|
if (it != languages.end())
|
||||||
|
return it->second;
|
||||||
|
}
|
||||||
return Language{};
|
return Language{};
|
||||||
}
|
}
|
||||||
|
|
||||||
char *get_from_clipboard(uint32_t *out_len) {
|
|
||||||
FILE *pipe = popen("xclip -selection clipboard -o", "r");
|
|
||||||
if (!pipe) {
|
|
||||||
*out_len = 0;
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
size_t capacity = 4096;
|
|
||||||
size_t length = 0;
|
|
||||||
char *buffer = (char *)malloc(capacity);
|
|
||||||
if (!buffer) {
|
|
||||||
pclose(pipe);
|
|
||||||
*out_len = 0;
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
size_t n;
|
|
||||||
while ((n = fread(buffer + length, 1, capacity - length, pipe)) > 0) {
|
|
||||||
length += n;
|
|
||||||
if (length == capacity) {
|
|
||||||
capacity *= 2;
|
|
||||||
char *tmp = (char *)realloc(buffer, capacity);
|
|
||||||
if (!tmp) {
|
|
||||||
free(buffer);
|
|
||||||
pclose(pipe);
|
|
||||||
*out_len = 0;
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
buffer = tmp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pclose(pipe);
|
|
||||||
char *result = (char *)realloc(buffer, length + 1);
|
|
||||||
if (result) {
|
|
||||||
result[length] = '\0';
|
|
||||||
buffer = result;
|
|
||||||
} else {
|
|
||||||
buffer[length] = '\0';
|
|
||||||
}
|
|
||||||
*out_len = length;
|
|
||||||
return buffer;
|
|
||||||
}
|
|
||||||
|
|
||||||
void copy_to_clipboard(const char *text, size_t len) {
|
|
||||||
FILE *pipe = popen("xclip -selection clipboard", "w");
|
|
||||||
if (!pipe)
|
|
||||||
return;
|
|
||||||
fwrite(text, sizeof(char), len, pipe);
|
|
||||||
pclose(pipe);
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user