LaTeXML...Locator(3)

πŸ“¦ version 0.8.8, in nixos 26.05, nixpkgs unstable

okay so bestie, welcome to the <rainbow>LaTeXML...Locator(3)</rainbow> page β€” it's from User Contributed Perl Documentation, and it's giving β€œtiny but important source-file reference energy.” no cap, let's go. πŸ’…

✨ NAME ✨

LaTeXML::Common::Locator β€” literally a reference to a point or a range in the source file. that's the whole name moment. πŸŽ€

🌸 DESCRIPTION 🌸

okay so LaTeXML::Common::Locator contains a reference to a point or a range within a source file. This data structure is intended to be used both programmatically (for "source references") and to display error messages to the user. it extends LaTeXML::Common::Object, periodt. πŸ’–

πŸŽ€ Locator Creation πŸŽ€

  • $locator = LaTeXML::Common::Locator->new($source, $fromLine, $fromCol, $toLine, $toCol); β€” creates a new locator. $source should be a string containing the full path of the source file, an empty string in case of a literal string, or undef in case of an anonymous string. $fromLine and $fromCol should be integers containing the line and column numbers of the start of the range in the source file, or undef if unknown. $toLine and $toCol should be the integers containing the line and column numbers of the end of the range, or undef if a point is being referred to. slay.
  • $locator = LaTeXML::Common::Locator->newRange($from, $to); β€” creates a new locator, starting at the locator $from and ending at the locator $to. Either locator may be undef, in which case the other one is returned. iconic.

πŸ¦‹ Methods πŸ¦‹

  • $str = $locator->toString; β€” turns this locator into a short string for output in user messages. cute.
  • $str = $locator->stringify; β€” turns this locator into a long string, including the full filename of the input. full name reveal.
  • $attr = $locator->toAttribute; β€” turns this locator into an XPointer expression, for usage within an XML attribute.
  • $isRange = $locator->isRange; β€” checks if this locator points to a range or a point.
  • $source = $locator->getShortSource($stringSource); β€” gets a short string referring to the source of this locator. $stringSource will be used if the source refers to an anonymous or literal string input.
  • $from = $locator->getFromLocator; β€” gets a locator pointing to the first point in the range of this locator. Works for both point and range locators.
  • $from = $locator->getToLocator; β€” gets a locator pointing to the last point in the range of this locator. Does not work for point locators.
heads up bestie: getToLocator does not work for point locators. that's a real caveat, not a vibe.

πŸ‘‘ AUTHOR πŸ‘‘

shoutout to Bruce Miller <bruce.miller@nist.gov> and Tom Wiesing <tom.wiesing@gmail.com> β€” authors, icons, the moment. 🫢

Public domain software, produced as part of work done by the United States Government & not subject to copyright in the US. πŸ’œ


okay that's the page, bestie β€” byeee, go reference some source files responsibly πŸŒˆπŸ’– β€” source/version perl v5.42.3, dated 2024-02-26.

πŸ“¦ where this page comes from