9
面向 JS 的新兴编程语言 Melody Lang
source link: https://www.oschina.net/p/melody-lang
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Melody 是一种可将代码编译为 ECMAScript 正则表达式的语言,旨在更易于阅读和维护。
注意:这些是当前支持的语法,可能会改变
Batman Theme
16 of "na"; 2 of match { <space>; "batman"; } // 🦇🦸 ♂️
(?:na){16}(?: batman){2}
Twitter Hashtag
"#"; some of <word>; // #melody
#\\w+
Introductory Courses
some of <alphabetic>; <space>; "1"; 2 of <digit>; // classname 1xx
[a-zA-Z]+ 1\\d{2}
Indented Code (2 spaces)
some of match { 2 of <space>; } some of <char>; ";"; // let value = 5;
(?: {2})+.+;
Cargo
cargo install melody_cli
git clone https://github.com/yoav-lavi/melody.git cd melody cargo install --path crates/melody_cli
Binary
- macOS binaries (aarch64 and x86_64) 可从 release 页面下载
展开阅读全文
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK