Coder Social home page Coder Social logo

brack's People

Contributors

momeemt avatar uekann avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

brack's Issues

Implement Diagnostic Message

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.

Implementing function signature extraction from Wasm modules for Completion feature in language server

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.

マクロの実装

概要

現状の実装では脚注を実装できない。

  • コマンドは単に展開されるためそのコマンド外に影響を持つように展開できない
    • 脚注はリンク先(主にフッター)に展開する必要がある
  • コマンドは他のコマンドの情報を入手できない
    • 脚注は自身が何番目の脚注なのかを知る必要がある

特定のコマンドを特別視することはBrackの**に反するので、別の解決策を取りたい。

考えうる解決策

  • コマンドはcontextを受け取る

    • 他のコマンドの情報を渡す
    • もしくは扱いやすい形にしたASTを直接渡しても良いと思う
      • これは読み取り専用
  • マクロを実装してASTを変更する

    • 拡張性があって良いと思う
    • 一方でマクロの実装はかなり難しい...
      • マクロについて先に解釈して、全てのマクロがコマンドに変換されるまで読み続ける?

エスケープの実装

概要

現在は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レベルのマクロの実装に取り組む。

Add a README file

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.

Divides into crates and constructs a workspace

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.

可変長引数の実装

概要

脚注マクロの実装のために可変長引数が必要。フッターに置く脚注要素を引数に持つfootnoteFooterコマンドを実装したいため。

実装

seq[string]型の引数を可変長引数と見なす。

【RFC】パイプの実装

概要

複数の装飾で、かつほぼデフォルトのコマンドの組み合わせであるような場合、次のようなマークアップになる。

[* [/ [# [@ text, #]]]]

しかしこれは煩雑である。また、新しいコマンドを定義しても良いが再利用されない場合もやや億劫。
そこで次のようなパイプをサポートすることでシンプルな実装を可能にする。

[* | / | # | @ text, #]
[* | / | @ text, # | #]

多引数が混在した時に非常に読みづらくなるのでここまで書いたがいらないかもと思い始めた

Replace `TokenData` with `Location`

Overview

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.