aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/documentation
diff options
context:
space:
mode:
authorEduardo Julian2021-09-01 01:01:22 -0400
committerEduardo Julian2021-09-01 01:01:22 -0400
commit4051a1cbe0999ee22bc395b059ea1556bcc002a0 (patch)
treeb8a5a4ca830285eb83dfa84c9b7eecf82e2149b0 /stdlib/source/documentation
parent834ed92e323fd274c2da08c82a7d8785663e10be (diff)
Updates to the JS compiler.
Diffstat (limited to '')
-rw-r--r--stdlib/source/documentation/lux/ffi.js.lux73
-rw-r--r--stdlib/source/documentation/lux/meta/annotation.lux5
2 files changed, 74 insertions, 4 deletions
diff --git a/stdlib/source/documentation/lux/ffi.js.lux b/stdlib/source/documentation/lux/ffi.js.lux
new file mode 100644
index 000000000..72ee6ef34
--- /dev/null
+++ b/stdlib/source/documentation/lux/ffi.js.lux
@@ -0,0 +1,73 @@
+(.module:
+ [library
+ [lux (#- int char type :as)
+ ["$" documentation (#+ documentation:)]
+ [data
+ ["." text (#+ \n)
+ ["%" format (#+ format)]]]
+ [macro
+ ["." template]]]]
+ [\\library
+ ["." /]])
+
+(documentation: /.null
+ "The null pointer.")
+
+(documentation: /.import:
+ "Easily import types, methods, functions and constants."
+ [(import: Uint8Array)
+
+ (import: TextEncoder
+ ["#::."
+ (new [/.String])
+ (encode [/.String] Uint8Array)])
+
+ (import: TextDecoder
+ ["#::."
+ (new [/.String])
+ (decode [/.String] String)])])
+
+(documentation: /.type_of
+ "The type of an object, as text."
+ [(= "boolean"
+ (type_of #1))]
+ [(= "number"
+ (type_of +123.456))]
+ [(= "string"
+ (type_of "789"))]
+ [(= "function"
+ (type_of (function (_ value) value)))])
+
+(documentation: /.constant
+ "Allows using definitions from the JavaScript host platform."
+ [(constant .Frac [Math PI])])
+
+(documentation: /.closure
+ (format "Allows defining closures/anonymous-functions in the form that JavaScript expects."
+ \n "This is useful for adapting Lux functions for usage by JavaScript code.")
+ [(: /.Function
+ (closure [left right]
+ (do_something (:as Foo left) (:as Bar right))))])
+
+(.def: .public documentation
+ (.List $.Module)
+ ($.module /._
+ ""
+ [..null
+ ..import:
+ ..type_of
+ ..constant
+ ..closure
+ ($.default (/.Object brand))
+ ($.default /.Function)
+ ($.default /.Symbol)
+ ($.default /.Null)
+ ($.default /.Undefined)
+ ($.default /.Boolean)
+ ($.default /.Number)
+ ($.default /.String)
+ ($.default /.null?)
+ ($.default /.on_browser?)
+ ($.default /.on_nashorn?)
+ ($.default /.on_node_js?)]
+ []))
diff --git a/stdlib/source/documentation/lux/meta/annotation.lux b/stdlib/source/documentation/lux/meta/annotation.lux
index c46961d3a..2ddb4826a 100644
--- a/stdlib/source/documentation/lux/meta/annotation.lux
+++ b/stdlib/source/documentation/lux/meta/annotation.lux
@@ -46,9 +46,6 @@
..tuple
..record
($.default /.Annotation)
- ($.default /.documentation)
($.default /.flagged?)
- ($.default /.implementation?)
- ($.default /.function_arguments)
- ($.default /.type_arguments)]
+ ($.default /.implementation?)]
[]))