extemporelang / extemporelang.github.io

Extempore docs website
MIT License
71 stars 26 forks source link

Fix typo #16

Closed cyblue9 closed 5 years ago

cyblue9 commented 5 years ago

Maybe the type.

Please review!

benswift commented 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 🙂

cyblue9 commented 5 years ago

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?

benswift commented 5 years ago

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 👍

cyblue9 commented 5 years ago

@benswift Thank for review and advice!

benswift commented 5 years ago

no worries