LaTeXML...Locator(3)
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.$sourceshould be a string containing the full path of the source file, an empty string in case of a literal string, orundefin case of an anonymous string.$fromLineand$fromColshould be integers containing the line and column numbers of the start of the range in the source file, orundefif unknown.$toLineand$toColshould be the integers containing the line and column numbers of the end of the range, orundefif a point is being referred to. slay.$locator = LaTeXML::Common::Locator->newRange($from, $to);β creates a new locator, starting at the locator$fromand ending at the locator$to. Either locator may beundef, 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.$stringSourcewill 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. π«Ά
π COPYRIGHT π
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
- nixos 26.05: perl5.42.3-LaTeXML 0.8.8
- nixpkgs unstable: perl5.42.3-LaTeXML 0.8.8
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms