Skip to content

Commit

Permalink
feat(stdlib.norg): implement #eval macro
Browse files Browse the repository at this point in the history
  • Loading branch information
vhyrro committed May 11, 2023
1 parent 465a04f commit b7c55e4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions stdlib.norg
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ This document is a real implementation of the Norg standard library.
This includes all carryover tags, ranged tags and their behaviours.
|end

This defines the entry point for the Neorg standard library:
.stdlib stdlib.janet

=macro name params* >next
#eval
@code janet
Expand Down Expand Up @@ -197,3 +194,7 @@ This defines the entry point for the Neorg standard library:
%Yup, this is the implementation of `comment`%
=comment ...
=end

=eval language-name? &captures* >code
.invoke-janet (neorg/execute (or &language-name& (neorg/ast/ranged-verbatim-tag/parameter &code& 0) (error "Language type to execute could not be inferred!")) \[&captures&\] (or (neorg/ast/ranged-verbatim-tag? &code& "code") (error "Expected code block to follow `#eval` block!")))
=end

0 comments on commit b7c55e4

Please sign in to comment.