page_util_quote(3tcl)

πŸ“¦
version 2.0 Β· 2 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– page_util_quote β€” the character quoting glow-up πŸ’–

okay bestie, so this is a page from the Parser generator tools corner of the tcllib-verse, and it's literally all about turning characters into other forms and back again. no cap, it's small but it's mighty. ✨


🌸 NAME 🌸

page_util_quote β€” the page character quoting utilities, aka your little bestie for making chars behave in polite Tcl society πŸ’…


✨ SYNOPSIS ✨

package require page::util::quote ?0.2?

package require snit

::page::util::quote::unquote char

::page::util::quote::quote'tcl char

::page::util::quote::quote'tclstr char

::page::util::quote::quote'tclcom char

πŸ¦‹ DESCRIPTION πŸ¦‹

So this package is giving "small but essential." It hands you a few utility commands whose whole job is converting characters into various forms. That's it, that's the vibe. πŸŽ€


πŸ‘‘ API πŸ‘‘

πŸ’œ ::page::util::quote::unquote char

Okay so picture this: you've got a character chillin' inside an abstract syntax tree, stored there by a PEG processor β€” think the packages grammar::peg::interpreter, grammar::me, and all their little relations β€” so it's sitting there in some quoted form. This command takes that character and converts it into the equivalent Tcl character. The character gets returned as the result of the command. periodt. 🌟

πŸ’œ ::page::util::quote::quote'tcl char

This one takes a Tcl character (the internal representation, iykyk) and converts it into a string that:

  • is accepted by the Tcl parser πŸ”₯
  • will regenerate the character in question πŸ’«
  • is 7bit ASCII, because we keep it old-school πŸ“Ό

The string is returned as the result of this command. slay.

πŸ’œ ::page::util::quote::quote'tclstr char

This one takes a Tcl character (internal representation again, bestie) and converts it into a string that is accepted by the Tcl parser and will generate a human readable representation of the character in question. The string is returned as the result of this command. 🫢

Some deets you need to know:

  • The string does not use any unprintable characters. 🚫
  • It may use backslash-quoting. \ we love her.
  • High UTF characters are quoted to avoid problems with the still prevalent ascii terminals (the ascii terminals are doing their best okay 😭).
  • It is assumed that the string will be used in a double-quoted environment.

πŸ’œ ::page::util::quote::quote'tclcom char

Last one, and she's the comment-friendly queen πŸ‘‘. This command takes a Tcl character (internal representation) and converts it into a string which is accepted by the Tcl parser when used within a Tcl comment. The string is returned as the result of this command. 🌈


πŸ’€ BUGS, IDEAS, FEEDBACK πŸ’€

ngl, this document and the package it describes will undoubtedly contain bugs and other problems. Not a maybe, a definitely. πŸ™ˆ

Please report such in the category page of the Tcllib Trackers at:

http://core.tcl.tk/tcllib/reportlist

Also please report any ideas for enhancements you may have for either the package and/or the documentation. We want the glow-up ideas fr fr. πŸ’–

When proposing code changes, please provide unified diffs, i.e the output of diff -u.

Note further that attachments are strongly preferred over inlined patches. Attachments can be made by going to the Edit form of the ticket immediately after its creation, and then using the left-most button in the secondary navigation bar. πŸŽ€

πŸ”₯ KEYWORDS πŸ”₯

page, parser generator, quoting, text processing


⭐ CATEGORY ⭐

Page Parser Generator


Copyright (c) 2007 Andreas Kupries <andreas_kupries@users.sourceforge.net>


and that's the whole page, bestie!! this one's from tcllib, version 1.0, and it lives its life as page_util_quote(3tcl). go forth and quote your characters responsibly πŸ’…βœ¨πŸ¦‹

πŸ“¦ where this page comes from