MCPcopy Create free account
hub / github.com/csound/csound / isToken

Function isToken

interfaces/CsoundFile.cpp:770–792  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

768}
769
770bool isToken(std::string text, int position, std::string token)
771{
772 size_t tokenend = position + token.size();
773 if(text.size() > tokenend)
774 {
775 if(!std::isspace(text[tokenend]))
776 {
777 return false;
778 }
779 }
780 for(int i = position - 1; i >= 0; --i)
781 {
782 if(text[i] == ';')
783 {
784 return false;
785 }
786 else if(text[i] == '\n')
787 {
788 return true;
789 }
790 }
791 return true;
792}
793
794int findToken(std::string text, std::string token, int position)
795{

Callers 1

findTokenFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected