From Umar Getagazov to ~sircmpwn/hare-dev
Trims the first space in every line of a comment for every declaration (" - list item" versus "- list item") so that comments are parsed correctly. Signed-off-by: Umar Getagazov <umar@handlerug.me> --- v1 -> v2: do the trimming in the code that wants it trimmed, not vice versa. That was quite stupid wasn't it cmd/haredoc/html.ha | 4 +++- cmd/haredoc/util.ha | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/cmd/haredoc/html.ha b/cmd/haredoc/html.ha [message trimmed]
From Umar Getagazov to ~sircmpwn/hare-dev
Fixes some of the unresolved references and incorrect documentation. Signed-off-by: Umar Getagazov <umar@handlerug.me> --- crypto/blowfish/blowfish.ha | 6 +++--- crypto/chacha/README | 13 +++++++------ crypto/chacha/chacha20.ha | 3 ++- datetime/arithmetic.ha | 12 ++++++------ hare/unparse/type.ha | 2 +- linux/timerfd/timerfd.ha | 4 ++-- unix/+linux/pipe.ha | 9 ++++----- unix/signal/+linux.ha | 2 +- 8 files changed, 26 insertions(+), 25 deletions(-) [message trimmed]
From Umar Getagazov to ~sircmpwn/hare-dev
Modifies the Hare source code parser so that it strips the first space in a comment line. haredoc and hare::unparse changed accordingly. Signed-off-by: Umar Getagazov <umar@handlerug.me> --- cmd/haredoc/html.ha | 2 +- cmd/haredoc/tty.ha | 3 +-- hare/lex/lex.ha | 6 +++++- hare/unparse/decl.ha | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/cmd/haredoc/html.ha b/cmd/haredoc/html.ha index ac165ce7..5d1ee996 100644 --- a/cmd/haredoc/html.ha [message trimmed]
From Umar Getagazov to ~sircmpwn/hare-dev
Fixes "TODO:" and alikes being mistakenly linkified. Signed-off-by: Umar Getagazov <umar@handlerug.me> --- cmd/haredoc/html.ha | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/cmd/haredoc/html.ha b/cmd/haredoc/html.ha index 0f2c2fce..ac165ce7 100644 --- a/cmd/haredoc/html.ha +++ b/cmd/haredoc/html.ha @@ -16,6 +16,7 @@ use hare::lex; use hare::module; use hare::unparse; [message trimmed]
From Umar Getagazov to ~sircmpwn/hare-dev
Fixes paragraphs that begin with references getting split into a reference text and a remainder paragraph. scantext handles references already. Signed-off-by: Umar Getagazov <umar@handlerug.me> --- cmd/haredoc/docstr.ha | 2 -- 1 file changed, 2 deletions(-) diff --git a/cmd/haredoc/docstr.ha b/cmd/haredoc/docstr.ha index 0d33aa67..b57f55f2 100644 --- a/cmd/haredoc/docstr.ha +++ b/cmd/haredoc/docstr.ha @@ -70,8 +70,6 @@ fn scandoc(par: *parser) (token | void) = { [message trimmed]
From Umar Getagazov to ~sircmpwn/hare-dev
Oops, forgot to add a trailer referencing the ticket: https://todo.sr.ht/~sircmpwn/hare/598 Can you add it after applying? Thanks in advance!
From Umar Getagazov to ~sircmpwn/hare-dev
strings::sub works on runes, not bytes (which is what the return value of len(str) is counted in). Use strings::rtrim instead. While in there, make the break condition in scantext more specific. Signed-off-by: Umar Getagazov <umar@handlerug.me> --- cmd/haredoc/docstr.ha | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/cmd/haredoc/docstr.ha b/cmd/haredoc/docstr.ha index e56ff77..7c4a5a5 100644 --- a/cmd/haredoc/docstr.ha +++ b/cmd/haredoc/docstr.ha [message trimmed]
From Umar Getagazov to ~sircmpwn/hare-dev
Commit 3928a02c5cc148fa9c14645627695e1f038784a0 silently broke this
script. Instead of passing variables as format strings into printf, it
made them be passed as separate arguments, therefore not interpolating
any flag characters (which is a good thing). However, this also meant
that printf now did not interpolate any escape sequences, including \n.
The shell does not interpolate them either, so all line-munging routines
broke.
The most obvious solution is to move \n to the format string, like this:
info=$(printf '%s\n' "${info}${author} ${mail};${year}")
If blindly applied, however, one more issue comes up. Per IEEE Std
1003.1-2017 (POSIX.1-2017), section 2.6.3 (emphasis mine):
[message trimmed]
From Umar Getagazov to ~sircmpwn/hare-dev
Signed-off-by: Umar Getagazov <umar@handlerug.me> --- language/types.tex | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/language/types.tex b/language/types.tex index aecdbce..027b896 100644 --- a/language/types.tex +++ b/language/types.tex @@ -572,9 +572,6 @@ The tag value shall be the type ID of the type which is selected from the constituent types. This value shall be stored at the \terminal{uint} field and shall indicate which type is stored in the value area. \informative{It follows that the types \code{(A | B)} and \code{(B | A)}[message trimmed]
From Umar Getagazov to ~sircmpwn/hare-dev
Signed-off-by: Umar Getagazov <umar@handlerug.me> --- v2 -> v3: less code, uri::fmt. I actually remembered that I wanted to use uri::fmt but then went with uri::string for some reason. cmd/haredoc/html.ha | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/cmd/haredoc/html.ha b/cmd/haredoc/html.ha index 785da86..b60b234 100644 --- a/cmd/haredoc/html.ha +++ b/cmd/haredoc/html.ha @@ -15,6 +15,7 @@ use hare::lex; use hare::module; [message trimmed]