Skip to content

Conversation

@cyblue9
Copy link
Contributor

@cyblue9 cyblue9 commented Nov 3, 2018

Maybe the type.

Please review!

@benswift benswift merged commit 17b53ef into extemporelang:master Nov 4, 2018
@benswift
Copy link
Contributor

benswift commented Nov 4, 2018

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 cyblue9 deleted the feature/fix_typo branch November 7, 2018 07:41
@cyblue9
Copy link
Contributor Author

cyblue9 commented Nov 7, 2018

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.(highlightjs/highlight.js#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
Copy link
Contributor

benswift commented Nov 9, 2018

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
Copy link
Contributor Author

cyblue9 commented Nov 9, 2018

@benswift
Thank for review and advice!

@benswift
Copy link
Contributor

benswift commented Nov 9, 2018

no worries

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants