From 5b50e2ed51c37f959a06923c8d7dfd99f0c926e4 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Fri, 22 Oct 2021 00:54:07 -0400 Subject: FIXED analysis extensions got reset and new ones would be unavailable. --- documentation/bookmark/Abstract interpretation.md | 4 - documentation/bookmark/abstract_interpretation.md | 5 + documentation/bookmark/back_end/graal.md | 4 + documentation/bookmark/back_end/haskell.md | 1 + .../bookmark/back_end/micro_controller.md | 4 + documentation/bookmark/back_end/wasm.md | 1 + documentation/bookmark/browser.md | 53 ------ documentation/bookmark/concurrency/ownership.md | 8 + documentation/bookmark/database.md | 1 + documentation/bookmark/game_programming.md | 1 + documentation/bookmark/lazy_evaluation.md | 1 + documentation/bookmark/math.md | 4 + documentation/bookmark/optimization.md | 6 +- documentation/bookmark/security.md | 9 + documentation/bookmark/tool/text_editor.md | 4 + .../localization_and_internationalization.md | 4 + documentation/bookmark/web_browser.md | 54 ++++++ lux-js/commands.md | 6 +- lux-js/project.lux | 10 +- stdlib/project.clj | 2 +- stdlib/project.lux | 4 +- stdlib/source/library/lux/data/collection/list.lux | 18 +- stdlib/source/library/lux/data/format/css.lux | 115 +++++++---- .../library/lux/data/format/css/property.lux | 24 ++- .../source/library/lux/data/format/css/query.lux | 2 +- .../library/lux/data/format/css/selector.lux | 30 +-- .../source/library/lux/data/format/css/style.lux | 32 ++-- .../source/library/lux/data/format/css/value.lux | 211 +++++++++++---------- stdlib/source/library/lux/macro/syntax/export.lux | 6 +- .../language/lux/phase/extension/directive/lux.lux | 7 +- .../lux/tool/compiler/language/lux/version.lux | 2 +- stdlib/source/library/lux/world/file.lux | 8 +- 32 files changed, 385 insertions(+), 256 deletions(-) delete mode 100644 documentation/bookmark/Abstract interpretation.md create mode 100644 documentation/bookmark/abstract_interpretation.md create mode 100644 documentation/bookmark/back_end/graal.md create mode 100644 documentation/bookmark/back_end/micro_controller.md delete mode 100644 documentation/bookmark/browser.md create mode 100644 documentation/bookmark/concurrency/ownership.md create mode 100644 documentation/bookmark/user_interface/localization_and_internationalization.md create mode 100644 documentation/bookmark/web_browser.md diff --git a/documentation/bookmark/Abstract interpretation.md b/documentation/bookmark/Abstract interpretation.md deleted file mode 100644 index d98525f7c..000000000 --- a/documentation/bookmark/Abstract interpretation.md +++ /dev/null @@ -1,4 +0,0 @@ -# Reference - -1. ["Easy Abstract Interpretation with SPARTA" by Arnaud Venet and Jez Ng](https://www.youtube.com/watch?v=_fA7vkVJhF8) - diff --git a/documentation/bookmark/abstract_interpretation.md b/documentation/bookmark/abstract_interpretation.md new file mode 100644 index 000000000..ce790a93b --- /dev/null +++ b/documentation/bookmark/abstract_interpretation.md @@ -0,0 +1,5 @@ +# Reference + +1. [Principles of Abstract Interpretation](https://mitpress.mit.edu/books/principles-abstract-interpretation) +1. ["Easy Abstract Interpretation with SPARTA" by Arnaud Venet and Jez Ng](https://www.youtube.com/watch?v=_fA7vkVJhF8) + diff --git a/documentation/bookmark/back_end/graal.md b/documentation/bookmark/back_end/graal.md new file mode 100644 index 000000000..bd91d9218 --- /dev/null +++ b/documentation/bookmark/back_end/graal.md @@ -0,0 +1,4 @@ +# Reference + +1. [Anybody know how the graal project ties in with all of this? Is oracle effective... | Hacker News](https://news.ycombinator.com/item?id=19435964) + diff --git a/documentation/bookmark/back_end/haskell.md b/documentation/bookmark/back_end/haskell.md index aa77d723f..a8621380f 100644 --- a/documentation/bookmark/back_end/haskell.md +++ b/documentation/bookmark/back_end/haskell.md @@ -1,4 +1,5 @@ # Reference +1. [Thunks, Sharing, Laziness: The Haskell Heap Visualized – Joachim Breitner](https://www.youtube.com/watch?v=I4lnCG18TaY) 1. [Eta - Modern Haskell on the JVM](https://github.com/typelead/eta) diff --git a/documentation/bookmark/back_end/micro_controller.md b/documentation/bookmark/back_end/micro_controller.md new file mode 100644 index 000000000..2681cbf67 --- /dev/null +++ b/documentation/bookmark/back_end/micro_controller.md @@ -0,0 +1,4 @@ +# Reference + +1. [HaikuVM](http://haiku-vm.sourceforge.net/) + diff --git a/documentation/bookmark/back_end/wasm.md b/documentation/bookmark/back_end/wasm.md index ba278fb2f..002c0b31d 100644 --- a/documentation/bookmark/back_end/wasm.md +++ b/documentation/bookmark/back_end/wasm.md @@ -1,5 +1,6 @@ # Platform +1. [Wasmer Java](https://github.com/wasmerio/wasmer-java) 1. [WAVM: WAVM is a WebAssembly virtual machine, designed for use in non-web applications.](https://wavm.github.io/) # Exemplar diff --git a/documentation/bookmark/browser.md b/documentation/bookmark/browser.md deleted file mode 100644 index 5fc699317..000000000 --- a/documentation/bookmark/browser.md +++ /dev/null @@ -1,53 +0,0 @@ -# Exemplar - -1. [Stack](https://stackbrowser.com/) -1. [Flow: The super fast, multithreaded HTML5 browser from Ekioh](https://www.ekioh.com/flow-browser/) -1. https://refresh.study/ -1. https://github.com/breach/breach_core -1. https://github.com/browserhtml/browserhtml -1. https://depolium.com/ -1. https://vivaldi.com/ -1. https://www.nidium.com/ -1. https://github.com/trevorlinton/webkit.js -1. https://www.epicbrowser.com/ -1. https://minbrowser.github.io/min/ -1. https://www.palemoon.org/ -1. https://github.com/beakerbrowser/webdb -1. https://github.com/beakerbrowser -1. https://github.com/nEXT-Browser/nEXT -1. https://techcrunch.com/2018/02/23/veil-is-private-browsing-for-the-ultra-paranoid/ -1. https://github.com/wexond/wexond -1. http://next.atlas.engineer -1. https://workona.com/ -1. https://luakit.github.io/ -1. https://www.thurrott.com/cloud/web-browsers/204669/opera-web-browser-is-reborn - -# Security - -1. https://developers.google.com/web/updates/2018/06/feature-policy -1. https://cure53.de/#browser-security-whitepaper -1. https://anon.cosheaf.com/ -1. [Secure Browser Architecture Based on Hardware Virtualization](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.664.9527&rep=rep1&type=pdf) -1. https://medium.com/personal-capital-tech-blog/why-we-write-post-only-apis-f15108fb6558 - -# Performance - -1. https://github.com/slightlyoff/never_slow_mode - -# Reference - -1. [Public Suffix List](https://publicsuffix.org/) -1. [Public Suffix List Problems](https://github.com/sleevi/psl-problems) -1. https://www.opera.com/gx -1. https://evertpot.com/tabs-are-the-wrong-abstraction/ -1. http://news.mit.edu/2018/system-patches-private-browsing-0223 -1. https://vivaldi.com/blog/vivaldi-makes-history/?hl=en-us&version=1.8.770.56&os=W10.0.14393 -1. https://hacks.mozilla.org/2017/08/inside-a-super-fast-css-engine-quantum-css-aka-stylo/ -1. https://mozillagfx.wordpress.com/2017/09/21/introduction-to-webrender-part-1-browsers-today/ -1. https://noncombatant.org/2017/11/07/problems-of-urls/ -1. https://stoyannk.wordpress.com/2017/11/13/rendering-html-at-1000-fps-part-2/ -1. https://v8project.blogspot.com/2018/08/embedded-builtins.html -1. https://developers.google.com/web/updates/2018/09/inside-browser-part1 -1. https://addons.mozilla.org/en-US/firefox/addon/tree-style-tab/ -1. [Web Browser Engineering](https://browser.engineering/index.html) - diff --git a/documentation/bookmark/concurrency/ownership.md b/documentation/bookmark/concurrency/ownership.md new file mode 100644 index 000000000..d9be9959f --- /dev/null +++ b/documentation/bookmark/concurrency/ownership.md @@ -0,0 +1,8 @@ +# Reference + +1. []() + +# Language + +1. [Project Verona: Research programming language for concurrent ownership](https://microsoft.github.io/verona/) + diff --git a/documentation/bookmark/database.md b/documentation/bookmark/database.md index 0e27f89cf..8c07f0279 100644 --- a/documentation/bookmark/database.md +++ b/documentation/bookmark/database.md @@ -197,6 +197,7 @@ ## Graph +1. ["Asami: Turn your JSON into a Graph in 2 Lines" by Paula Gearon](https://www.youtube.com/watch?v=-XegX_K6w-o) 1. https://github.com/hugegraph/hugegraph 1. https://github.com/Microsoft/GraphEngine 1. https://redislabs.com/blog/release-redisgraph-v1-0-preview/ diff --git a/documentation/bookmark/game_programming.md b/documentation/bookmark/game_programming.md index d04e0def1..1865d7dd3 100644 --- a/documentation/bookmark/game_programming.md +++ b/documentation/bookmark/game_programming.md @@ -96,6 +96,7 @@ # Reference +1. ["Game Development in Eight Bits" by Kevin Zurawel](https://www.youtube.com/watch?v=TPbroUDHG0s) 1. [How to Make an RPG](https://howtomakeanrpg.com/) 1. https://mod.io/ 1. https://www.amazon.com/Game-Engine-Black-Book-Wolfenstein/dp/1539692876 diff --git a/documentation/bookmark/lazy_evaluation.md b/documentation/bookmark/lazy_evaluation.md index e20487b81..8e9a785fd 100644 --- a/documentation/bookmark/lazy_evaluation.md +++ b/documentation/bookmark/lazy_evaluation.md @@ -1,4 +1,5 @@ # Reference +1. [Promises Are Made to Be Broken: Migrating R to Strict Semantics](http://aviral.io/static/pdfs/promises-are-made-to-be-broken.pdf) 1. [Call-by-Need Is Clairvoyant Call-by-Value](http://www.cs.nott.ac.uk/~pszgmh/clairvoyant.pdf) diff --git a/documentation/bookmark/math.md b/documentation/bookmark/math.md index d27280e04..760e4d177 100644 --- a/documentation/bookmark/math.md +++ b/documentation/bookmark/math.md @@ -1,3 +1,7 @@ +# Logarithm + +1. [Logarithm: The Complete Guide (Theory & Applications)](https://mathvault.ca/logarithm-theory/) + # Ball arithmetic 1. [Ball arithmetic](http://www.texmacs.org/joris/ball/ball.html) diff --git a/documentation/bookmark/optimization.md b/documentation/bookmark/optimization.md index 6a773a929..a0492fb9f 100644 --- a/documentation/bookmark/optimization.md +++ b/documentation/bookmark/optimization.md @@ -8,6 +8,7 @@ # Compilation +1. [CompilerGym: Making compiler optimizations accessible to all](https://ai.facebook.com/blog/compilergym-making-compiler-optimizations-accessible-to-all) 1. [Future Directions for Optimizing Compilers](https://arxiv.org/abs/1809.02161) # Pre-fetching @@ -24,7 +25,10 @@ # Reference -1. [CompilerGym: Making compiler optimizations accessible to all](https://ai.facebook.com/blog/compilergym-making-compiler-optimizations-accessible-to-all) +1. [Refterm Lecture Part 1 - Philosophies of Optimization](https://www.youtube.com/watch?v=pgoetgxecw8) +1. [Optimizations enabled by -ffast-math](https://kristerw.github.io/2021/10/19/fast-math/) +1. [Simple Code, High Performance](https://www.youtube.com/watch?v=Ge3aKEmZcqY) +1. [Negotiating with Compilers](https://en.algorithmica.org/hpc/analyzing-performance/compilation/) 1. [Do Low-level Optimizations Matter?](https://cantrip.org/sortfast.html) 1. [Inline caching](https://bernsteinbear.com/blog/inline-caching/) 1. [Weird and Wonderful Division Tricks](https://saml98.github.io/jekyll/update/2020/02/21/weird-division.htmls) diff --git a/documentation/bookmark/security.md b/documentation/bookmark/security.md index ba0d282f2..7cfd9bc2a 100644 --- a/documentation/bookmark/security.md +++ b/documentation/bookmark/security.md @@ -1,3 +1,11 @@ +# Anti-Debugging + +1. [JavaScript AntiDebugging Tricks](https://x-c3ll.github.io/posts/javascript-antidebugging/) + +# Supply chain + +1. [chainguard](https://chainguard.dev/) + # Restraint | Sand-boxing 1. [JavaScript Restrictor](https://polcak.github.io/jsrestrictor/) @@ -83,6 +91,7 @@ # Reference +1. [Secure By Design](https://www.amazon.com/Secure-Design-Daniel-Deogun/dp/1617294357) 1. [Intro to Just-In-Time Access](https://compliance.dev/2021/04/29/introduction-to-just-in-time-access/) 1. https://www.nomoreransom.org/en/index.html 1. [Open Source Security Foundation (OpenSSF)](https://openssf.org/) diff --git a/documentation/bookmark/tool/text_editor.md b/documentation/bookmark/tool/text_editor.md index 3cd6aea03..c8d43be64 100644 --- a/documentation/bookmark/tool/text_editor.md +++ b/documentation/bookmark/tool/text_editor.md @@ -1,3 +1,7 @@ +# Code navigation + +1. ["Incremental, zero-config Code Nav using stack graphs" by Douglas Creager](https://www.youtube.com/watch?v=l2R1PTGcwrE) + # Rendering 1. [Text Rendering Hates You](https://gankra.github.io/blah/text-hates-you/) diff --git a/documentation/bookmark/user_interface/localization_and_internationalization.md b/documentation/bookmark/user_interface/localization_and_internationalization.md new file mode 100644 index 000000000..35d515e1c --- /dev/null +++ b/documentation/bookmark/user_interface/localization_and_internationalization.md @@ -0,0 +1,4 @@ +# Reference + +1. [How to design in every language at once](https://canvatechblog.com/how-to-design-in-every-language-at-once-f2dd66a2780f) + diff --git a/documentation/bookmark/web_browser.md b/documentation/bookmark/web_browser.md new file mode 100644 index 000000000..cc698019a --- /dev/null +++ b/documentation/bookmark/web_browser.md @@ -0,0 +1,54 @@ +# Exemplar + +1. [Stack](https://stackbrowser.com/) +1. [Flow: The super fast, multithreaded HTML5 browser from Ekioh](https://www.ekioh.com/flow-browser/) +1. https://refresh.study/ +1. https://github.com/breach/breach_core +1. https://github.com/browserhtml/browserhtml +1. https://depolium.com/ +1. https://vivaldi.com/ +1. https://www.nidium.com/ +1. https://github.com/trevorlinton/webkit.js +1. https://www.epicbrowser.com/ +1. https://minbrowser.github.io/min/ +1. https://www.palemoon.org/ +1. https://github.com/beakerbrowser/webdb +1. https://github.com/beakerbrowser +1. https://github.com/nEXT-Browser/nEXT +1. https://techcrunch.com/2018/02/23/veil-is-private-browsing-for-the-ultra-paranoid/ +1. https://github.com/wexond/wexond +1. http://next.atlas.engineer +1. https://workona.com/ +1. https://luakit.github.io/ +1. https://www.thurrott.com/cloud/web-browsers/204669/opera-web-browser-is-reborn + +# Security + +1. https://developers.google.com/web/updates/2018/06/feature-policy +1. https://cure53.de/#browser-security-whitepaper +1. https://anon.cosheaf.com/ +1. [Secure Browser Architecture Based on Hardware Virtualization](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.664.9527&rep=rep1&type=pdf) +1. https://medium.com/personal-capital-tech-blog/why-we-write-post-only-apis-f15108fb6558 + +# Performance + +1. https://github.com/slightlyoff/never_slow_mode + +# Reference + +1. [Web Browser Engineering](https://browser.engineering/) +1. [Public Suffix List](https://publicsuffix.org/) +1. [Public Suffix List Problems](https://github.com/sleevi/psl-problems) +1. https://www.opera.com/gx +1. https://evertpot.com/tabs-are-the-wrong-abstraction/ +1. http://news.mit.edu/2018/system-patches-private-browsing-0223 +1. https://vivaldi.com/blog/vivaldi-makes-history/?hl=en-us&version=1.8.770.56&os=W10.0.14393 +1. https://hacks.mozilla.org/2017/08/inside-a-super-fast-css-engine-quantum-css-aka-stylo/ +1. https://mozillagfx.wordpress.com/2017/09/21/introduction-to-webrender-part-1-browsers-today/ +1. https://noncombatant.org/2017/11/07/problems-of-urls/ +1. https://stoyannk.wordpress.com/2017/11/13/rendering-html-at-1000-fps-part-2/ +1. https://v8project.blogspot.com/2018/08/embedded-builtins.html +1. https://developers.google.com/web/updates/2018/09/inside-browser-part1 +1. https://addons.mozilla.org/en-US/firefox/addon/tree-style-tab/ +1. [Web Browser Engineering](https://browser.engineering/index.html) + diff --git a/lux-js/commands.md b/lux-js/commands.md index 5c6da5e51..ddf91109d 100644 --- a/lux-js/commands.md +++ b/lux-js/commands.md @@ -8,6 +8,10 @@ cd ~/lux/lux-js/ && lein clean && lein lux auto test # Build ``` +cd ~/lux/lux-js/ \ +&& lux clean \ +&& lux with js auto build + cd ~/lux/lux-js/ \ && lux clean \ && lux with js build \ @@ -52,6 +56,6 @@ cd ~/lux/stdlib/ \ ``` cd ~/lux/lux-js/ \ -&& mvn install:install-file -Dfile=lux.js -DgroupId=com.github.luxlang -DartifactId=lux-js -Dversion=0.7.0-SNAPSHOT -Dpackaging=js +&& mvn install:install-file -Dfile=target/program.js -DgroupId=com.github.luxlang -DartifactId=lux-js -Dversion=0.6.3-SNAPSHOT -Dpackaging=js ``` diff --git a/lux-js/project.lux b/lux-js/project.lux index 5bd0019e2..d64419dd7 100644 --- a/lux-js/project.lux +++ b/lux-js/project.lux @@ -1,5 +1,5 @@ ["" - ["identity" ["com.github.luxlang" "lux-js" "0.6.2"] + ["identity" ["com.github.luxlang" "lux-js" "0.6.3-SNAPSHOT"] "info" ["url" "https://github.com/LuxLang/lux" "scm" "https://github.com/LuxLang/lux.git" "licenses" [["name" "Lux License v0.1.2" @@ -15,14 +15,14 @@ "repositories" ["https://oss.sonatype.org/content/repositories/snapshots/" "https://oss.sonatype.org/service/local/staging/deploy/maven2/"] - "dependencies" [["com.github.luxlang" "stdlib" "0.6.2" "tar"]] + "dependencies" [... ["com.github.luxlang" "stdlib" "0.6.3" "tar"] + ] "program" "program"] "js" - ["compiler" ["com.github.luxlang" "lux-js" "0.6.1" "js"] - "dependencies" [["org.openjdk.nashorn" "nashorn-core" "15.1" "jar"]]] + ["compiler" ["com.github.luxlang" "lux-js" "0.6.2" "js"]] "jvm" - ["compiler" ["com.github.luxlang" "lux-jvm" "0.6.2" "jar"] + ["compiler" ["com.github.luxlang" "lux-jvm" "0.6.3" "jar"] "dependencies" [["org.openjdk.nashorn" "nashorn-core" "15.1" "jar"]]]] diff --git a/stdlib/project.clj b/stdlib/project.clj index 9cc874af8..e05e908ad 100644 --- a/stdlib/project.clj +++ b/stdlib/project.clj @@ -3,7 +3,7 @@ (def sonatype-releases "https://oss.sonatype.org/service/local/staging/deploy/maven2/") (def sonatype-snapshots "https://oss.sonatype.org/content/repositories/snapshots/") -(defproject com.github.luxlang/stdlib #=(identity version) +(defproject com.github.luxlang/stdlib "0.6.3-SNAPSHOT" ;; #=(identity version) :description "Standard library for the Lux programming language." :url ~repo diff --git a/stdlib/project.lux b/stdlib/project.lux index 496763b00..57cc54d90 100644 --- a/stdlib/project.lux +++ b/stdlib/project.lux @@ -2,7 +2,7 @@ [... An optional identity for the project. ... It can also be specified or overriden in a non-default profile. ... This will be the name given to the project when installed/deployed as a dependency. - "identity" ["com.github.luxlang" "stdlib" "0.6.2"] + "identity" ["com.github.luxlang" "stdlib" "0.6.3-SNAPSHOT"] ... Every piece of information, and the whole "info" bundle, are optional. "info" ["url" "https://github.com/LuxLang/lux" @@ -52,7 +52,7 @@ ] "js" - ["compiler" ["com.github.luxlang" "lux-js" "0.6.2" "js"] + ["compiler" ["com.github.luxlang" "lux-js" "0.6.3-SNAPSHOT" "js"] ... The OS command to use when running JS tests. The default is described below. ... "js" ["node" "--stack_size=8192"] ] diff --git a/stdlib/source/library/lux/data/collection/list.lux b/stdlib/source/library/lux/data/collection/list.lux index 63f3cf3f6..37e944bb8 100644 --- a/stdlib/source/library/lux/data/collection/list.lux +++ b/stdlib/source/library/lux/data/collection/list.lux @@ -129,15 +129,15 @@ (def: .public (split_at n xs) (All (_ a) (-> Nat (List a) [(List a) (List a)])) - (if (n.> 0 n) - (case xs - {.#End} - [{.#End} {.#End}] - - {.#Item x xs'} - (let [[tail rest] (split_at (-- n) xs')] - [{.#Item x tail} rest])) - [{.#End} xs])) + (case n + 0 [{.#End} xs] + _ (case xs + {.#End} + [{.#End} {.#End}] + + {.#Item x xs'} + (let [[tail rest] (split_at (-- n) xs')] + [{.#Item x tail} rest])))) (def: (split_when' predicate ys xs) (All (_ a) diff --git a/stdlib/source/library/lux/data/format/css.lux b/stdlib/source/library/lux/data/format/css.lux index c4ac78db3..f4dd728df 100644 --- a/stdlib/source/library/lux/data/format/css.lux +++ b/stdlib/source/library/lux/data/format/css.lux @@ -1,26 +1,28 @@ (.using - [library - [lux {"-" and} - [control - ["[0]" maybe]] - [data - [number - ["[0]" nat]] - ["[0]" text - ["%" format {"+" format}] - ["[0]" encoding {"+" Encoding}]] - [collection - ["[0]" list ("[1]#[0]" functor)]]] - [type - abstract] - [world - [net {"+" URL}]]]] - ["[0]" / "_" - ["[1][0]" selector {"+" Selector Combinator}] - ["[1][0]" value {"+" Value Animation Percentage}] - ["[1][0]" font {"+" Font}] - ["[1][0]" style {"+" Style}] - ["[1][0]" query {"+" Query}]]) + [library + [lux {"-" and} + [control + ["[0]" maybe]] + [data + ["[0]" text + ["%" format {"+" format}] + ["[0]" encoding {"+" Encoding}]] + [collection + ["[0]" list ("[1]#[0]" functor)]]] + [math + [number + ["[0]" nat]]] + [type + [abstract {"-" Frame}]] + [world + [net {"+" URL}]]]] + ["[0]" / "_" + ["[1][0]" selector {"+" Selector Combinator Specializer Generic}] + ["[1][0]" value {"+" Value Animation Percentage}] + ["[1][0]" property {"+" Property}] + ["[1][0]" font {"+" Font}] + ["[1][0]" style] + ["[1][0]" query {"+" Query}]]) (abstract: .public Common Any) (abstract: .public Special Any) @@ -33,12 +35,15 @@ (|>> :representation)) (def: .public empty - (CSS Common) + (CSS Any) (:abstraction "")) + (type: .public Style + (List (Ex (_ brand) [(Property brand) (Value brand)]))) + (def: .public (rule selector style) (-> (Selector Any) Style (CSS Common)) - (:abstraction (format (/selector.selector selector) "{" (/style.inline style) "}"))) + (:abstraction (format (/selector.selector selector) "{" (/style.inline (/style.style style)) "}"))) (def: .public char_set (-> Encoding (CSS Special)) @@ -65,7 +70,7 @@ with_unicode) (list#each (function (_ [property value]) (format property ": " value ";"))) - (text.interposed /style.separator) + text.together (text.enclosed ["{" "}"]) (format "@font-face") :abstraction))) @@ -81,12 +86,12 @@ "") ";"))) - (def: css_separator + (def: separator text.new_line) (type: .public Frame (Record - [#when Percentage + [#when (Value Percentage) #what Style])) (def: .public (key_frames animation frames) @@ -94,33 +99,38 @@ (:abstraction (format "@keyframes " (/value.value animation) " {" (|> frames (list#each (function (_ frame) - (format (/value.percentage (value@ #when frame)) " {" - (/style.inline (value@ #what frame)) + (format (/value.value (value@ #when frame)) " {" + (/style.inline (/style.style (value@ #what frame))) "}"))) - (text.interposed ..css_separator)) + (text.interposed ..separator)) "}"))) (template: (!composite
) - (:abstraction (format (:representation ) ..css_separator - (:representation)))) + [(:abstraction + (format (:representation ) + ..separator + (:representation)))]) (def: .public (and pre post) - (-> (CSS Any) (CSS Any) (CSS Any)) + (All (_ kind) (-> (CSS kind) (CSS kind) (CSS kind))) (!composite pre post)) - (def: .public (alter combinator selector css) + (def: .public (in_context combinator selector css) (-> Combinator (Selector Any) (CSS Common) (CSS Common)) (|> css :representation - (text.all_split_by ..css_separator) - (list#each (|>> (format (/selector.selector (|> selector (combinator (/selector.tag ""))))))) - (text.interposed ..css_separator) + (text.all_split_by ..separator) + (list#each (let [prefix (|> selector + (combinator (/selector.tag "")) + /selector.selector)] + (|>> (format prefix)))) + (text.interposed ..separator) :abstraction)) (def: .public (dependent combinator selector style inner) (-> Combinator (Selector Any) Style (CSS Common) (CSS Common)) (!composite (..rule selector style) - (..alter combinator selector inner))) + (..in_context combinator selector inner))) (template [ ] [(def: .public @@ -130,4 +140,33 @@ [with_descendants /selector.in] [with_children /selector.sub] ) + + (def: .public (in_case specializer selector css) + (All (_ kind) + (-> (Specializer kind) (Selector (Generic Any)) (CSS Common) (CSS Common))) + (|> css + :representation + (text.all_split_by ..separator) + (list#each (let [prefix (|> selector + (specializer (:expected (/selector.tag ""))) + /selector.selector)] + (|>> (format prefix)))) + (text.interposed ..separator) + :abstraction)) + + (def: .public (specialized combinator selector style inner) + (All (_ kind) + (-> (Specializer kind) (Selector (Generic Any)) Style (CSS Common) (CSS Common))) + (!composite (..rule selector style) + (..in_case combinator selector inner))) + + (template [ ] + [(def: .public + (-> (Selector (Generic Any)) Style (CSS Common) (CSS Common)) + (..specialized ))] + + [with_case /selector.and] + [with_part /selector.at] + [with_element /selector.for] + ) ) diff --git a/stdlib/source/library/lux/data/format/css/property.lux b/stdlib/source/library/lux/data/format/css/property.lux index 707e3edd3..155297f84 100644 --- a/stdlib/source/library/lux/data/format/css/property.lux +++ b/stdlib/source/library/lux/data/format/css/property.lux @@ -1,9 +1,11 @@ (.using [library - [lux {"-" All Cursor} + [lux {"-" All Location} [control [parser ["s" code]]] + [data + ["[0]" text]] [type abstract] [macro @@ -34,7 +36,7 @@ Display Empty Filter Flex_Direction Flex_Wrap - Font Font_Kerning Font_Size Font_Variant + Font Font_Kerning Font_Size Font_Stretch Font_Style Font_Weight Font_Variant Grid Grid_Content Grid_Flow Grid_Span Grid_Template Hanging_Punctuation Hyphens Isolation List_Style_Position List_Style_Type @@ -333,10 +335,17 @@ [] [["font-size"]]] - [Number + [Font_Stretch [] - [["font-size-adjust"] - ["opacity"]]] + [["font-stretch"]]] + + [Font_Style + [] + [["font-style"]]] + + [Font_Weight + [] + [["font-weight"]]] [Font_Variant [] @@ -388,6 +397,11 @@ [] [["list-style-type"]]] + [Number + [] + [["font-size-adjust"] + ["opacity"]]] + [Overflow [] [["overflow"] diff --git a/stdlib/source/library/lux/data/format/css/query.lux b/stdlib/source/library/lux/data/format/css/query.lux index 251429815..8251fcb06 100644 --- a/stdlib/source/library/lux/data/format/css/query.lux +++ b/stdlib/source/library/lux/data/format/css/query.lux @@ -5,7 +5,7 @@ [parser ["s" code]]] [data - [text + ["[0]" text ["%" format {"+" format}]]] [macro ["[0]" template] diff --git a/stdlib/source/library/lux/data/format/css/selector.lux b/stdlib/source/library/lux/data/format/css/selector.lux index bb6656d6e..35893766a 100644 --- a/stdlib/source/library/lux/data/format/css/selector.lux +++ b/stdlib/source/library/lux/data/format/css/selector.lux @@ -1,16 +1,17 @@ (.using [library - [lux {"-" or and for same? not} + [lux {"-" Label or and for same? not} + ["[0]" locale {"+" Locale}] [data ["[0]" text - ["%" format {"+" format}]] + ["%" format {"+" format}]]] + [math [number ["i" int]]] [type abstract] [macro - ["[0]" template]] - ["[0]" locale {"+" Locale}]]]) + ["[0]" template]]]]) (type: .public Label Text) @@ -57,23 +58,23 @@ [class Class "." Can_Chain] ) - (template [ +] + (template [ +] [(`` (template [ ] [(def: .public ( right left) - (-> (Selector ) (Selector ) (Selector )) + (-> (Selector ) (Selector ) (Selector Composite)) (:abstraction (format (:representation left) (:representation right))))] (~~ (template.spliced +))))] - [Can_Chain (Generic Any) Can_Chain + [Can_Chain (Generic Any) [["" and]]] - [Unique (Generic Any) Composite - [["" for]]] - [Specific (Generic Any) Composite + [Specific (Generic Any) [["" at]]] - [Any Any Composite + [Unique (Generic Any) + [["" for]]] + [Any Any [["," or] [" " in] [">" sub] @@ -81,6 +82,9 @@ ["~" later]]] ) + (type: .public (Specializer kind) + (-> (Selector kind) (Selector (Generic Any)) (Selector Composite))) + (type: .public Combinator (-> (Selector Any) (Selector Any) (Selector Composite))) @@ -104,7 +108,7 @@ (template [ +] [(`` (template [ ] [(def: .public - (Selector Can_Chain) + (Selector ) (:abstraction ))] (~~ (template.spliced +))))] @@ -199,8 +203,8 @@ [nth_child ":nth-child"] [nth_last_child ":nth-last-child"] - [nth_last_of_type ":nth-last-of-type"] [nth_of_type ":nth-of-type"] + [nth_last_of_type ":nth-last-of-type"] ) ) ) diff --git a/stdlib/source/library/lux/data/format/css/style.lux b/stdlib/source/library/lux/data/format/css/style.lux index bd8d26787..8ec6a207f 100644 --- a/stdlib/source/library/lux/data/format/css/style.lux +++ b/stdlib/source/library/lux/data/format/css/style.lux @@ -1,14 +1,16 @@ (.using - [library - [lux "*" - [data - [text - ["%" format {"+" format}]]] - [type - abstract]]] - ["[0]" // "_" - ["[1][0]" value {"+" Value}] - ["[1][0]" property {"+" Property}]]) + [library + [lux "*" + [data + [text + ["%" format {"+" format}]] + [collection + ["[0]" list ("[1]#[0]" mix)]]] + [type + abstract]]] + ["[0]" // "_" + ["[1][0]" value {"+" Value}] + ["[1][0]" property {"+" Property}]]) (abstract: .public Style Text @@ -17,18 +19,20 @@ Style (:abstraction "")) - (def: .public separator - " ") - (def: .public (with [property value]) (All (_ brand) (-> [(Property brand) (Value brand)] (-> Style Style))) (|>> :representation - (format (//property.name property) ": " (//value.value value) ";" ..separator) + (format (//property.name property) ": " (//value.value value) ";") :abstraction)) (def: .public inline (-> Style Text) (|>> :representation)) + + (def: .public (style config) + (-> (List (Ex (_ brand) [(Property brand) (Value brand)])) + Style) + (list#mix ..with ..empty config)) ) diff --git a/stdlib/source/library/lux/data/format/css/value.lux b/stdlib/source/library/lux/data/format/css/value.lux index a68d0b263..9b2de87f3 100644 --- a/stdlib/source/library/lux/data/format/css/value.lux +++ b/stdlib/source/library/lux/data/format/css/value.lux @@ -1,58 +1,59 @@ (.using - [library - [lux {"-" All Cursor and static false true} - [control - ["[0]" maybe] - [parser - ["s" code]]] - [data - ["[0]" color] - ["[0]" product] - [number - ["n" nat] - ["i" int] - ["r" rev] - ["f" frac]] - ["[0]" text - ["%" format {"+" Format format}]] - [collection - ["[0]" list ("[1]#[0]" functor)]]] - [type - abstract] - [macro - ["[0]" template] - ["[0]" code] - [syntax {"+" syntax:}]] - [world - [net {"+" URL}]]]] - [// - [selector {"+" Label}]]) - -(syntax: (text_symbol [symbol s.text]) + [library + [lux {"-" Label All Location and static false true} + [control + ["[0]" maybe] + [parser + ["<[0]>" code]]] + [data + ["[0]" color] + ["[0]" product] + ["[0]" text + ["%" format {"+" Format format}]] + [collection + ["[0]" list ("[1]#[0]" functor)]]] + [macro + [syntax {"+" syntax:}] + ["[0]" template] + ["[0]" code]] + [math + [number + ["n" nat] + ["i" int] + ["r" rev] + ["f" frac]]] + [type + abstract] + [world + [net {"+" URL}]]]] + [// + [selector {"+" Label}]]) + +(syntax: (text_symbol [symbol .text]) (in (list (code.local_symbol (text.replaced "-" "_" symbol))))) (template: (enumeration:
+ +) - (abstract: .public - + [(abstract: .public + - (def: .public - (-> ) - (|>> :representation)) + (def: .public + (-> ) + (|>> :representation)) - (`` (template [ ] - [(def: .public (:abstraction ))] + (`` (template [ ] + [(def: .public (:abstraction ))] - (~~ (template.spliced +)) - )) + (~~ (template.spliced +)) + )) - (template.spliced +))) + (template.spliced +))]) (template: (multi: ) - (def: .public ( pre post) - (-> (Value ) (Value ) (Value )) - (:abstraction (format (:representation pre) - - (:representation post))))) + [(def: .public ( pre post) + (-> (Value ) (Value ) (Value )) + (:abstraction (format (:representation pre) + + (:representation post))))]) (def: (%number value) (Format Frac) @@ -75,7 +76,21 @@ [inherit "inherit"] [unset "unset"] ) - + + (abstract: .public (Numeric kind) Any) + + (template [ ] + [(with_expansions [ ' (template.symbol [ "'"])] + (abstract: .public ' Any) + (type: .public + (Numeric ')))] + + [Number] + [Length] + [Time] + [Percentage] + ) + (template [ + +] [(abstract: .public Any) @@ -98,18 +113,6 @@ [] []] - [Number - [] - []] - - [Length - [] - []] - - [Time - [] - []] - [Thickness [] [["medium"] @@ -969,49 +972,41 @@ ) ) - (abstract: .public Percentage - Text + (def: percentage_limit Nat (.++ 100)) - (def: .public percentage - (-> Percentage Text) - (|>> :representation)) + (def: .public (%% value) + (-> Nat (Value Percentage)) + (:abstraction (format (%.nat (n.% percentage_limit value)) "%"))) - (def: percentage_limit Nat (.++ 100)) - - (def: .public (%% value) - (-> Nat Percentage) - (:abstraction (format (%.nat (n.% percentage_limit value)) "%"))) - - (def: .public slice_percent/1 - (-> Percentage (Value Slice)) - (|>> :representation (:abstraction Value))) - - (def: .public (slice_percent/2 horizontal vertical) - (-> Percentage Percentage (Value Slice)) - (:abstraction Value (format (:representation horizontal) ..slice_separator - (:representation vertical)))) - - (template [ +] - [(`` (template [ ] - [(def: .public - (-> (Value Filter)) - (|>> (list) (..apply)))] - - (~~ (template.spliced +))))] - - [Nat (<| (:representation Value) ..px n.frac) - [[blur "blur"]]] - [Nat (<| ..angle ..degree) - [[hue_rotate "hue-rotate"]]] - [Percentage (:representation Percentage) - [[brightness "brightness"] - [contrast "contrast"] - [grayscale "grayscale"] - [invert "invert"] - [opacity "opacity"] - [saturate "saturate"] - [sepia "sepia"]]] - ) + (def: .public slice_percent/1 + (-> (Value Percentage) (Value Slice)) + (|>> :transmutation)) + + (def: .public (slice_percent/2 horizontal vertical) + (-> (Value Percentage) (Value Percentage) (Value Slice)) + (:abstraction (format (:representation horizontal) ..slice_separator + (:representation vertical)))) + + (template [ +] + [(`` (template [ ] + [(def: .public + (-> (Value Filter)) + (|>> (list) (..apply)))] + + (~~ (template.spliced +))))] + + [Nat (<| :representation ..px n.frac) + [[blur "blur"]]] + [Nat (<| ..angle ..degree) + [[hue_rotate "hue-rotate"]]] + [(Value Percentage) :representation + [[brightness "brightness"] + [contrast "contrast"] + [grayscale "grayscale"] + [invert "invert"] + [opacity "opacity"] + [saturate "saturate"] + [sepia "sepia"]]] ) (def: .public svg_filter @@ -1329,4 +1324,22 @@ (multi: multi_image Image ",") (multi: multi_shadow Shadow ",") (multi: multi_content Content " ") + + ... https://developer.mozilla.org/en-US/docs/Web/CSS/calc() + (template [ ] + [(def: .public ( parameter subject) + (.All (_ kind) + (-> (Value ) (Value (Numeric kind)) + (Value (Numeric kind)))) + (|> (format (:representation subject) + (template.text [" " " "]) + (:representation parameter)) + (text.enclosed ["calc(" ")"]) + :abstraction))] + + [+ (Numeric kind)] + [- (Numeric kind)] + [* Number] + [/ Number] + ) ) diff --git a/stdlib/source/library/lux/macro/syntax/export.lux b/stdlib/source/library/lux/macro/syntax/export.lux index aa482c559..7a87e30fd 100644 --- a/stdlib/source/library/lux/macro/syntax/export.lux +++ b/stdlib/source/library/lux/macro/syntax/export.lux @@ -14,8 +14,8 @@ (def: policy (Parser Code) (do [! <>.monad] - [candiate .next] - (case candiate + [candidate
.next] + (case candidate [_ {.#Symbol ["" _]}] (in default_policy) @@ -23,7 +23,7 @@ [_ {.#Symbol _}]) (do ! [_
.any] - (in candiate)) + (in candidate)) _ (in default_policy)))) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/directive/lux.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/directive/lux.lux index 602aedfd0..a0ed6f3e6 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/directive/lux.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/directive/lux.lux @@ -193,6 +193,7 @@ [directive directive' /////generation.learn_directive] ) +... TODO: Get rid of this function ASAP. (def: (refresh expander host_analysis) (All (_ anchor expression directive) (-> Expander /////analysis.Bundle (Operation anchor expression directive Any))) @@ -201,12 +202,14 @@ .let [eval (/////analysis/evaluation.evaluator expander (value@ [/////directive.#synthesis /////directive.#state] state) (value@ [/////directive.#generation /////directive.#state] state) - (value@ [/////directive.#generation /////directive.#phase] state))]] + (value@ [/////directive.#generation /////directive.#phase] state)) + previous_analysis_extensions (value@ [/////directive.#analysis /////directive.#state ///.#bundle] state)]] (phase.set_state [bundle (revised@ [/////directive.#analysis /////directive.#state] (: (-> /////analysis.State+ /////analysis.State+) (|>> product.right - [(///analysis.bundle eval host_analysis)])) + [(|> previous_analysis_extensions + (dictionary.merged (///analysis.bundle eval host_analysis)))])) state)]))) (def: (announce_definition! short type) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/version.lux b/stdlib/source/library/lux/tool/compiler/language/lux/version.lux index 733188447..714ceb58a 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/version.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/version.lux @@ -6,4 +6,4 @@ (def: .public version Version - 00,06,02) + 00,06,03) diff --git a/stdlib/source/library/lux/world/file.lux b/stdlib/source/library/lux/world/file.lux index 7c19c1963..de56b54a2 100644 --- a/stdlib/source/library/lux/world/file.lux +++ b/stdlib/source/library/lux/world/file.lux @@ -380,13 +380,13 @@ [process_load [global process mainModule constructor _load]] ) - (def: (require _) - (-> [] (-> ffi.String Any)) + (def: (require module) + (-> ffi.String Any) (case [(normal_require []) (global_require []) (process_load [])] (^or [{.#Some require} _ _] [_ {.#Some require} _] [_ _ {.#Some require}]) - require + (require module) _ (undefined))) @@ -394,7 +394,7 @@ (template [
] [(def: ( _) (-> [] ) - (:as (..require [] )))] + (:as (..require )))] [node_fs "fs" ..Fs] [node_path "path" ..JsPath] -- cgit v1.2.3