MCPcopy Create free account
hub / github.com/FreeCAD/FreeCAD / isComment

Method isComment

src/Gui/PythonConsole.cpp:895–915  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

893}
894
895bool PythonConsole::isComment(const QString& source) const
896{
897 if (source.isEmpty()) {
898 return false;
899 }
900 int i = 0;
901 while (i < source.length()) {
902 QChar ch = source.at(i++);
903 if (ch.isSpace()) {
904 continue;
905 }
906 else if (ch == QLatin1Char('#')) {
907 return true;
908 }
909 else {
910 return false;
911 }
912 }
913
914 return false;
915}
916
917/**
918 * Prints the Python statement cmd to the console.

Callers

nothing calls this directly

Calls 3

atMethod · 0.80
isEmptyMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected