Closed cyblue9 closed 5 years ago
Thanks. I don't suppose you've got any js experience? If so then this issue is probably the best bang-for-buck contribution to the docs at the moment. But I realise it's an "out-of-band" issue 🙂
Hi, @benswift
Thank for merge!😁
If so then this issue is probably the best bang-for-buck contribution to the docs at the moment.
Oh, It's a very exciting problem!!!
I tried it.(https://github.com/highlightjs/highlight.js/pull/1902)
example:
xtlang code
(bind-func xtlang_closure
(lambda (c:double d:i64)
(let ((result (* c (i64tod d))))
(printf "result = %f\n" result)
result)))
(xtlang_closure 4.5 2) ;; prints "result = 9.000000", returns 9.0
after parse
(<span class="hljs-keyword">bind-func <span class="hljs-title">xtlang_closure</span></span>
(<span class="hljs-keyword">lambda</span> (<span class="hljs-variable">c</span><span class="hljs-type">:double</span> <span class="hljs-variable">d</span><span class="hljs-type">:i64</span>)
(<span class="hljs-keyword">let</span> ((<span class="hljs-variable">result</span> (<span class="hljs-funciton">*</span> <span class="hljs-variable">c</span> (<span class="hljs-funciton">i64tod</span> <span class="hljs-variable">d</span>))))
(<span class="hljs-funciton">printf</span> <span class="hljs-string">"result = %f\n"</span> <span class="hljs-variable">result</span>)
<span class="hljs-variable">result</span>)))
(<span class="hljs-variable">xtlang_closure</span> <span class="hljs-number">4.5</span> <span class="hljs-number">2</span>) <span class="hljs-comment">;; prints "result = 9.000000", returns 9.0</span>
I implemented it so that it behaves like the Pygments.
I confirmed the tests/core/xtlang.xtm
, but there was no problem. Everything is OK!😊
Is the output XHTML tag right?
Great, thanks. Seems ok - there are always edge cases with this sort of thing, but we can catch them as they come up. Hopefully it's not too much trouble to get it to land upstream.
Thanks very much 👍
@benswift Thank for review and advice!
no worries
Maybe the type.
Please review!