mirror of
https://github.com/janet-lang/janet
synced 2025-11-19 00:35:11 +00:00
Better printing for complex constants.
Also added stub for checking if constants are valid in IR, but it is not currently used.
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
(def name-to-type @{})
|
||||
(def slot-types @{})
|
||||
(def functions @{})
|
||||
(def type-fields @{})
|
||||
|
||||
(defn get-slot
|
||||
[&opt new-name]
|
||||
@@ -105,6 +106,12 @@
|
||||
(symbol? code)
|
||||
(named-slot code)
|
||||
|
||||
# Array literals
|
||||
(and (tuple? code) (= :brackets (tuple/type code)))
|
||||
(do
|
||||
(assert type-hint (string/format "unknown type for array literal %v" code))
|
||||
~(,type-hint ,code))
|
||||
|
||||
# Compile forms
|
||||
(and (tuple? code) (= :parens (tuple/type code)))
|
||||
(do
|
||||
|
||||
Reference in New Issue
Block a user