Home

Awesome

<p align="center"> <img src="https://github.com/antfu/wenyan-lang-vscode/raw/master/screenshots/logo-with-text.png" alt="logo" width="500"/> </p> <p align="center"> <a href="https://marketplace.visualstudio.com/items?itemName=antfu.wenyan-lang" target="__blank"><img src="https://img.shields.io/visual-studio-marketplace/v/antfu.wenyan-lang.svg?color=blue&amp;label=VSCode%20Marketplace&amp;logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2aWV3Qm94PSIwIDAgMjU2IDI1NiI+PGRlZnM+PHN0eWxlPi5he2ZpbGw6I2ZmZjt9LmEsLmd7ZmlsbC1ydWxlOmV2ZW5vZGQ7fS5ie21hc2s6dXJsKCNhKTt9LmN7ZmlsbDojMDA2NWE5O30uZHtmaWxsOiMwMDdhY2M7fS5le2ZpbGw6IzFmOWNmMDt9LmZ7b3BhY2l0eTowLjI1O30uZ3tmaWxsOnVybCgjYik7fTwvc3R5bGU+PG1hc2sgaWQ9ImEiIHg9Ii0wLjE2IiB5PSIwLjY2IiB3aWR0aD0iMjU2LjE2IiBoZWlnaHQ9IjI1NC42OCIgbWFza1VuaXRzPSJ1c2VyU3BhY2VPblVzZSI+PHBhdGggY2xhc3M9ImEiIGQ9Ik0xODEuNTMsMjU0LjI1YTE1LjkzLDE1LjkzLDAsMCwwLDEyLjctLjQ5bDUyLjcxLTI1LjM2QTE2LDE2LDAsMCwwLDI1NiwyMTRWNDJhMTYsMTYsMCwwLDAtOS4wNi0xNC40MkwxOTQuMjMsMi4yNEExNS45NCwxNS45NCwwLDAsMCwxNzgsMy43YTE2LjMsMTYuMywwLDAsMC0xLjkxLDEuNjNMNzUuMTUsOTcuMzksMzEuMiw2NGExMC42NSwxMC42NSwwLDAsMC0xMy42MS42MUwzLjQ5LDc3LjQ1YTEwLjY4LDEwLjY4LDAsMCwwLDAsMTUuNzhM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version" /></a> <a href="https://marketplace.visualstudio.com/items?itemName=antfu.wenyan-lang" target="__blank"><img src="https://img.shields.io/visual-studio-marketplace/d/antfu.wenyan-lang.svg?color=4bdbe3" alt="Visual Studio Marketplace Downloads" /></a> <a href="https://marketplace.visualstudio.com/items?itemName=antfu.wenyan-lang" target="__blank"><img src="https://img.shields.io/visual-studio-marketplace/i/antfu.wenyan-lang.svg?color=63ba83" alt="Visual Studio Marketplace Installs" /></a> <a href="https://marketplace.visualstudio.com/items?itemName=antfu.wenyan-lang" target="__blank"><img src="https://vsmarketplacebadge.apphb.com/trending-monthly/antfu.wenyan-lang.svg?color=a1b858" alt="Marketplace Trending Monthly" /></a> <br/> <a href="https://github.com/antfu/wenyan-lang-vscode" target="__blank"><img src="https://img.shields.io/github/last-commit/antfu/wenyan-lang-vscode.svg?color=a38eed" alt="GitHub last commit" /></a> <a href="https://github.com/antfu/wenyan-lang-vscode/issues" target="__blank"><img src="https://img.shields.io/github/issues/antfu/wenyan-lang-vscode.svg?color=c977be" alt="GitHub issues" /></a> <a href="https://github.com/antfu/wenyan-lang-vscode" target="__blank"><img alt="GitHub stars" src="https://img.shields.io/github/stars/antfu/wenyan-lang-vscode?style=social"></a> </p> <p align="center"> for <a href='https://github.com/LingDong-/wenyan-lang' target="__blank">文言 Wenyan Lang, a programming language for the ancient Chinese.</a> </p>

Compile & Execute

View the compiled Javascript side by side or Direct execute it.

The compiler is shipped with this extension, no installation required.

Punctuations Replacement

Punctuations will be automatically replaced to fit the language.

You will get the result immediately, the delay is added for demostraction purpose

Snippets

You can write Wenyan quickly by using snippets:

Here are some common snippets. For full list, check out this file.

TriggersSnippet
if若⋯者。⋯也。
else若非。⋯也。
for為是⋯遍。⋯云云。
break乃止。
while恆為是。⋯云云。
function吾有一術。名之曰「⋯」。是術曰。
int吾有一數。曰⋯。名之曰「⋯」。
str吾有一言。曰「「⋯」」。名之曰「⋯」。
bool吾有一爻。曰陰。名之曰「⋯」。
array吾有一列。名之曰「⋯」。
object吾有一物。名之曰「⋯」。

Wenyanizer by @zxch3n

From v0.10.0, we shipped support for compiling Javascript back to Wenyan. Thanks for @zxch3n's great work!

Configurations

FieldsDefaultNote
wenyan-lang.executablePathbuilt-inFilepath to executable wenyan.js
wenyan-lang.targetLanguagejavascriptTarget language that compiles to. Can be javascript, python or ruby
wenyan-lang.runOnSavetrueExecute the code on save
wenyan-lang.romanizeMethodnullRomanize identifiers. The method can be pinyin, baxter or unicode

ToDo

License

MIT License © 2019-2020 Anthony Fu