not everything is an expression (most notably assignments)
还没有人认领这个 Issue。
评估
调研方向
在在线编译器中重现列出的 Moon 示例,并将 parser/compiler 表达式案例与编辑器样式请求分开。检查该语言对表达式和赋值的处理,然后根据生成的 Lua 验证选定的案例;对于 UI 项,检查 prism-editor__container,并确认整个 textarea 都可以点击。在实现之前就更窄的范围达成一致。
由索引模型根据 Issue 内容生成。
描述
hi, I've been using yuescript for a little bit now so I feel pretty familiar with the language. here are some example things that I thought should have worked:
-- parens not working
if (old_val = @v) != new_val
@v = new_val
-- working
old_val = @v
if old_val != new_val
@v = new_val
-- assignment not working
lala = (fn) ->
print "fn:", fn
fn(math.rand!)
lala listener = (val) -> print val -- left hand expression is not assignable
lala (listener = (val) -> print val) -- syntax error
-- working
lala = (fn) ->
print "fn:", fn
fn(math.rand!)
listener = (val) -> print val
lala listener
-- iter not returned
perm = (a) ->
co = coroutine.create ->
permgen a, #a
return -- necessary cause no way to specify no return
iter = ->
code, res = coroutine.resume co
res
-- working
perm = (a) ->
co = coroutine.create ->
permgen a, #a
return -- necessary cause no way to specify no return
iter = ->
code, res = coroutine.resume co
res
iter
-- ideally, I'd like to write:
perm = (a) ->
co = coroutine.create !->
permgen a, #a
iter = ->
code, res = coroutine.resume co
res
-- doesn't consider last expression of do-statement as module value
export default module = do
{foo: true}
-- also, it doesn't think that the assignment is an expression
module = do
lala = {foo: true}
export default module
-- working
module = do
lala = {foo: true}
lala
export default module
-- also works
export default do
{foo: true}
in general I really like the language. I've got a lot of ideas as well for improvements to the language:
- if x isnt nil (is/isnt keywords)
- type val is "function" (compiles to
type(val) == "function"instead oftype(val == "function")) - type val is \function (single backslash is single word text)
- !(var) -> ... (no return)
- !-> ... (no return)
- comma on next line extends function:
lala (v1, v1) -> print v1, v2 , var1 , var2
lastly, the online compiler is quite valuable for seeing what yue compiles to and I really like it.
however, the text area only allows me to click on the top.
this can easily be fixed by setting prism-editor__container to have min-height: 100%. (seen below)
edit: that should be 'min-height' (screenshot invalid)
cheers!
- 主要语言
- Lua
- 星标
- 620
- 派生
- 45
- 平均合并
- 9 小时 5 分钟
- 30 天内合并 PR
- 1
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
IppClub/YueScript 的其他 Issue
-
难度 3/5 1-2 天 新手友好度 64/100
-
难度 4/5 3-5 天 新手友好度 48/100
-
难度 3/5 1-2 天 新手友好度 35/100
-
难度 5/5 一周以上 新手友好度 25/100
-
难度 5/5 一周以上 新手友好度 25/100
查看 IppClub/YueScript 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 2 天内回复
-
follow-up
难度 2/5 1-3 小时 新手友好度 78/100
ksysoev/duet.nvim#265 · 1 条评论 ·
维护者通常 1 天内回复
-
bug: accuracy
难度 2/5 1-3 小时 新手友好度 72/100
PathOfBuildingCommunity/PathOfBuilding#10649 ·
维护者通常 1 天内回复
-
reMarkable
难度 2/5 1-3 小时 新手友好度 78/100
koreader/koreader#16485 · 1 条评论 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 76/100
nvim-orgmode/orgmode#1213 ·