0.0.17 • Published 2 years ago

@rmw/coffee-label-patch v0.0.17

Weekly downloads
-
License
AGPL-3.0
Repository
github
Last release
2 years ago

@rmw/coffee-label-patch

Make coffeescript support :label syntax (similar to livescript) so that it can be used for svelte.

It's too hard to modify the compiler based on lex, ast, and I did this based on string substitution.

This is just a crude hack, but it does work.

Expect coffee to officially add this syntax.

Install

yarn add @rmw/coffee-label-patch or npm install @rmw/coffee-label-patch

Use

#include ./test/index.coffee

output :

#include ./test.out.js

then node test.out.js , stdout is

1 4
1 5
1 6
2 4

中文说明

让 coffeescript 支持 :label 语法(类似 livescript),这样就可以用于 svelte

基于 lex 、 ast 去修改编译器太难了,我基于字符串替换做到这个功能。

这只是一个粗糙的hack。但它的确能工作。

期待coffee正式加入此语法。

关于

本项目隶属于人民网络(rmw.link) 代码计划。

人民网络

0.0.13

2 years ago

0.0.14

2 years ago

0.0.15

2 years ago

0.0.16

2 years ago

0.0.17

2 years ago

0.0.12

2 years ago

0.0.11

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago