Class RustUtils
java.lang.Object
org.opengrok.indexer.analysis.rust.RustUtils
Represents a container for Rust-related utility methods.
- 
Method Summary
Modifier and TypeMethodDescriptionstatic intcountRawHashes(String capture) Counts the number of hashes ('#') before a terminating quote ('"') incapture.static booleanisRawEnding(String capture, int rawHashCount) Determines if the specifiedcapturestarts with a quote ('"') and is followed by the specified number of hashes (plus possibly an excess number of hashes), indicating the end of a raw- or raw-byte- string. 
- 
Method Details
- 
countRawHashes
Counts the number of hashes ('#') before a terminating quote ('"') incapture.- Parameters:
 capture- the Rust raw- or raw-byte-string initiator (e.g.,"r##\"")- Returns:
 - the number of hashes counted
 
 - 
isRawEnding
Determines if the specifiedcapturestarts with a quote ('"') and is followed by the specified number of hashes (plus possibly an excess number of hashes), indicating the end of a raw- or raw-byte- string.- Parameters:
 capture- the possible Rust raw- or raw-byte-string ender (e.g.,"\"####")rawHashCount- the number of required hashes in order to be considered "raw-ending"- Returns:
 - true if the 
captureis determined to be "raw-ending" or false otherwise (N.b., there may have been too many hashes captured, so any excess ofyylength()minus one minusrawHashCountshould be pushed back. 
 
 -