logo

drewdevault.com

[mirror] blog and personal website of Drew DeVault git clone https://hacktivis.me/git/mirror/drewdevault.com.git
commit: 1cc28b4bd0257b5a8dcda1dbc64a4620b21436d0
parent 591f34d6d28ab7ee4a318bb2b5bcb9a041a8f95a
Author: Drew DeVault <sir@cmpwn.com>
Date:   Sat, 14 May 2022 16:11:29 +0200

typo

Diffstat:

Mcontent/blog/generating-ioctls.md6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/content/blog/generating-ioctls.md b/content/blog/generating-ioctls.md @@ -201,7 +201,7 @@ let typedefre: regex::regex = regex::regex { ... }; This sets aside two regular expressions: one that identifies type aliases (so that we can parse them to determine their size later), and one that identifies -our @\_IO\* psuedo-macros. I also defined some types to store each of the +our @\_IO\* pseudo-macros. I also defined some types to store each of the details necessary to compute the ioctl assignment: ```hare @@ -312,7 +312,7 @@ def TUNGETFILTER: u32 = @_IOR('T', 219, sock_fprog); ``` Back to the main loop, we have another regex test to check if we're looking at a -line with one of these psuedo-macros: +line with one of these pseudo-macros: ```hare let groups = match (regex::find(&ioctlre, line)!) { @@ -503,7 +503,7 @@ I think this is a nice case study in a few useful features available from the Hare standard library. In addition to POSIX Extended Regular Expression support via the [regex] module, the [hare namespace] offers many tools to provide Hare programs with relatively deep insights into the language itself. We can use -hare::lex to parse the custom grammar for our psuedo-macros, use hare::parse to +hare::lex to parse the custom grammar for our pseudo-macros, use hare::parse to parse type declarations, and use hare::types to compute the semantic details of each type. I also like many of the "little things" on display here, such as unreading data back into the buffered stdin reader, or using io::tee to copy