From 149515fd173947dcff20558fca077fbd16dc9b6c Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Mon, 27 Jun 2022 03:26:33 -0400 Subject: New "parser" hierarchy. [Part 5] --- stdlib/source/documentation/lux/target.lux | 15 ++- stdlib/source/documentation/lux/target/js.lux | 2 +- stdlib/source/documentation/lux/target/jvm.lux | 2 +- .../source/documentation/lux/target/jvm/type.lux | 2 +- .../documentation/lux/target/jvm/type/alias.lux | 2 +- .../documentation/lux/target/jvm/type/box.lux | 2 +- .../documentation/lux/target/jvm/type/category.lux | 2 +- .../lux/target/jvm/type/descriptor.lux | 2 +- .../documentation/lux/target/jvm/type/lux.lux | 2 +- .../documentation/lux/target/jvm/type/parser.lux | 2 +- .../lux/target/jvm/type/reflection.lux | 2 +- .../lux/target/jvm/type/signature.lux | 2 +- stdlib/source/documentation/lux/target/lua.lux | 2 +- stdlib/source/documentation/lux/target/python.lux | 2 +- stdlib/source/documentation/lux/target/ruby.lux | 2 +- stdlib/source/documentation/lux/time.lux | 103 +++++++++------------ stdlib/source/documentation/lux/time/date.lux | 31 +++---- stdlib/source/documentation/lux/time/day.lux | 20 ++-- stdlib/source/documentation/lux/time/duration.lux | 22 ++--- stdlib/source/documentation/lux/time/instant.lux | 81 +++++++--------- stdlib/source/documentation/lux/time/month.lux | 38 ++++---- stdlib/source/documentation/lux/time/year.lux | 58 ++++++------ 22 files changed, 179 insertions(+), 217 deletions(-) (limited to 'stdlib/source/documentation') diff --git a/stdlib/source/documentation/lux/target.lux b/stdlib/source/documentation/lux/target.lux index 306876f18..70ba24c62 100644 --- a/stdlib/source/documentation/lux/target.lux +++ b/stdlib/source/documentation/lux/target.lux @@ -1,7 +1,7 @@ (.require [library [lux (.except char) - ["$" documentation (.only documentation:)] + ["$" documentation] [data [text (.only \n) ["%" \\format (.only format)]] @@ -16,16 +16,11 @@ ["[1][0]" python] ["[1][0]" ruby]]) -(documentation: /.Target - (format "The name/ID of a platform targetted by a Lux compiler." - \n "This information can be used to generate code targetting specific platforms, and to make programs cross-platform.")) - (.def .public documentation (.List $.Module) ($.module /._ "" - [..Target - ($.default /.old) + [($.default /.old) ($.default /.js) ($.default /.jvm) ($.default /.lua) @@ -34,7 +29,11 @@ ($.default /.common_lisp) ($.default /.php) ($.default /.r) - ($.default /.scheme)] + ($.default /.scheme) + + ($.documentation /.Target + (format "The name/ID of a platform targetted by a Lux compiler." + \n "This information can be used to generate code targetting specific platforms, and to make programs cross-platform."))] [/js.documentation /jvm.documentation /lua.documentation diff --git a/stdlib/source/documentation/lux/target/js.lux b/stdlib/source/documentation/lux/target/js.lux index 864a5e2c7..68f67d560 100644 --- a/stdlib/source/documentation/lux/target/js.lux +++ b/stdlib/source/documentation/lux/target/js.lux @@ -1,7 +1,7 @@ (.require [library [lux (.except) - ["$" documentation (.only documentation:)] + ["$" documentation] [data [text (.only \n) ["%" \\format (.only format)]] diff --git a/stdlib/source/documentation/lux/target/jvm.lux b/stdlib/source/documentation/lux/target/jvm.lux index 85ec6ea01..440ef5775 100644 --- a/stdlib/source/documentation/lux/target/jvm.lux +++ b/stdlib/source/documentation/lux/target/jvm.lux @@ -1,7 +1,7 @@ (.require [library [lux (.except char) - ["$" documentation (.only documentation:)] + ["$" documentation] [data [text (.only \n) ["%" \\format (.only format)]] diff --git a/stdlib/source/documentation/lux/target/jvm/type.lux b/stdlib/source/documentation/lux/target/jvm/type.lux index 902683d16..39bded852 100644 --- a/stdlib/source/documentation/lux/target/jvm/type.lux +++ b/stdlib/source/documentation/lux/target/jvm/type.lux @@ -1,7 +1,7 @@ (.require [library [lux (.except char) - ["$" documentation (.only documentation:)] + ["$" documentation] [data [text (.only \n) ["%" \\format (.only format)]] diff --git a/stdlib/source/documentation/lux/target/jvm/type/alias.lux b/stdlib/source/documentation/lux/target/jvm/type/alias.lux index 3af9a8997..d8e17f39a 100644 --- a/stdlib/source/documentation/lux/target/jvm/type/alias.lux +++ b/stdlib/source/documentation/lux/target/jvm/type/alias.lux @@ -1,7 +1,7 @@ (.require [library [lux (.except char) - ["$" documentation (.only documentation:)] + ["$" documentation] [data [text (.only \n) ["%" \\format (.only format)]] diff --git a/stdlib/source/documentation/lux/target/jvm/type/box.lux b/stdlib/source/documentation/lux/target/jvm/type/box.lux index 04ddd5a9d..1f393eb2e 100644 --- a/stdlib/source/documentation/lux/target/jvm/type/box.lux +++ b/stdlib/source/documentation/lux/target/jvm/type/box.lux @@ -1,7 +1,7 @@ (.require [library [lux (.except char) - ["$" documentation (.only documentation:)] + ["$" documentation] [data [text (.only \n) ["%" \\format (.only format)]] diff --git a/stdlib/source/documentation/lux/target/jvm/type/category.lux b/stdlib/source/documentation/lux/target/jvm/type/category.lux index 1b17ca5a7..123041fcb 100644 --- a/stdlib/source/documentation/lux/target/jvm/type/category.lux +++ b/stdlib/source/documentation/lux/target/jvm/type/category.lux @@ -1,7 +1,7 @@ (.require [library [lux (.except char) - ["$" documentation (.only documentation:)] + ["$" documentation] [data [text (.only \n) ["%" \\format (.only format)]] diff --git a/stdlib/source/documentation/lux/target/jvm/type/descriptor.lux b/stdlib/source/documentation/lux/target/jvm/type/descriptor.lux index 9eaa79e17..8a484151c 100644 --- a/stdlib/source/documentation/lux/target/jvm/type/descriptor.lux +++ b/stdlib/source/documentation/lux/target/jvm/type/descriptor.lux @@ -1,7 +1,7 @@ (.require [library [lux (.except char) - ["$" documentation (.only documentation:)] + ["$" documentation] [data [text (.only \n) ["%" \\format (.only format)]] diff --git a/stdlib/source/documentation/lux/target/jvm/type/lux.lux b/stdlib/source/documentation/lux/target/jvm/type/lux.lux index 0b09556dc..408b5c6f4 100644 --- a/stdlib/source/documentation/lux/target/jvm/type/lux.lux +++ b/stdlib/source/documentation/lux/target/jvm/type/lux.lux @@ -1,7 +1,7 @@ (.require [library [lux (.except char) - ["$" documentation (.only documentation:)] + ["$" documentation] [data [text (.only \n) ["%" \\format (.only format)]] diff --git a/stdlib/source/documentation/lux/target/jvm/type/parser.lux b/stdlib/source/documentation/lux/target/jvm/type/parser.lux index afd3515f2..81e9d4bee 100644 --- a/stdlib/source/documentation/lux/target/jvm/type/parser.lux +++ b/stdlib/source/documentation/lux/target/jvm/type/parser.lux @@ -1,7 +1,7 @@ (.require [library [lux (.except char) - ["$" documentation (.only documentation:)] + ["$" documentation] [data [text (.only \n) ["%" \\format (.only format)]] diff --git a/stdlib/source/documentation/lux/target/jvm/type/reflection.lux b/stdlib/source/documentation/lux/target/jvm/type/reflection.lux index 4cd2327ee..64ecb135c 100644 --- a/stdlib/source/documentation/lux/target/jvm/type/reflection.lux +++ b/stdlib/source/documentation/lux/target/jvm/type/reflection.lux @@ -1,7 +1,7 @@ (.require [library [lux (.except char) - ["$" documentation (.only documentation:)] + ["$" documentation] [data [text (.only \n) ["%" \\format (.only format)]] diff --git a/stdlib/source/documentation/lux/target/jvm/type/signature.lux b/stdlib/source/documentation/lux/target/jvm/type/signature.lux index dd2234c90..8991f34ee 100644 --- a/stdlib/source/documentation/lux/target/jvm/type/signature.lux +++ b/stdlib/source/documentation/lux/target/jvm/type/signature.lux @@ -1,7 +1,7 @@ (.require [library [lux (.except char) - ["$" documentation (.only documentation:)] + ["$" documentation] [data [text (.only \n) ["%" \\format (.only format)]] diff --git a/stdlib/source/documentation/lux/target/lua.lux b/stdlib/source/documentation/lux/target/lua.lux index 651d70c7b..dbbd515a5 100644 --- a/stdlib/source/documentation/lux/target/lua.lux +++ b/stdlib/source/documentation/lux/target/lua.lux @@ -1,7 +1,7 @@ (.require [library [lux (.except) - ["$" documentation (.only documentation:)] + ["$" documentation] [data [text (.only \n) ["%" \\format (.only format)]] diff --git a/stdlib/source/documentation/lux/target/python.lux b/stdlib/source/documentation/lux/target/python.lux index 69bec7b7e..c531707ae 100644 --- a/stdlib/source/documentation/lux/target/python.lux +++ b/stdlib/source/documentation/lux/target/python.lux @@ -1,7 +1,7 @@ (.require [library [lux (.except) - ["$" documentation (.only documentation:)] + ["$" documentation] [data [text (.only \n) ["%" \\format (.only format)]] diff --git a/stdlib/source/documentation/lux/target/ruby.lux b/stdlib/source/documentation/lux/target/ruby.lux index bddc34acc..a678fe81b 100644 --- a/stdlib/source/documentation/lux/target/ruby.lux +++ b/stdlib/source/documentation/lux/target/ruby.lux @@ -1,7 +1,7 @@ (.require [library [lux (.except) - ["$" documentation (.only documentation:)] + ["$" documentation] [data [text (.only \n) ["%" \\format (.only format)]] diff --git a/stdlib/source/documentation/lux/time.lux b/stdlib/source/documentation/lux/time.lux index 1b0b5ac6c..3041638d5 100644 --- a/stdlib/source/documentation/lux/time.lux +++ b/stdlib/source/documentation/lux/time.lux @@ -1,7 +1,7 @@ (.require [library [lux (.except and) - ["$" documentation (.only documentation:)] + ["$" documentation] [data ["[0]" text (.only \n) ["%" \\format (.only format)]]] @@ -17,68 +17,57 @@ ["[1][0]" month] ["[1][0]" year]]) -(with_template [ ] - [(documentation: - )] +(`` (.def .public documentation + (.List $.Module) + ($.module /._ + "" + [($.default /.time_exceeds_a_day) + ($.default /.invalid_hour) + ($.default /.invalid_minute) + ($.default /.invalid_second) + ($.default /.millis) + ($.default /.equivalence) + ($.default /.order) + ($.default /.enum) + ($.default /.parser) - [/.milli_seconds "Number of milli-seconds in a second."] - [/.seconds "Number of seconds in a minute."] - [/.minutes "Number of minutes in an hour."] - [/.hours "Number of hours in an day."] - ) + (~~ (with_template [ ] + [($.documentation + )] -(documentation: /.Time - "Time is defined as milliseconds since the start of the day (00:00:00.000).") + [/.milli_seconds "Number of milli-seconds in a second."] + [/.seconds "Number of seconds in a minute."] + [/.minutes "Number of minutes in an hour."] + [/.hours "Number of hours in an day."] + )) -(documentation: /.midnight - "The instant corresponding to the start of the day: 00:00:00.000") + ($.documentation /.Time + "Time is defined as milliseconds since the start of the day (00:00:00.000).") -(documentation: /.of_millis - "" - [(of_millis milli_seconds)]) + ($.documentation /.midnight + "The instant corresponding to the start of the day: 00:00:00.000") -(documentation: /.Clock - "A clock marking the specific hour, minute, second, and milli-second in a day.") + ($.documentation /.of_millis + "" + [(of_millis milli_seconds)]) -(documentation: /.clock - "" - [(clock time)]) + ($.documentation /.Clock + "A clock marking the specific hour, minute, second, and milli-second in a day.") -(documentation: /.time - "" - [(time clock)]) + ($.documentation /.clock + "" + [(clock time)]) -(documentation: /.codec - (format "Based on ISO 8601." - \n "For example: 21:14:51.827")) + ($.documentation /.time + "" + [(time clock)]) -(.def .public documentation - (.List $.Module) - ($.module /._ - "" - [..milli_seconds - ..seconds - ..minutes - ..hours - ..Time - ..midnight - ..of_millis - ..Clock - ..clock - ..time - ..codec - ($.default /.time_exceeds_a_day) - ($.default /.invalid_hour) - ($.default /.invalid_minute) - ($.default /.invalid_second) - ($.default /.millis) - ($.default /.equivalence) - ($.default /.order) - ($.default /.enum) - ($.default /.parser)] - [/date.documentation - /day.documentation - /duration.documentation - /instant.documentation - /month.documentation - /year.documentation])) + ($.documentation /.codec + (format "Based on ISO 8601." + \n "For example: 21:14:51.827"))] + [/date.documentation + /day.documentation + /duration.documentation + /instant.documentation + /month.documentation + /year.documentation]))) diff --git a/stdlib/source/documentation/lux/time/date.lux b/stdlib/source/documentation/lux/time/date.lux index 818371741..15bfdafbb 100644 --- a/stdlib/source/documentation/lux/time/date.lux +++ b/stdlib/source/documentation/lux/time/date.lux @@ -1,7 +1,7 @@ (.require [library [lux (.except and) - ["$" documentation (.only documentation:)] + ["$" documentation] [data ["[0]" text (.only \n) ["%" \\format (.only format)]]] @@ -10,25 +10,11 @@ [\\library ["[0]" /]]) -(documentation: /.Date - "A date specified as a year/month/day triplet.") - -(documentation: /.date - "A date, within the allowed limits." - [(date year month day_of_month)]) - -(documentation: /.codec - (format "Based on ISO 8601." - \n "For example: 2017-01-15")) - (.def .public documentation (.List $.Module) ($.module /._ "" - [..Date - ..date - ..codec - ($.default /.invalid_day) + [($.default /.invalid_day) ($.default /.epoch) ($.default /.year) ($.default /.month) @@ -39,5 +25,16 @@ ($.default /.parser) ($.default /.days) ($.default /.of_days) - ($.default /.enum)] + ($.default /.enum) + + ($.documentation /.Date + "A date specified as a year/month/day triplet.") + + ($.documentation /.date + "A date, within the allowed limits." + [(date year month day_of_month)]) + + ($.documentation /.codec + (format "Based on ISO 8601." + \n "For example: 2017-01-15"))] [])) diff --git a/stdlib/source/documentation/lux/time/day.lux b/stdlib/source/documentation/lux/time/day.lux index 5cd046493..29db3b570 100644 --- a/stdlib/source/documentation/lux/time/day.lux +++ b/stdlib/source/documentation/lux/time/day.lux @@ -1,7 +1,7 @@ (.require [library [lux (.except and) - ["$" documentation (.only documentation:)] + ["$" documentation] [data ["[0]" text (.only \n) ["%" \\format (.only format)]]] @@ -10,19 +10,11 @@ [\\library ["[0]" /]]) -(documentation: /.Day - "A day of the week.") - -(documentation: /.week - "All the days, ordered by when they come in a week.") - (.def .public documentation (.List $.Module) ($.module /._ "" - [..Day - ..week - ($.default /.equivalence) + [($.default /.equivalence) ($.default /.order) ($.default /.enum) ($.default /.not_a_day_of_the_week) @@ -30,5 +22,11 @@ ($.default /.number) ($.default /.invalid_day) ($.default /.by_number) - ($.default /.hash)] + ($.default /.hash) + + ($.documentation /.Day + "A day of the week.") + + ($.documentation /.week + "All the days, ordered by when they come in a week.")] [])) diff --git a/stdlib/source/documentation/lux/time/duration.lux b/stdlib/source/documentation/lux/time/duration.lux index 448ea46eb..1340f3460 100644 --- a/stdlib/source/documentation/lux/time/duration.lux +++ b/stdlib/source/documentation/lux/time/duration.lux @@ -1,7 +1,7 @@ (.require [library [lux (.except and) - ["$" documentation (.only documentation:)] + ["$" documentation] [data ["[0]" text (.only \n) ["%" \\format (.only format)]]] @@ -10,20 +10,11 @@ [\\library ["[0]" /]]) -(documentation: /.Duration - "Durations have a resolution of milli-seconds.") - -(documentation: /.difference - "" - [(difference from to)]) - (.def .public documentation (.List $.Module) ($.module /._ "" - [..Duration - ..difference - ($.default /.of_millis) + [($.default /.of_millis) ($.default /.millis) ($.default /.composite) ($.default /.framed) @@ -47,5 +38,12 @@ ($.default /.leap_year) ($.default /.monoid) ($.default /.codec) - ($.default /.enum)] + ($.default /.enum) + + ($.documentation /.Duration + "Durations have a resolution of milli-seconds.") + + ($.documentation /.difference + "" + [(difference from to)])] [])) diff --git a/stdlib/source/documentation/lux/time/instant.lux b/stdlib/source/documentation/lux/time/instant.lux index 9eb35f53d..b40489b5c 100644 --- a/stdlib/source/documentation/lux/time/instant.lux +++ b/stdlib/source/documentation/lux/time/instant.lux @@ -1,7 +1,7 @@ (.require [library [lux (.except and) - ["$" documentation (.only documentation:)] + ["$" documentation] [data ["[0]" text (.only \n) ["%" \\format (.only format)]]] @@ -10,58 +10,49 @@ [\\library ["[0]" /]]) -(documentation: /.Instant - "Instant is defined as milli-seconds since the epoch.") - -(documentation: /.span - "" - [(span from to)]) - -(documentation: /.after - "" - [(after duration instant)]) - -(documentation: /.relative - "" - [(relative instant)]) - -(documentation: /.absolute - "" - [(absolute offset)]) - -(documentation: /.epoch - "The instant corresponding to 1970-01-01T00:00:00Z.") - -(documentation: /.codec - (format "Based on ISO 8601." - \n "For example: 2017-01-15T21:14:51.827Z")) - -(documentation: /.now - "Yields the current instant, as measured from the operating-system's clock.") - -(documentation: /.of_date_time - "" - [(of_date_time date time)]) - (.def .public documentation (.List $.Module) ($.module /._ "" - [..Instant - ..span - ..after - ..relative - ..absolute - ..epoch - ..codec - ..now - ..of_date_time - ($.default /.of_millis) + [($.default /.of_millis) ($.default /.millis) ($.default /.equivalence) ($.default /.order) ($.default /.enum) ($.default /.date) ($.default /.time) - ($.default /.day_of_week)] + ($.default /.day_of_week) + + ($.documentation /.Instant + "Instant is defined as milli-seconds since the epoch.") + + ($.documentation /.span + "" + [(span from to)]) + + ($.documentation /.after + "" + [(after duration instant)]) + + ($.documentation /.relative + "" + [(relative instant)]) + + ($.documentation /.absolute + "" + [(absolute offset)]) + + ($.documentation /.epoch + "The instant corresponding to 1970-01-01T00:00:00Z.") + + ($.documentation /.codec + (format "Based on ISO 8601." + \n "For example: 2017-01-15T21:14:51.827Z")) + + ($.documentation /.now + "Yields the current instant, as measured from the operating-system's clock.") + + ($.documentation /.of_date_time + "" + [(of_date_time date time)])] [])) diff --git a/stdlib/source/documentation/lux/time/month.lux b/stdlib/source/documentation/lux/time/month.lux index ccd31a8c4..05103ec1f 100644 --- a/stdlib/source/documentation/lux/time/month.lux +++ b/stdlib/source/documentation/lux/time/month.lux @@ -1,7 +1,7 @@ (.require [library [lux (.except and) - ["$" documentation (.only documentation:)] + ["$" documentation] [data ["[0]" text (.only \n) ["%" \\format (.only format)]]] @@ -10,29 +10,11 @@ [\\library ["[0]" /]]) -(documentation: /.Month - "A month of the year.") - -(documentation: /.days - "The amount of days of a month." - [(days month)]) - -(documentation: /.leap_year_days - "The amount of days of a month (in a leap year)." - [(leap_year_days month)]) - -(documentation: /.year - "All the months, ordered by when they come in a year.") - (.def .public documentation (.List $.Module) ($.module /._ "" - [..Month - ..days - ..leap_year_days - ..year - ($.default /.equivalence) + [($.default /.equivalence) ($.default /.number) ($.default /.invalid_month) ($.default /.by_number) @@ -40,5 +22,19 @@ ($.default /.order) ($.default /.enum) ($.default /.not_a_month_of_the_year) - ($.default /.codec)] + ($.default /.codec) + + ($.documentation /.Month + "A month of the year.") + + ($.documentation /.days + "The amount of days of a month." + [(days month)]) + + ($.documentation /.leap_year_days + "The amount of days of a month (in a leap year)." + [(leap_year_days month)]) + + ($.documentation /.year + "All the months, ordered by when they come in a year.")] [])) diff --git a/stdlib/source/documentation/lux/time/year.lux b/stdlib/source/documentation/lux/time/year.lux index b8dc23837..85341eb24 100644 --- a/stdlib/source/documentation/lux/time/year.lux +++ b/stdlib/source/documentation/lux/time/year.lux @@ -1,7 +1,7 @@ (.require [library [lux (.except and) - ["$" documentation (.only documentation:)] + ["$" documentation] [data ["[0]" text (.only \n) ["%" \\format (.only format)]]] @@ -10,40 +10,11 @@ [\\library ["[0]" /]]) -(documentation: /.Year - (format "A year in the gregorian calendar." - \n "Both negative (< 0) and positive (> 0) values are valid, but not 0." - \n "This is because the first year of the gregorian calendar was year 1.")) - -(documentation: /.year - "A valid year in the gregorian calendar, if possible." - [(year value)]) - -(documentation: /.days - "The amount of days in a typical year.") - -(documentation: /.Period - "An amount of years.") - -(documentation: /.leaps - "The number of leap years in a period of years." - [(leaps year)]) - -(documentation: /.codec - (format "Based on ISO 8601." - \n "For example: 2017")) - (.def .public documentation (.List $.Module) ($.module /._ "" - [..Year - ..year - ..days - ..Period - ..leaps - ..codec - ($.default /.there_is_no_year_0) + [($.default /.there_is_no_year_0) ($.default /.value) ($.default /.epoch) ($.default /.leap) @@ -52,5 +23,28 @@ ($.default /.leap?) ($.default /.parser) ($.default /.equivalence) - ($.default /.order)] + ($.default /.order) + + ($.documentation /.Year + (format "A year in the gregorian calendar." + \n "Both negative (< 0) and positive (> 0) values are valid, but not 0." + \n "This is because the first year of the gregorian calendar was year 1.")) + + ($.documentation /.year + "A valid year in the gregorian calendar, if possible." + [(year value)]) + + ($.documentation /.days + "The amount of days in a typical year.") + + ($.documentation /.Period + "An amount of years.") + + ($.documentation /.leaps + "The number of leap years in a period of years." + [(leaps year)]) + + ($.documentation /.codec + (format "Based on ISO 8601." + \n "For example: 2017"))] [])) -- cgit v1.2.3