Skip to content

Commit

Permalink
Added support for radian and turn Decimal literals.
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardoejp committed Feb 23, 2024
1 parent 6135fed commit ad983b0
Show file tree
Hide file tree
Showing 199 changed files with 975 additions and 472 deletions.
12 changes: 6 additions & 6 deletions lux-cl/source/program.lux
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
["[0]" maybe]
["[0]" try (.only Try)]
["[0]" exception (.only Exception)]
["[0]" io (.only IO io)]
[concurrency
["[0]" promise (.only Promise)]]]
["[0]" io (.only IO io)]]
[concurrency
["[0]" future (.only Future)]]
[data
["[0]" text (.use "[1]#[0]" hash)
["%" \\injection]
Expand Down Expand Up @@ -409,8 +409,8 @@

(the (declare_success! _)
(-> Any
(Promise Any))
(promise.soon (by world/program.default exit +0)))
(Future Any))
(future.soon (by world/program.default exit +0)))

(the (then pre post)
(-> (_.Expression Any) (_.Expression Any)
Expand All @@ -433,7 +433,7 @@
(let [extension ".cl"]
(do io.monad
[platform ..platform]
(exec (do promise.monad
(exec (do future.monad
[_ (/.compiler [/static.#host .common_lisp
/static.#host_module_extension extension
/static.#target (/cli.target service)
Expand Down
12 changes: 7 additions & 5 deletions lux-js/source/program.lux
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@
["[0]" maybe (.use "[1]#[0]" monad)]
["[0]" try (.only Try)]
["[0]" exception (.only Exception)]
["[0]" io (.only IO io)]
["[0]" function]]
["[0]" io (.only IO io)]]
[concurrency
["[0]" future (.only Future)]]
["[0]" function]
[data
["[0]" product]
[text
Expand All @@ -31,10 +33,10 @@
["[0]" world
["[0]" file]
["[0]" environment]]
[macro
["^" pattern]
["[0]" template]]
[meta
[macro
["^" pattern]
["[0]" template]]
[compiler
[reference
[register (.only Register)]]
Expand Down
16 changes: 9 additions & 7 deletions lux-lua/source/program.lux
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@
["[0]" maybe]
["[0]" try (.only Try)]
["[0]" exception (.only Exception)]
["[0]" io (.only IO io)]
["[0]" function]]
["[0]" io (.only IO io)]]
[concurrency
["[0]" future (.only Future)]]
["[0]" function]
[data
["[0]" text (.use "[1]#[0]" hash)
["%" \\injection]
Expand All @@ -26,14 +28,14 @@
[number (.only hex)
["n" natural]
["[0]" i64]]]
[macro
["^" pattern]
["[0]" local]
["[0]" expansion]
["[0]" template]]
[meta
["[0]" static]
["[0]" code]
[macro
["^" pattern]
["[0]" local]
["[0]" expansion]
["[0]" template]]
["[0]" compiler
[target
["_" lua]]
Expand Down
10 changes: 6 additions & 4 deletions lux-mode/lux-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,9 @@ Called by `imenu--generic-function'."
;; https://www.emacswiki.org/emacs/RegularExpression
(defconst lux-font-lock-keywords
(eval-when-compile
(let* ((unit "[°g%‰‱]")
(let* ((natural_unit "[°g%‰‱]")
(decimal_unit (altRE natural_unit
"[πτ]"))

(natural "[0-9][0-9,]*")

Expand All @@ -358,13 +360,13 @@ Called by `imenu--generic-function'."
(revolution (concat decimal_separator natural))
(decimal (concat integer revolution
"\\(\\(e\\|E\\)" integer "\\)?"
unit "?"))
decimal_unit "?"))

(fraction_separator "/")
(fraction (altRE (concat natural fraction_separator natural)
(concat natural unit)))
(concat natural natural_unit)))
(rational (altRE (concat integer fraction_separator natural)
(concat integer unit)))
(concat integer natural_unit)))

(identifier_h|label "#")
(identifier_h|type "[:upper:]")
Expand Down
8 changes: 4 additions & 4 deletions lux-php/source/program.lux
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
[abstract
["[0]" monad (.only do)]]
[concurrency
["[0]" promise (.only Promise)]]
["[0]" future (.only Future)]]
[control
["[0]" pipe]
["[0]" maybe]
Expand Down Expand Up @@ -564,15 +564,15 @@
(as_expected handler)))

(the (declare_success! _)
(-> Any (Promise Any))
(promise.soon (by world/program.default exit +0)))
(-> Any (Future Any))
(future.soon (by world/program.default exit +0)))

(`` (the _
(program [service /cli.service]
(let [extension ".php"]
(do io.monad
[platform ..platform]
(exec (do promise.monad
(exec (do future.monad
[_ (/.compiler [/static.#host .php
/static.#host_module_extension extension
/static.#target (/cli.target service)
Expand Down
12 changes: 6 additions & 6 deletions lux-python/source/program.lux
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
["[0]" maybe]
["[0]" try (.only Try) (.use "[1]#[0]" monad)]
["[0]" exception (.only Exception)]
["[0]" io (.only IO io)]
["[0]" function]]
["[0]" io (.only IO io)]]
["[0]" function]
[data
["[0]" text (.use "[1]#[0]" hash)
["%" \\injection]
Expand All @@ -30,13 +30,13 @@
[number
["n" natural]
["[0]" i64]]]
[macro
["^" pattern]
["[0]" template]
["[0]" expansion]]
[meta
["[0]" static]
["[0]" code]
[macro
["^" pattern]
["[0]" template]
["[0]" expansion]]
["[0]" compiler
[reference
[register (.only Register)]]
Expand Down
8 changes: 4 additions & 4 deletions lux-r/source/program.lux
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
[abstract
["[0]" monad (.only do)]]
[concurrency
["[0]" promise (.only Promise)]]
["[0]" future (.only Future)]]
[control
["[0]" pipe]
["[0]" maybe]
Expand Down Expand Up @@ -590,8 +590,8 @@
(as_expected handler)))

(the (declare_success! _)
(-> Any (Promise Any))
(promise.soon (by world/program.default exit +0)))
(-> Any (Future Any))
(future.soon (by world/program.default exit +0)))

(the (scope body)
(-> _.Expression _.Expression)
Expand All @@ -606,7 +606,7 @@
(let [extension ".r"]
(do io.monad
[[interpreter platform] ..platform]
(exec (do promise.monad
(exec (do future.monad
[_ (/.compiler [/static.#host .r
/static.#host_module_extension extension
/static.#target (/cli.target service)
Expand Down
6 changes: 3 additions & 3 deletions lux-ruby/source/program.lux
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@
["n" natural]
["i" integer]
["[0]" i64]]]
[macro
["^" pattern]
["[0]" template]]
[meta
[macro
["^" pattern]
["[0]" template]]
["[0]" compiler
[reference
[register (.only Register)]]
Expand Down
4 changes: 2 additions & 2 deletions stdlib/source/injection/lux/data/binary.lux
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
[abstract
[monoid (.only Monoid)]]
[control
["|" pipe]
["[0]" function]]
["|" pipe]]
["[0]" function]
[data
["[0]" product]
[text
Expand Down
5 changes: 2 additions & 3 deletions stdlib/source/library/lux/abstract/interval.lux
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
(.using
[library
[lux (.except)
[control
[function
[predicate (.only Predicate)]]]]]
[function
[predicate (.only Predicate)]]]]
[//
[equivalence (.only Equivalence)]
[enum (.only Enum)]
Expand Down
59 changes: 33 additions & 26 deletions stdlib/source/library/lux/abstract/order.lux
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
(.using
[library
[lux (.except)
[control
["[0]" function]]]]
["[0]" function]]]
[//
["[0]" equivalence (.only Equivalence)]
[functor
Expand Down Expand Up @@ -72,30 +71,38 @@
(list [_ {.#Tuple '*type_parameters}] 'type 'order)
(do meta#monad
['_ (generated_name "'_")
'parameter (generated_name "'parameter")
'subject (generated_name "'subject")]
(in (list (` (the .public ((,' <) (, 'parameter) (, 'subject))
(for_any ((, '_) (,* '*type_parameters))
(-> (, 'type) (, 'type)
.Bit))
(by (, 'order) (,' <) (, 'parameter) (, 'subject))))
(` (the .public ((,' >) (, 'parameter) (, 'subject))
(for_any ((, '_) (,* '*type_parameters))
(-> (, 'type) (, 'type)
.Bit))
(by (, 'order) (,' <) (, 'subject) (, 'parameter))))
(` (the .public ((,' <=) (, 'parameter) (, 'subject))
(for_any ((, '_) (,* '*type_parameters))
(-> (, 'type) (, 'type)
.Bit))
(or (by (, 'order) (,' <) (, 'parameter) (, 'subject))
(by (, 'order) (,' =) (, 'parameter) (, 'subject)))))
(` (the .public ((,' >=) (, 'parameter) (, 'subject))
(for_any ((, '_) (,* '*type_parameters))
(-> (, 'type) (, 'type)
.Bit))
(or (by (, 'order) (,' <) (, 'subject) (, 'parameter))
(by (, 'order) (,' =) (, 'parameter) (, 'subject))))))))
'reference (generated_name "'reference")
'it (generated_name "'it")
.let [order_type (` (for_any ((, '_) (,* '*type_parameters))
(-> (, 'type) (, 'type)
.Bit)))
choice_type (` (for_any ((, '_) (,* '*type_parameters))
(-> (, 'type) (, 'type)
(, 'type))))]]
(in (list (` (the .public ((,' <) (, 'reference) (, 'it))
(, order_type)
(by (, 'order) (,' <) (, 'reference) (, 'it))))
(` (the .public ((,' >) (, 'reference) (, 'it))
(, order_type)
(by (, 'order) (,' <) (, 'it) (, 'reference))))
(` (the .public ((,' <=) (, 'reference) (, 'it))
(, order_type)
(or (by (, 'order) (,' <) (, 'reference) (, 'it))
(by (, 'order) (,' =) (, 'reference) (, 'it)))))
(` (the .public ((,' >=) (, 'reference) (, 'it))
(, order_type)
(or (by (, 'order) (,' <) (, 'it) (, 'reference))
(by (, 'order) (,' =) (, 'reference) (, 'it)))))
(` (the .public ((,' minor) (, 'reference) (, 'it))
(, choice_type)
(if (by (, 'order) (,' <) (, 'reference) (, 'it))
(, 'it)
(, 'reference))))
(` (the .public ((,' major) (, 'reference) (, 'it))
(, choice_type)
(if (by (, 'order) (,' <) (, 'reference) (, 'it))
(, 'reference)
(, 'it)))))))

_
(failure .wrong_syntax)))))
6 changes: 3 additions & 3 deletions stdlib/source/library/lux/algorithm/any.lux
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
[lux (.except)
[control
[error (.only error)]
["[0]" try (.only Try)]
[function
[predicate (.only Predicate)]]]
["[0]" try (.only Try)]]
[function
[predicate (.only Predicate)]]
[data
["[0]" product]]]]
["[0]" //])
Expand Down
5 changes: 2 additions & 3 deletions stdlib/source/library/lux/algorithm/any?.lux
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
(.using
[library
[lux (.except)
[control
[function
[predicate (.only Predicate)]]]
[function
[predicate (.only Predicate)]]
[data
["[0]" product]]]]
["[0]" //])
Expand Down
5 changes: 2 additions & 3 deletions stdlib/source/library/lux/algorithm/empty?.lux
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
(.using
[library
[lux (.except)
[control
[function
[predicate (.only Predicate)]]]
[function
[predicate (.only Predicate)]]
[data
["[0]" product]]]]
["[0]" //])
Expand Down
5 changes: 2 additions & 3 deletions stdlib/source/library/lux/algorithm/every?.lux
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
(.using
[library
[lux (.except)
[control
[function
[predicate (.only Predicate)]]]
[function
[predicate (.only Predicate)]]
[data
["[0]" product]]]]
["[0]" //])
Expand Down
6 changes: 3 additions & 3 deletions stdlib/source/library/lux/algorithm/item.lux
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
[lux (.except)
[control
[error (.only error)]
["[0]" try (.only Try)]
[function
[predicate (.only Predicate)]]]
["[0]" try (.only Try)]]
[function
[predicate (.only Predicate)]]
[data
["[0]" product]]
[math
Expand Down
3 changes: 1 addition & 2 deletions stdlib/source/library/lux/algorithm/size.lux
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
(.using
[library
[lux (.except)
[control
["[0]" function]]
["[0]" function]
[data
["[0]" product]]
[math
Expand Down
Loading

0 comments on commit ad983b0

Please sign in to comment.