brack-lang / brack Goto Github PK
View Code? Open in Web Editor NEWA bracket-based lightweight markup language that extends commands with WebAssembly
License: Apache License 2.0
A bracket-based lightweight markup language that extends commands with WebAssembly
License: Apache License 2.0
Perhaps the Cargo.toml in modsurfer-plugins causes this error.
@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking sources
unpacking source archive /nix/store/3ld36w5xvzp4522pm81i4rcjhwqmn7r3-dummy-src
source root is dummy-src
@nix { "action": "setPhase", "phase": "patchPhase" }
patching sources
@nix { "action": "setPhase", "phase": "updateAutotoolsGnuConfigScriptsPhase" }
updateAutotoolsGnuConfigScriptsPhase
@nix { "action": "setPhase", "phase": "configurePhase" }
configuring
[naersk] cargo_version (read): 1.73.0
[naersk] cargo_message_format (set): json-diagnostic-rendered-ansi
[naersk] cargo_release: --release
[naersk] cargo_options:
[naersk] cargo_build_options: $cargo_release -j "$NIX_BUILD_CORES" --message-format=$cargo_message_format
[naersk] cargo_test_options: $cargo_release -j "$NIX_BUILD_CORES"
[naersk] RUST_TEST_THREADS: 10
[naersk] cargo_bins_jq_filter: .
[naersk] cargo_build_output_json (created): /private/tmp/nix-build-rust-workspace-deps-unknown.drv-0/tmp.ZguZzvhrPI
[naersk] RUSTFLAGS:
[naersk] CARGO_BUILD_RUSTFLAGS:
[naersk] CARGO_BUILD_RUSTFLAGS (updated): --remap-path-prefix /nix/store/q3izw985x40d4wcsvymfnfcamp0ck1i3-crates-io-dependencies=/sources --remap-path-prefix /nix/store/x5gcsizqdyljm9kfxf9bbvzdg6z6zwr5-git-dependencies=/sources
@nix { "action": "setPhase", "phase": "buildPhase" }
building
cargo build $cargo_release -j "$NIX_BUILD_CORES" --message-format=$cargo_message_format
�[0m�[0m�[1m�[33mwarning�[0m�[1m:�[0m /private/tmp/nix-build-rust-workspace-deps-unknown.drv-0/dummy-src/brack-parser/Cargo.toml: dependency (serde) specified without providing a local path, Git repository, version, or workspace dependency to use. This will be considered an error in future versions
�[0m�[0m�[1m�[33mwarning�[0m�[1m:�[0m /private/tmp/nix-build-rust-workspace-deps-unknown.drv-0/dummy-src/brack-parser/Cargo.toml: unused manifest key: dependencies.serde.versopm
�[0m�[0m�[1m�[31merror�[0m�[1m:�[0m failed to get `modsurfer-plugins` as a dependency of package `brack-plugin v0.1.0 (/private/tmp/nix-build-rust-workspace-deps-unknown.drv-0/dummy-src/brack-plugin)`
Caused by:
failed to load source for dependency `modsurfer-plugins`
Caused by:
Unable to update https://github.com/dylibso/modsurfer#0a915ee4
Caused by:
failed to update replaced source https://github.com/dylibso/modsurfer#0a915ee4
Caused by:
failed to parse manifest at `/nix/store/x5gcsizqdyljm9kfxf9bbvzdg6z6zwr5-git-dependencies/modsurfer-proto-0.1.0-0a915ee4978d16b1ed0c199320d10d382bf79200/Cargo.toml`
Caused by:
error inheriting `protobuf` from workspace root manifest's `workspace.dependencies.protobuf`
Caused by:
failed to find a workspace root
[naersk] cargo returned with exit code 101, exiting
The tokenizer is currently implemented to return values of type Vec<Token>
. However, tokenization can fail, and in such cases, it would be more appropriate for the function to return a Result<Vec<Token>, Error>
to properly handle potential errors.
現状の実装では脚注を実装できない。
特定のコマンドを特別視することはBrackの**に反するので、別の解決策を取りたい。
コマンドはcontext
を受け取る
マクロを実装してASTを変更する
To align with Language Server Protocol, I need to modify the structure of TokenData
to Location
as part of the implementation process for the language server.
Specifically, I plan to transition from the current structure:
pub struct TokenData {
pub line: usize,
pub column: usize,
}
to the following structure, in compliance with the protocol:
struct LocationRangePos {
line: usize,
character: usize,
}
struct LocationRange {
start: LocationRangePos,
end: LocationRangePos,
}
pub struct Location {
pub uri: String,
pub range: LocationRange,
}
This change will ensure that our implementation adheres to the standardized format defined by the Language Server Protocol.
There are the tokenizer, the parser, the macro expander, the code generator, and the language server inside one crate.
However, these must be divided into multiple crates because complexity will increase as the specification grows.
現在はHTMLジェネレータのみが拡張可能であるが、トークン列<
と>
に囲まれたマークアップをマクロであると解釈して、パーザを拡張可能にする。
現在は以下の3行目のマークアップで、コロンによってecho "Hello
、 "
、 name
、"!"
の4引数が#
コマンドに渡されると解釈される。しかし現実にはecho "Hello, ", name, "!"
が1引数で渡される必要があり、何らかの方法でエスケープを導入する必要がある。
{* 標準出力}
[# echo]プロシージャは文字列にキャスト可能な型を持つ可変長引数を受け取って標準出力します。
[# echo "Hello, ", name, "!"]
`
や\
などのトークン列を特別なコマンドとしてエスケープを実装する手段も考えられるが、なるべくBrack自体が意味を持つコマンドを実装することは避けたい。そこで、マクロを導入する。
{* 標準出力}
[# echo]プロシージャは文字列にキャスト可能な型を持つ可変長引数を受け取って標準出力します。
[# <\ echo "Hello, ", name, "!">]
マクロは、コマンド名と以下のBrackの抽象構文木を受け取る。
bnkArgument
bnkText
echo "Hello
bnkArgument
bnkText
"
bnkArgument
bnkText
name
bnkArgument
bnkText
"!"
エスケープが必要な場合は、受け取った引数ノードを1つの引数ノードに連結して返却することで上手く動作すると考えられる。
入れ子状態のマクロが書かれることも考えられるが、特に実装が思いついていないのでまずは1レベルのマクロの実装に取り組む。
brack/brack-tokenizer/src/utils.rs
Line 77 in 8bcdb6b
We should use Nix and Cachix (Binary Cache) in the continuous integration to improve speed.
We are aiming to enhance the completion feature in our language server by enabling the extraction of function signatures from Wasm modules. To achieve this, we plan to integrate the capability to analyze Wasm modules and retrieve their functions and corresponding type signatures. The tool modsurfer will be instrumental in this process, as it provides the necessary functionality to dissect and understand the structure of Wasm modules.
When tokenizing Japanese text, a panic occurs when slicing a &str
.
現状のパーサは雰囲気で書かれていて、しかもかなり壊れている。
再帰下降構文解析をするように実装をし直す。
Diagnostic is a feature defined the Language Server Protocol that highlights warnings and errors in the editor, based on the results of code analysis.
For more information on the LSP specification and implementation, refer to the following Japanese documents:
Implementing the full functionally is challenging, so please impl;ement a function equivalent to sendPublishDiagnostics
that can display a set of fixed errors.
複数の装飾で、かつほぼデフォルトのコマンドの組み合わせであるような場合、次のようなマークアップになる。
[* [/ [# [@ text, #]]]]
しかしこれは煩雑である。また、新しいコマンドを定義しても良いが再利用されない場合もやや億劫。
そこで次のようなパイプをサポートすることでシンプルな実装を可能にする。
[* | / | # | @ text, #]
[* | / | @ text, # | #]
多引数が混在した時に非常に読みづらくなるのでここまで書いたがいらないかもと思い始めた
The README file should include sections on installation (using Nix and Cargo), build methods, compilation instructions, how to use the language server, how to participate in development, how to make plugins, licensing information, and CI badges.
脚注マクロの実装のために可変長引数が必要。フッターに置く脚注要素を引数に持つfootnoteFooterコマンドを実装したいため。
seq[string]
型の引数を可変長引数と見なす。
The workflows currently run by pushing and creating a pull request, but this does not have to be the case, for example updating .vscode/*
, README, and LICENSE.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.