Directory: | ./ |
---|---|
File: | tmp_project/PhoenixTex2Html/src/PConfigParser.cpp |
Date: | 2025-03-24 18:12:43 |
Exec | Total | Coverage | |
---|---|---|---|
Lines: | 685 | 777 | 88.2% |
Branches: | 995 | 1322 | 75.3% |
Line | Branch | Exec | Source |
---|---|---|---|
1 | /*************************************** | ||
2 | Auteur : Pierre Aubert | ||
3 | Mail : pierre.aubert@lapp.in2p3.fr | ||
4 | Licence : CeCILL-C | ||
5 | ****************************************/ | ||
6 | |||
7 | #include <stdio.h> | ||
8 | #include <stdlib.h> | ||
9 | #include <time.h> | ||
10 | |||
11 | #include <sys/stat.h> | ||
12 | #include <sys/types.h> | ||
13 | |||
14 | #include "data_all.h" | ||
15 | #include "pxml_utils.h" | ||
16 | |||
17 | #include "PMarkdownParser.h" | ||
18 | |||
19 | #include "PConfigParser.h" | ||
20 | |||
21 | ///Default constructeur of PConfigParser | ||
22 | /** @param installPrefix : installation prefix | ||
23 | */ | ||
24 | 1095 | PConfigParser::PConfigParser(const PString & installPrefix) | |
25 | 1095 | :PGenericParser(installPrefix) | |
26 | { | ||
27 | 1095 | initialisationPConfigParser(installPrefix); | |
28 | 1095 | } | |
29 | |||
30 | ///Copy constructor of PConfigParser | ||
31 | /** @param other : class to copy | ||
32 | */ | ||
33 | ✗ | PConfigParser::PConfigParser(const PConfigParser & other) | |
34 | ✗ | :PGenericParser(other) | |
35 | { | ||
36 | ✗ | copyPConfigParser(other); | |
37 | } | ||
38 | |||
39 | ///Destructeur of PConfigParser | ||
40 | 2190 | PConfigParser::~PConfigParser(){ | |
41 | 2190 | saveMapFile(); | |
42 | } | ||
43 | |||
44 | ///Definition of equal operator of PConfigParser | ||
45 | /** @param other : class to copy | ||
46 | * @return copied class | ||
47 | */ | ||
48 | ✗ | PConfigParser & PConfigParser::operator = (const PConfigParser & other){ | |
49 | ✗ | copyPConfigParser(other); | |
50 | ✗ | return *this; | |
51 | } | ||
52 | |||
53 | ///Copy function of PConfigParser | ||
54 | /** @param other : class to copy | ||
55 | */ | ||
56 | ✗ | void PConfigParser::copyPConfigParser(const PConfigParser & other){ | |
57 | ✗ | p_isAllowComment = other.p_isAllowComment; | |
58 | ✗ | p_isAllowMath = other.p_isAllowMath; | |
59 | } | ||
60 | |||
61 | ///Parse the input file | ||
62 | /** @return true on success, false otherwise | ||
63 | */ | ||
64 | 1094 | bool PConfigParser::parseFile(){ | |
65 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1094 times.
|
1094 | if(!p_run) return false; |
66 |
1/1✓ Branch 1 taken 1094 times.
|
1094 | p_currentSource.setType(PLatexType::FILE); |
67 |
2/2✓ Branch 2 taken 1094 times.
✓ Branch 5 taken 1094 times.
|
1094 | p_currentSource.setSourceFile(p_parser->getLocation().getFileName()); |
68 | 1094 | p_currentSource.setSourceLine(1lu); | |
69 |
1/1✓ Branch 2 taken 1094 times.
|
1094 | p_currentSource.setLink("index.html"); |
70 |
3/3✓ Branch 2 taken 1094 times.
✓ Branch 5 taken 1094 times.
✓ Branch 8 taken 1094 times.
|
1094 | p_currentSource.setName(p_parser->getFileName().getFileName().eraseExtension()); |
71 | |||
72 | //To parse the file we need to read char by char until we get something we know | ||
73 |
5/6✓ Branch 1 taken 124330 times.
✓ Branch 2 taken 1094 times.
✓ Branch 3 taken 124330 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 124330 times.
✓ Branch 6 taken 1094 times.
|
125424 | while(!p_parser->isEndOfFile() && p_run){ //If we are not at the end of the file |
74 |
2/2✓ Branch 1 taken 118229 times.
✓ Branch 2 taken 6101 times.
|
124330 | if(parseAllLatexObj(p_currentSource, p_currentText)){} |
75 | else{ | ||
76 | 118229 | incrementCurrentChar(p_currentText); | |
77 | } | ||
78 | } | ||
79 | 1094 | playTextLatexObj(p_currentSource, p_currentText); | |
80 | |||
81 | 1094 | return true; | |
82 | } | ||
83 | |||
84 | ///Initialisation to be done just before loading a file | ||
85 | 1094 | void PConfigParser::preLoadFile(){ | |
86 | //Save the current source | ||
87 | 1094 | clearLatexObj(p_currentSource); | |
88 | 1094 | clearLatexObj(p_currentText); | |
89 |
1/1✓ Branch 2 taken 1094 times.
|
1094 | p_parser->setWhiteSpace(""); |
90 |
1/1✓ Branch 2 taken 1094 times.
|
1094 | p_parser->setSeparator(""); |
91 | 1094 | } | |
92 | |||
93 | ///Initialisation to be done just after loading a file | ||
94 | 1092 | void PConfigParser::postLoadFile(){ | |
95 | |||
96 | 1092 | } | |
97 | |||
98 | ///Initialisation function of the class PConfigParser | ||
99 | /** @param baseInstallPrefix : installation prefix | ||
100 | */ | ||
101 | 1095 | void PConfigParser::initialisationPConfigParser(const PString & baseInstallPrefix){ | |
102 | 1095 | p_isAllowMath = true; | |
103 | 1095 | p_isAllowComment = true; | |
104 | 1095 | } | |
105 | |||
106 | ///Load a included file | ||
107 | /** @param[out] parent : parent PLatexObj | ||
108 | * @param[out] textObj : saved text | ||
109 | * @param fileName : name of the file to be loaded | ||
110 | * @return true on success, false otherwise | ||
111 | */ | ||
112 | 4 | bool PConfigParser::loadInclude(PLatexObj & parent, PLatexObj & textObj, const PPath & fileName){ | |
113 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 4 times.
|
4 | if(fileName == "") return false; |
114 |
1/1✓ Branch 1 taken 4 times.
|
4 | PPath fileToBeUsed(fileName); |
115 | 4 | bool removeTmpFilename(false); | |
116 |
3/4✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✗ Branch 7 not taken.
✓ Branch 8 taken 4 times.
|
4 | if(fileName.isSameBegining("http")){ |
117 | ✗ | if(!wgetFile(fileName)){ | |
118 | ✗ | errorAt(); | |
119 | ✗ | std::cerr << "PConfigParser::loadInclude : cannot get file with url = '"<<fileName<<"'" << std::endl; | |
120 | ✗ | return true; | |
121 | } | ||
122 | ✗ | fileToBeUsed = fileName.getFileName(); | |
123 | ✗ | removeTmpFilename = true; | |
124 | } | ||
125 | |||
126 |
1/1✓ Branch 1 taken 4 times.
|
4 | PString fileExtension(fileToBeUsed.getExtension()); |
127 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 2 taken 1 times.
|
4 | if(fileExtension == "md"){ |
128 |
1/1✓ Branch 1 taken 3 times.
|
3 | PMarkdownParser mdParser(*this); |
129 | |||
130 |
1/1✓ Branch 1 taken 3 times.
|
3 | bool b = mdParser.load(fileToBeUsed); |
131 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 3 times.
|
3 | if(!b){return b;} |
132 |
1/1✓ Branch 1 taken 3 times.
|
3 | PLatexObj & mainLatexObj = mdParser.getSource(); |
133 |
1/1✓ Branch 1 taken 3 times.
|
3 | std::vector<PLatexObj> & vecObj = mainLatexObj.getVecContent(); |
134 |
2/2✓ Branch 4 taken 271 times.
✓ Branch 5 taken 3 times.
|
274 | for(std::vector<PLatexObj>::iterator it(vecObj.begin()); it != vecObj.end(); ++it){ |
135 |
1/1✓ Branch 2 taken 271 times.
|
271 | addLatexObj(parent, *it); |
136 | } | ||
137 |
1/1✓ Branch 1 taken 3 times.
|
3 | copyPGenericParser(mdParser); |
138 | 3 | return b; | |
139 | 3 | } | |
140 | |||
141 |
1/1✓ Branch 1 taken 1 times.
|
1 | PFileParser parser; |
142 |
1/1✓ Branch 1 taken 1 times.
|
1 | p_listFileParser.push_back(parser); |
143 |
2/2✓ Branch 2 taken 1 times.
✓ Branch 5 taken 1 times.
|
1 | p_listFileParser.back().setSeparator(MULTI_PARSER_SEPARATORS_STRING); |
144 | 1 | p_parser = &p_listFileParser.back(); | |
145 |
2/3✓ Branch 1 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
|
1 | if(!p_parser->open(fileToBeUsed)){ |
146 | ✗ | std::cerr << "PMultiFileParser::load : can't open file '" << fileToBeUsed << "'" << std::endl; | |
147 | ✗ | return false; | |
148 | } | ||
149 |
2/2✓ Branch 1 taken 1 times.
✓ Branch 4 taken 1 times.
|
1 | p_parser->setWhiteSpace(""); |
150 |
2/2✓ Branch 1 taken 1 times.
✓ Branch 4 taken 1 times.
|
1 | p_parser->setSeparator(""); |
151 |
6/7✓ Branch 1 taken 90 times.
✓ Branch 3 taken 89 times.
✓ Branch 4 taken 1 times.
✓ Branch 5 taken 89 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 89 times.
✓ Branch 8 taken 1 times.
|
90 | while(!p_parser->isEndOfFile() && p_run){ |
152 |
1/1✓ Branch 1 taken 89 times.
|
89 | long unsigned int currentPos = p_parser->getCurrentCharIdx(); |
153 |
3/3✓ Branch 1 taken 89 times.
✓ Branch 3 taken 77 times.
✓ Branch 4 taken 12 times.
|
89 | if(parseAllLatexObj(parent, textObj)){} |
154 | else{ | ||
155 |
1/1✓ Branch 1 taken 77 times.
|
77 | incrementCurrentChar(textObj); |
156 | } | ||
157 | |||
158 |
3/9✓ Branch 1 taken 89 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 89 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✓ Branch 11 taken 89 times.
|
89 | if(currentPos == p_parser->getCurrentCharIdx() && !p_parser->isEndOfFile()){ |
159 | ✗ | std::cerr << "PMultiFileParser::load : the parser is stucked at the position :" << std::endl << "\t" << p_parser->getLocation() << std::endl; | |
160 | ✗ | p_run = false; | |
161 | } | ||
162 | } | ||
163 |
2/3✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 1 times.
|
1 | if(p_run) playTextLatexObj(parent, textObj); |
164 | 1 | p_listFileParser.pop_back(); | |
165 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
1 | if(p_listFileParser.size() > 0lu) p_parser = &p_listFileParser.back(); |
166 | ✗ | else p_parser = NULL; | |
167 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1 times.
|
1 | if(removeTmpFilename){ |
168 | ✗ | remove(fileToBeUsed.c_str()); | |
169 | } | ||
170 | 1 | return p_run; | |
171 | 4 | } | |
172 | |||
173 | ///Parse all the functions which have complex mono parameter in braces {...} | ||
174 | /** @param[out] parent : parent PLatexObj | ||
175 | * @param[out] textObj : PLatexObj to deal with text | ||
176 | * @param functionName : name of the expected function | ||
177 | * @param type : type of the expected function | ||
178 | * @return true on success, false otherwise | ||
179 | */ | ||
180 | 848456 | bool PConfigParser::parseComplexMonoParam(PLatexObj & parent, PLatexObj & textObj, const PString & functionName, PLatexType::PLatexType type){ | |
181 |
3/3✓ Branch 1 taken 848456 times.
✓ Branch 3 taken 848307 times.
✓ Branch 4 taken 149 times.
|
848456 | if(!p_parser->isMatchToken(functionName)){return false;} |
182 |
1/1✓ Branch 1 taken 149 times.
|
149 | playTextLatexObj(parent, textObj); |
183 |
1/1✓ Branch 1 taken 149 times.
|
149 | PLatexObj tmp; |
184 |
1/1✓ Branch 1 taken 149 times.
|
149 | tmp.setType(type); |
185 | |||
186 |
1/1✓ Branch 1 taken 149 times.
|
149 | PString textOption(getOptionStringBetweenHook()); |
187 |
1/1✓ Branch 1 taken 149 times.
|
149 | tmp.setText(textOption); |
188 | |||
189 |
3/3✓ Branch 1 taken 149 times.
✓ Branch 4 taken 149 times.
✓ Branch 7 taken 149 times.
|
149 | parseVecLatexObj(tmp, textObj, "{", "}"); |
190 | |||
191 |
1/1✓ Branch 1 taken 149 times.
|
149 | addLatexObj(parent, tmp); |
192 | 149 | return true; | |
193 | 149 | } | |
194 | |||
195 | ///Parse all the latex obj | ||
196 | /** @param[out] parent : parent PLatexObj | ||
197 | * @param[out] textObj : PLatexObj to deal with text | ||
198 | * @return true on success, false otherwise | ||
199 | */ | ||
200 | 174031 | bool PConfigParser::parseAllLatexObj(PLatexObj & parent, PLatexObj & textObj){ | |
201 |
3/3✓ Branch 2 taken 174031 times.
✓ Branch 5 taken 174008 times.
✓ Branch 6 taken 23 times.
|
174031 | if(p_parser->isMatch("{")){} |
202 |
3/3✓ Branch 2 taken 174008 times.
✓ Branch 5 taken 173990 times.
✓ Branch 6 taken 18 times.
|
174008 | else if(p_parser->isMatch("}")){} |
203 |
2/3✓ Branch 2 taken 173990 times.
✓ Branch 5 taken 173990 times.
✗ Branch 6 not taken.
|
173990 | else if(skipMonoParam("\\minitoc")){} |
204 |
2/3✓ Branch 2 taken 173990 times.
✓ Branch 5 taken 173990 times.
✗ Branch 6 not taken.
|
173990 | else if(skipMonoParam("\\newpage")){} |
205 |
2/3✓ Branch 2 taken 173990 times.
✓ Branch 5 taken 173990 times.
✗ Branch 6 not taken.
|
173990 | else if(skipMonoParam("\\centering")){} |
206 |
2/3✓ Branch 2 taken 173990 times.
✓ Branch 5 taken 173990 times.
✗ Branch 6 not taken.
|
173990 | else if(skipMonoParam("\\def\\sgn")){} |
207 |
2/3✓ Branch 2 taken 173990 times.
✓ Branch 5 taken 173990 times.
✗ Branch 6 not taken.
|
173990 | else if(skipMonoParam("\\,")){} |
208 |
2/2✓ Branch 1 taken 173932 times.
✓ Branch 2 taken 58 times.
|
173990 | else if(parsePercent(parent, textObj)){} |
209 |
2/2✓ Branch 3 taken 173918 times.
✓ Branch 4 taken 14 times.
|
173932 | else if(p_parser->isMatch(p_vecRemoveLatexKeyword) != ""){} |
210 |
2/2✓ Branch 1 taken 173863 times.
✓ Branch 2 taken 55 times.
|
173918 | else if(parseSpaceParagraphe(parent, textObj)){} |
211 |
2/2✓ Branch 1 taken 170911 times.
✓ Branch 2 taken 2952 times.
|
173863 | else if(parseNewLine(parent, textObj)){} |
212 |
1/2✓ Branch 1 taken 170911 times.
✗ Branch 2 not taken.
|
170911 | else if(parseRealNewLine(parent, textObj)){} |
213 |
1/2✓ Branch 1 taken 170911 times.
✗ Branch 2 not taken.
|
170911 | else if(parseDots(parent, textObj)){} |
214 | |||
215 |
3/3✓ Branch 2 taken 170911 times.
✓ Branch 5 taken 170799 times.
✓ Branch 6 taken 112 times.
|
170911 | else if(parseMonoParam(parent, textObj, "\\url", PLatexType::URL)){} |
216 |
2/2✓ Branch 1 taken 170357 times.
✓ Branch 2 taken 442 times.
|
170799 | else if(parseGenericLatexObj(parent, textObj)){} |
217 |
3/3✓ Branch 2 taken 170357 times.
✓ Branch 5 taken 170302 times.
✓ Branch 6 taken 55 times.
|
170357 | else if(parseComplexMonoParam(parent, textObj, "\\footnote", PLatexType::FOOTNOTE)){} |
218 |
3/3✓ Branch 2 taken 170302 times.
✓ Branch 5 taken 170225 times.
✓ Branch 6 taken 77 times.
|
170302 | else if(parseComplexMonoParam(parent, textObj, "\\caption", PLatexType::CAPTION)){} |
219 | |||
220 |
3/3✓ Branch 2 taken 170225 times.
✓ Branch 5 taken 170215 times.
✓ Branch 6 taken 10 times.
|
170225 | else if(parseComplexMonoParam(parent, textObj, "\\wip", PLatexType::WORK_IN_PROGRESS)){} |
221 |
3/3✓ Branch 2 taken 170215 times.
✓ Branch 5 taken 170210 times.
✓ Branch 6 taken 5 times.
|
170215 | else if(parseComplexMonoParam(parent, textObj, "\\workinprogress", PLatexType::WORK_IN_PROGRESS)){} |
222 |
2/2✓ Branch 1 taken 170207 times.
✓ Branch 2 taken 3 times.
|
170210 | else if(parserDetails(parent, textObj)){} |
223 |
2/2✓ Branch 1 taken 170203 times.
✓ Branch 2 taken 4 times.
|
170207 | else if(parserQuote(parent, textObj)){} |
224 |
2/2✓ Branch 1 taken 170132 times.
✓ Branch 2 taken 71 times.
|
170203 | else if(parseComment(parent, textObj)){} |
225 |
2/2✓ Branch 1 taken 170078 times.
✓ Branch 2 taken 54 times.
|
170132 | else if(parseDebug(parent, textObj)){} |
226 |
2/2✓ Branch 1 taken 169816 times.
✓ Branch 2 taken 262 times.
|
170078 | else if(parseHref(parent, textObj)){} |
227 |
2/2✓ Branch 1 taken 169661 times.
✓ Branch 2 taken 155 times.
|
169816 | else if(parseIncludeGraphic(parent, textObj)){} |
228 |
2/2✓ Branch 1 taken 169660 times.
✓ Branch 2 taken 1 times.
|
169661 | else if(parseAddSpeaker(parent, textObj)){} |
229 |
2/2✓ Branch 1 taken 169659 times.
✓ Branch 2 taken 1 times.
|
169660 | else if(parseSaveSpeaker(parent, textObj)){} |
230 |
2/2✓ Branch 1 taken 169655 times.
✓ Branch 2 taken 4 times.
|
169659 | else if(parseTimeTable(parent, textObj)){} |
231 | |||
232 |
3/3✓ Branch 2 taken 169655 times.
✓ Branch 5 taken 169568 times.
✓ Branch 6 taken 87 times.
|
169655 | else if(parseSectionTitle(parent, textObj, "\\part*", PLatexType::PARTSTAR)){} |
233 |
3/3✓ Branch 2 taken 169568 times.
✓ Branch 5 taken 169481 times.
✓ Branch 6 taken 87 times.
|
169568 | else if(parseSectionTitle(parent, textObj, "\\chapter*", PLatexType::CHAPTERSTAR)){} |
234 |
3/3✓ Branch 2 taken 169481 times.
✓ Branch 5 taken 169395 times.
✓ Branch 6 taken 86 times.
|
169481 | else if(parseSectionTitle(parent, textObj, "\\section*", PLatexType::SECTIONSTAR)){} |
235 |
3/3✓ Branch 2 taken 169395 times.
✓ Branch 5 taken 169310 times.
✓ Branch 6 taken 85 times.
|
169395 | else if(parseSectionTitle(parent, textObj, "\\subsection*", PLatexType::SUBSECTIONSTAR)){} |
236 |
3/3✓ Branch 2 taken 169310 times.
✓ Branch 5 taken 169225 times.
✓ Branch 6 taken 85 times.
|
169310 | else if(parseSectionTitle(parent, textObj, "\\subsubsection*", PLatexType::SUBSUBSECTIONSTAR)){} |
237 | |||
238 |
3/3✓ Branch 2 taken 169225 times.
✓ Branch 5 taken 169161 times.
✓ Branch 6 taken 64 times.
|
169225 | else if(parseSectionTitle(parent, textObj, "\\part", PLatexType::PART)){} |
239 |
3/3✓ Branch 2 taken 169161 times.
✓ Branch 5 taken 169078 times.
✓ Branch 6 taken 83 times.
|
169161 | else if(parseSectionTitle(parent, textObj, "\\chapter", PLatexType::CHAPTER)){} |
240 |
3/3✓ Branch 2 taken 169078 times.
✓ Branch 5 taken 169065 times.
✓ Branch 6 taken 13 times.
|
169078 | else if(parseSectionTitle(parent, textObj, "\\section", PLatexType::SECTION)){} |
241 |
3/3✓ Branch 2 taken 169065 times.
✓ Branch 5 taken 169062 times.
✓ Branch 6 taken 3 times.
|
169065 | else if(parseSectionTitle(parent, textObj, "\\subsection", PLatexType::SUBSECTION)){} |
242 |
2/3✓ Branch 2 taken 169062 times.
✓ Branch 5 taken 169062 times.
✗ Branch 6 not taken.
|
169062 | else if(parseSectionTitle(parent, textObj, "\\subsubsection", PLatexType::SUBSUBSECTION)){} |
243 | |||
244 |
3/3✓ Branch 2 taken 169062 times.
✓ Branch 5 taken 169060 times.
✓ Branch 6 taken 2 times.
|
169062 | else if(parseSectionTitle(parent, textObj, "\\bookpartseparator", PLatexType::BOOKPARTSEPARATOR)){} |
245 | |||
246 |
2/3✓ Branch 2 taken 169060 times.
✓ Branch 5 taken 169060 times.
✗ Branch 6 not taken.
|
169060 | else if(parseEnvStringOnly(parent, textObj, "displaymath", PLatexType::DISPLAYMATH)){} |
247 |
2/3✓ Branch 2 taken 169060 times.
✓ Branch 5 taken 169060 times.
✗ Branch 6 not taken.
|
169060 | else if(parseEnvStringOnly(parent, textObj, "equation", PLatexType::DISPLAYMATH)){} |
248 |
2/3✓ Branch 2 taken 169060 times.
✓ Branch 5 taken 169060 times.
✗ Branch 6 not taken.
|
169060 | else if(parseEnvStringOnly(parent, textObj, "equation*", PLatexType::DISPLAYMATH)){} |
249 |
3/3✓ Branch 2 taken 169060 times.
✓ Branch 5 taken 169030 times.
✓ Branch 6 taken 30 times.
|
169060 | else if(parseEnvStringOnly(parent, textObj, "eqnarray", PLatexType::EQNARRAY)){} |
250 |
2/3✓ Branch 2 taken 169030 times.
✓ Branch 5 taken 169030 times.
✗ Branch 6 not taken.
|
169030 | else if(parseEnvStringOnly(parent, textObj, "align*", PLatexType::EQNARRAY)){} |
251 |
1/2✓ Branch 1 taken 169030 times.
✗ Branch 2 not taken.
|
169030 | else if(parseDoubleInlineMath(parent, textObj)){} |
252 |
2/2✓ Branch 1 taken 168942 times.
✓ Branch 2 taken 88 times.
|
169030 | else if(parseInlineMath(parent, textObj)){} |
253 | |||
254 |
2/3✓ Branch 2 taken 168942 times.
✓ Branch 5 taken 168942 times.
✗ Branch 6 not taken.
|
168942 | else if(parseEnvironement(parent, textObj, "paragraph", PLatexType::PARAGRAPHE)){} |
255 |
3/3✓ Branch 2 taken 168942 times.
✓ Branch 5 taken 168785 times.
✓ Branch 6 taken 157 times.
|
168942 | else if(parseEnvironement(parent, textObj, "center", PLatexType::CENTER)){} |
256 |
3/3✓ Branch 2 taken 168785 times.
✓ Branch 5 taken 168783 times.
✓ Branch 6 taken 2 times.
|
168785 | else if(parseEnvironement(parent, textObj, "columns", PLatexType::COLUMNS)){} |
257 |
3/3✓ Branch 2 taken 168783 times.
✓ Branch 5 taken 168779 times.
✓ Branch 6 taken 4 times.
|
168783 | else if(parseEnvironement(parent, textObj, "column", PLatexType::COLUMN)){} |
258 | |||
259 |
3/3✓ Branch 2 taken 168779 times.
✓ Branch 5 taken 168622 times.
✓ Branch 6 taken 157 times.
|
168779 | else if(parseEnvironement(parent, textObj, "figure", PLatexType::FIGURE)){} |
260 |
2/3✓ Branch 2 taken 168622 times.
✓ Branch 5 taken 168622 times.
✗ Branch 6 not taken.
|
168622 | else if(parseEnvironement(parent, textObj, "wrapfigure", PLatexType::FIGURE)){} |
261 |
2/3✓ Branch 2 taken 168622 times.
✓ Branch 5 taken 168622 times.
✗ Branch 6 not taken.
|
168622 | else if(parseEnvironement(parent, textObj, "table", PLatexType::TABLE)){} |
262 |
2/2✓ Branch 1 taken 168620 times.
✓ Branch 2 taken 2 times.
|
168622 | else if(parseTabular(parent, textObj)){} |
263 |
3/3✓ Branch 2 taken 168620 times.
✓ Branch 5 taken 168614 times.
✓ Branch 6 taken 6 times.
|
168620 | else if(parseEnvironement(parent, textObj, "itemize", PLatexType::ITEMIZE)){} |
264 |
2/3✓ Branch 2 taken 168614 times.
✓ Branch 5 taken 168614 times.
✗ Branch 6 not taken.
|
168614 | else if(parseEnvironement(parent, textObj, "enumerate", PLatexType::ENUMERATE)){} |
265 |
2/2✓ Branch 1 taken 168593 times.
✓ Branch 2 taken 21 times.
|
168614 | else if(parseItem(parent, textObj)){} |
266 | |||
267 |
2/2✓ Branch 1 taken 168590 times.
✓ Branch 2 taken 3 times.
|
168593 | else if(parserCallDot(parent, textObj)){} |
268 |
2/2✓ Branch 1 taken 168588 times.
✓ Branch 2 taken 2 times.
|
168590 | else if(parserSvgToPng(parent, textObj)){} |
269 | |||
270 |
2/2✓ Branch 1 taken 168271 times.
✓ Branch 2 taken 317 times.
|
168588 | else if(parseExtraEnvironement(parent, textObj)){} |
271 |
2/2✓ Branch 1 taken 168270 times.
✓ Branch 2 taken 1 times.
|
168271 | else if(parseExtraEnvironementFunction(parent, textObj)){} |
272 |
2/2✓ Branch 1 taken 167662 times.
✓ Branch 2 taken 608 times.
|
168270 | else if(parseExtraFunction(parent, textObj)){} |
273 |
2/2✓ Branch 1 taken 167431 times.
✓ Branch 2 taken 231 times.
|
167662 | else if(parseParserLanguage(parent, textObj)){} |
274 |
2/2✓ Branch 1 taken 167367 times.
✓ Branch 2 taken 64 times.
|
167431 | else if(parseParserLanguageFunction(parent, textObj)){} |
275 | |||
276 |
2/2✓ Branch 1 taken 167363 times.
✓ Branch 2 taken 4 times.
|
167367 | else if(parseIncludeFile(parent, textObj)){} |
277 |
1/2✓ Branch 1 taken 167363 times.
✗ Branch 2 not taken.
|
167363 | else if(parseInputFile(parent, textObj)){} //An other non sens of latex |
278 |
2/2✓ Branch 1 taken 167357 times.
✓ Branch 2 taken 6 times.
|
167363 | else if(parseVideo(parent, textObj)){} |
279 |
2/2✓ Branch 1 taken 167355 times.
✓ Branch 2 taken 2 times.
|
167357 | else if(parseBookMainPageLink(parent, textObj)){} |
280 | else{ | ||
281 | 167355 | return false; | |
282 | } | ||
283 | 6676 | return true; | |
284 | } | ||
285 | |||
286 | ///Parse the book main page link | ||
287 | /** @param[out] parent : parent PLatexObj | ||
288 | * @param[out] textObj : PLatexObj to deal with text | ||
289 | * @return true on success, false otherwise | ||
290 | */ | ||
291 | 167357 | bool PConfigParser::parseBookMainPageLink(PLatexObj & parent, PLatexObj & textObj){ | |
292 |
1/1✓ Branch 1 taken 167357 times.
|
167357 | PLatexObj tmpParent; |
293 |
4/4✓ Branch 1 taken 167357 times.
✓ Branch 4 taken 167357 times.
✓ Branch 7 taken 2 times.
✓ Branch 8 taken 167355 times.
|
167357 | if(parseComplexMonoParam(tmpParent, textObj, "\\bookMainPageLink", PLatexType::BOOKMAINPAGELINK)){ |
294 |
2/3✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✗ Branch 5 not taken.
|
2 | if(tmpParent.getVecContent().size() != 0lu){ |
295 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 5 taken 2 times.
|
2 | p_bookMainPageLink = tmpParent.getVecContent().back(); |
296 |
5/5✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 8 taken 2 times.
✓ Branch 11 taken 2 times.
✓ Branch 14 taken 2 times.
|
2 | std::cout << "PConfigParser::parseBookMainPageLink : Update main page link (nb element = "<<tmpParent.getVecContent().size()<<")" << std::endl; |
297 | } | ||
298 | 2 | return true; | |
299 | }else{ | ||
300 | 167355 | return false; | |
301 | } | ||
302 | 167357 | } | |
303 | |||
304 | |||
305 | ///Parse a space paragraphe | ||
306 | /** @param[out] parent : parent PLatexObj | ||
307 | * @param[out] textObj : PLatexObj to deal with text | ||
308 | * @return true on success, false otherwise | ||
309 | */ | ||
310 | 173918 | bool PConfigParser::parseSpaceParagraphe(PLatexObj & parent, PLatexObj & textObj){ | |
311 |
4/4✓ Branch 1 taken 173918 times.
✓ Branch 4 taken 173918 times.
✓ Branch 7 taken 173863 times.
✓ Branch 8 taken 55 times.
|
173918 | if(!isMatch("\\spaceparagraphe")){return false;} |
312 |
1/1✓ Branch 1 taken 55 times.
|
55 | playTextLatexObj(parent, textObj); |
313 |
1/1✓ Branch 1 taken 55 times.
|
55 | getOptionStringBetweenBraces(); |
314 |
1/1✓ Branch 1 taken 55 times.
|
55 | PLatexObj tmp; |
315 |
1/1✓ Branch 1 taken 55 times.
|
55 | tmp.setType(PLatexType::SPACEPARAGRAPH); |
316 |
1/1✓ Branch 1 taken 55 times.
|
55 | addLatexObj(parent, tmp); |
317 | 55 | return true; | |
318 | 55 | } | |
319 | |||
320 | ///Parse a new line | ||
321 | /** @param[out] parent : parent PLatexObj | ||
322 | * @param[out] textObj : PLatexObj to deal with text | ||
323 | * @return true on success, false otherwise | ||
324 | */ | ||
325 | 173863 | bool PConfigParser::parseNewLine(PLatexObj & parent, PLatexObj & textObj){ | |
326 |
4/4✓ Branch 1 taken 173863 times.
✓ Branch 4 taken 173863 times.
✓ Branch 7 taken 170911 times.
✓ Branch 8 taken 2952 times.
|
173863 | if(!p_parser->isMatch("\n\n")){return false;} |
327 |
1/1✓ Branch 1 taken 2952 times.
|
2952 | playTextLatexObj(parent, textObj); |
328 |
1/1✓ Branch 1 taken 2952 times.
|
2952 | PLatexObj tmp; |
329 |
1/1✓ Branch 1 taken 2952 times.
|
2952 | tmp.setType(PLatexType::AUTOSPACEPARAGRAPH); |
330 |
1/1✓ Branch 1 taken 2952 times.
|
2952 | addLatexObj(parent, tmp); |
331 | 2952 | return true; | |
332 | 2952 | } | |
333 | |||
334 | ///Parse a new line | ||
335 | /** @param[out] parent : parent PLatexObj | ||
336 | * @param[out] textObj : PLatexObj to deal with text | ||
337 | * @return true on success, false otherwise | ||
338 | */ | ||
339 | 170911 | bool PConfigParser::parseRealNewLine(PLatexObj & parent, PLatexObj & textObj){ | |
340 |
3/4✓ Branch 1 taken 170911 times.
✓ Branch 4 taken 170911 times.
✓ Branch 7 taken 170911 times.
✗ Branch 8 not taken.
|
170911 | if(!p_parser->isMatch("\\\\")){return false;} |
341 | ✗ | playTextLatexObj(parent, textObj); | |
342 | ✗ | PLatexObj tmp; | |
343 | ✗ | tmp.setType(PLatexType::NEWLINE); | |
344 | ✗ | addLatexObj(parent, tmp); | |
345 | ✗ | return true; | |
346 | } | ||
347 | |||
348 | ///Parse a space paragraphe | ||
349 | /** @param[out] parent : parent PLatexObj | ||
350 | * @param[out] textObj : PLatexObj to deal with text | ||
351 | * @return true on success, false otherwise | ||
352 | */ | ||
353 | 170911 | bool PConfigParser::parseDots(PLatexObj & parent, PLatexObj & textObj){ | |
354 |
3/4✓ Branch 1 taken 170911 times.
✓ Branch 4 taken 170911 times.
✓ Branch 7 taken 170911 times.
✗ Branch 8 not taken.
|
170911 | if(!isMatch("\\dots")){return false;} |
355 | ✗ | playTextLatexObj(parent, textObj); | |
356 | ✗ | getOptionStringBetweenBraces(); | |
357 | ✗ | PLatexObj tmp; | |
358 | ✗ | tmp.setType(PLatexType::TEXT); | |
359 | ✗ | tmp.setText("... "); | |
360 | ✗ | addLatexObj(parent, tmp); | |
361 | ✗ | return true; | |
362 | } | ||
363 | ///Parse a file inclusion | ||
364 | /** @param[out] parent : parent PLatexObj | ||
365 | * @param[out] textObj : PLatexObj to deal with text | ||
366 | * @return true on success, false otherwise | ||
367 | */ | ||
368 | 167367 | bool PConfigParser::parseIncludeFile(PLatexObj & parent, PLatexObj & textObj){ | |
369 |
4/4✓ Branch 1 taken 167367 times.
✓ Branch 4 taken 167367 times.
✓ Branch 7 taken 167363 times.
✓ Branch 8 taken 4 times.
|
167367 | if(!p_parser->isMatchToken("\\include")){return false;} |
370 |
1/1✓ Branch 1 taken 4 times.
|
4 | playTextLatexObj(parent, textObj); |
371 |
2/2✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
|
4 | PString fileName(getStringBetweenBraces("\\include")); |
372 | |||
373 |
1/1✓ Branch 1 taken 4 times.
|
4 | PPath fileToBeLoaded(fileName); |
374 |
1/2✓ Branch 1 taken 4 times.
✗ Branch 2 not taken.
|
4 | if(fileToBeLoaded.size() != 0lu){ |
375 |
2/3✓ Branch 1 taken 4 times.
✓ Branch 3 taken 4 times.
✗ Branch 4 not taken.
|
4 | if(fileToBeLoaded[0] != '/'){ |
376 |
4/4✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 7 taken 4 times.
✓ Branch 10 taken 4 times.
|
4 | fileToBeLoaded = p_parser->getFileName().getParentDirectory() / fileToBeLoaded; |
377 | } | ||
378 | } | ||
379 |
1/1✓ Branch 1 taken 4 times.
|
4 | return loadInclude(parent, textObj, fileToBeLoaded); |
380 | 4 | } | |
381 | |||
382 | ///Parse a file inclusion | ||
383 | /** @param[out] parent : parent PLatexObj | ||
384 | * @param[out] textObj : PLatexObj to deal with text | ||
385 | * @return true on success, false otherwise | ||
386 | */ | ||
387 | 167363 | bool PConfigParser::parseInputFile(PLatexObj & parent, PLatexObj & textObj){ | |
388 |
3/4✓ Branch 1 taken 167363 times.
✓ Branch 4 taken 167363 times.
✓ Branch 7 taken 167363 times.
✗ Branch 8 not taken.
|
167363 | if(!p_parser->isMatchToken("\\input")){return false;} |
389 | ✗ | playTextLatexObj(parent, textObj); | |
390 | ✗ | PString fileName(getStringBetweenBraces("\\input")); | |
391 | |||
392 | ✗ | PPath fileToBeLoaded(fileName); | |
393 | ✗ | if(fileToBeLoaded.size() != 0lu){ | |
394 | ✗ | if(fileToBeLoaded[0] != '/'){ | |
395 | ✗ | fileToBeLoaded = p_parser->getFileName().getParentDirectory() / fileToBeLoaded; | |
396 | } | ||
397 | } | ||
398 | ✗ | return loadInclude(parent, textObj, fileToBeLoaded); | |
399 | } | ||
400 | |||
401 | ///Parse a file inclusion | ||
402 | /** @param[out] parent : parent PLatexObj | ||
403 | * @param[out] textObj : PLatexObj to deal with text | ||
404 | * @return true on success, false otherwise | ||
405 | */ | ||
406 | 167363 | bool PConfigParser::parseVideo(PLatexObj & parent, PLatexObj & textObj){ | |
407 |
4/4✓ Branch 1 taken 167363 times.
✓ Branch 4 taken 167363 times.
✓ Branch 7 taken 167357 times.
✓ Branch 8 taken 6 times.
|
167363 | if(!p_parser->isMatchToken("\\video")){return false;} |
408 |
1/1✓ Branch 1 taken 6 times.
|
6 | playTextLatexObj(parent, textObj); |
409 |
2/2✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
|
6 | PARSER_SKIP_SPACE |
410 |
1/1✓ Branch 1 taken 6 times.
|
6 | char ch = p_parser->getCurrentCh(); |
411 |
2/2✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
|
6 | PString prevToken(""), option("400"); |
412 |
1/1✓ Branch 1 taken 6 times.
|
6 | prevToken += ch; |
413 |
2/2✓ Branch 0 taken 3 times.
✓ Branch 1 taken 3 times.
|
6 | if(ch == '['){ //We skip the options for now |
414 |
1/1✓ Branch 1 taken 3 times.
|
3 | p_parser->getNextChar(); |
415 |
3/3✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
|
3 | option = p_parser->getUntilKeyWithoutPatern("]"); |
416 |
1/1✓ Branch 1 taken 3 times.
|
3 | prevToken += option; |
417 |
1/1✓ Branch 1 taken 3 times.
|
3 | ch = p_parser->getCurrentCh(); |
418 | } | ||
419 |
2/2✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
|
6 | PARSER_SKIP_SPACE |
420 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 6 times.
|
6 | if(ch != '{'){ |
421 | ✗ | errorAt(); | |
422 | ✗ | std::cerr << "PConfigParser::parseVideo : expect '{' after '"+prevToken+"' instead of '"<<ch<<"'" << std::endl; | |
423 | ✗ | stopParsing(); | |
424 | ✗ | return true; | |
425 | } | ||
426 |
1/1✓ Branch 1 taken 6 times.
|
6 | p_parser->getNextChar(); |
427 |
3/3✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
✓ Branch 7 taken 6 times.
|
12 | PPath fileName(p_parser->getUntilKeyWithoutPatern("}")); |
428 | |||
429 |
2/3✓ Branch 1 taken 6 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 6 times.
|
6 | if(fileName.getExtension() != "mp4"){ |
430 | ✗ | errorAt(); | |
431 | ✗ | std::cerr << "PConfigParser::parseVideo : use video '"<<fileName<<"' because the extension has to be '.mp4'" << std::endl; | |
432 | ✗ | stopParsing(); | |
433 | ✗ | return true; | |
434 | } | ||
435 | |||
436 |
1/1✓ Branch 1 taken 6 times.
|
6 | PLatexObj tmp; |
437 |
1/1✓ Branch 1 taken 6 times.
|
6 | tmp.setText(option); |
438 |
1/1✓ Branch 1 taken 6 times.
|
6 | tmp.setType(PLatexType::VIDEO); |
439 | |||
440 |
1/1✓ Branch 1 taken 6 times.
|
6 | PString buildFileName(""); |
441 |
3/4✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
✓ Branch 7 taken 6 times.
✗ Branch 8 not taken.
|
6 | if(!fileName.isSameBegining("http")){ |
442 |
1/1✓ Branch 1 taken 6 times.
|
6 | PPath fileToBeUsed(getAbsoluteFileName(fileName)); |
443 |
4/4✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
✓ Branch 7 taken 2 times.
✓ Branch 8 taken 4 times.
|
6 | if(fileToBeUsed.checkFileBegning("http")){ //If the file contains an url, we replace it by the url |
444 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | buildFileName = fileToBeUsed.loadFileContent(); |
445 | }else{ //Otherwise, we just copy the file | ||
446 |
4/4✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 7 taken 4 times.
✓ Branch 10 taken 4 times.
|
4 | buildFileName = copyFile(PPath(LATEX_VIDEO_OUTPUT_DIR), fileName); |
447 | } | ||
448 | 6 | }else{ | |
449 | ✗ | buildFileName = fileName; | |
450 | } | ||
451 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 6 times.
|
6 | if(buildFileName == ""){return true;} |
452 |
1/1✓ Branch 1 taken 6 times.
|
6 | tmp.setName(buildFileName); |
453 |
1/1✓ Branch 1 taken 6 times.
|
6 | addLatexObj(parent, tmp); |
454 | 6 | return true; | |
455 | 6 | } | |
456 | |||
457 | ///Parse a detail environement | ||
458 | /** @param[out] parent : parent PLatexObj | ||
459 | * @param[out] textObj : PLatexObj to deal with text | ||
460 | * @return true on success, false otherwise | ||
461 | */ | ||
462 | 170210 | bool PConfigParser::parserDetails(PLatexObj & parent, PLatexObj & textObj){ | |
463 |
2/2✓ Branch 1 taken 170210 times.
✓ Branch 4 taken 170210 times.
|
170210 | std::vector<PString> vecBeginPatern(getBeginSeqEnv("detail")); |
464 |
3/3✓ Branch 1 taken 170210 times.
✓ Branch 3 taken 170207 times.
✓ Branch 4 taken 3 times.
|
170210 | if(!p_parser->isMatchSeq(vecBeginPatern)){return false;} |
465 |
1/1✓ Branch 1 taken 3 times.
|
3 | playTextLatexObj(parent, textObj); |
466 | //Parse the summary | ||
467 |
1/1✓ Branch 1 taken 3 times.
|
3 | PLatexObj summaryObj; |
468 |
1/1✓ Branch 1 taken 3 times.
|
3 | summaryObj.setType(PLatexType::SUMMARY); |
469 |
3/3✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
|
3 | parseVecLatexObj(summaryObj, textObj, "{", "}"); |
470 | |||
471 |
1/1✓ Branch 1 taken 3 times.
|
3 | PLatexObj env; |
472 |
1/1✓ Branch 1 taken 3 times.
|
3 | env.setType(PLatexType::DETAILS); |
473 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | env.setName("details"); |
474 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | env.setBalise("details"); |
475 | |||
476 |
1/1✓ Branch 1 taken 3 times.
|
3 | addLatexObj(env, summaryObj); |
477 | //Parse the environement | ||
478 |
1/1✓ Branch 1 taken 3 times.
|
3 | PLatexObj tmpText; |
479 |
1/1✓ Branch 1 taken 3 times.
|
3 | tmpText.setType(PLatexType::TEXT); |
480 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | std::vector<PString> vecPatern(getEndSeqEnv("detail")); |
481 | |||
482 |
8/10✓ Branch 1 taken 100 times.
✓ Branch 3 taken 100 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 100 times.
✓ Branch 8 taken 97 times.
✓ Branch 9 taken 3 times.
✓ Branch 10 taken 97 times.
✗ Branch 11 not taken.
✓ Branch 12 taken 97 times.
✓ Branch 13 taken 3 times.
|
100 | while(!p_parser->isEndOfFile() && !p_parser->isMatchSeq(vecPatern) && p_run){ |
483 |
3/3✓ Branch 1 taken 97 times.
✓ Branch 3 taken 88 times.
✓ Branch 4 taken 9 times.
|
97 | if(parseAllLatexObj(env, tmpText)){} |
484 | else{ | ||
485 |
1/1✓ Branch 1 taken 88 times.
|
88 | incrementCurrentChar(tmpText); |
486 | } | ||
487 | } | ||
488 |
1/1✓ Branch 1 taken 3 times.
|
3 | playTextLatexObj(env, tmpText); |
489 |
1/1✓ Branch 1 taken 3 times.
|
3 | addLatexObj(parent, env); |
490 | 3 | return true; | |
491 | 170210 | } | |
492 | |||
493 | ///Parse a quote environnement | ||
494 | /** @param[out] parent : parent PLatexObj | ||
495 | * @param[out] textObj : PLatexObj to deal with text | ||
496 | * @return true on success, false otherwise | ||
497 | */ | ||
498 | 170207 | bool PConfigParser::parserQuote(PLatexObj & parent, PLatexObj & textObj){ | |
499 |
2/2✓ Branch 1 taken 170207 times.
✓ Branch 4 taken 170207 times.
|
170207 | std::vector<PString> vecBeginPatern(getBeginSeqEnv("quote")); |
500 |
3/3✓ Branch 1 taken 170207 times.
✓ Branch 3 taken 170203 times.
✓ Branch 4 taken 4 times.
|
170207 | if(!p_parser->isMatchSeq(vecBeginPatern)){return false;} |
501 |
1/1✓ Branch 1 taken 4 times.
|
4 | playTextLatexObj(parent, textObj); |
502 | |||
503 |
1/1✓ Branch 1 taken 4 times.
|
4 | PLatexObj env; |
504 |
1/1✓ Branch 1 taken 4 times.
|
4 | env.setType(PLatexType::QUOTE); |
505 | |||
506 |
1/1✓ Branch 1 taken 4 times.
|
4 | PLatexObj authorQuote; |
507 |
1/1✓ Branch 1 taken 4 times.
|
4 | authorQuote.setType(PLatexType::FUNCTION); |
508 |
2/2✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
|
4 | authorQuote.setName("rightline"); |
509 |
2/2✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
|
4 | authorQuote.setBalise("div"); |
510 |
3/3✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 7 taken 4 times.
|
4 | parseVecLatexObj(authorQuote, textObj, "{", "}"); |
511 | |||
512 |
1/1✓ Branch 1 taken 4 times.
|
4 | PLatexObj contentQuote; |
513 |
1/1✓ Branch 1 taken 4 times.
|
4 | contentQuote.setType(PLatexType::CENTER); |
514 | |||
515 | //Parse the environement | ||
516 |
1/1✓ Branch 1 taken 4 times.
|
4 | PLatexObj tmpText; |
517 |
1/1✓ Branch 1 taken 4 times.
|
4 | tmpText.setType(PLatexType::TEXT); |
518 |
2/2✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
|
4 | std::vector<PString> vecPatern(getEndSeqEnv("quote")); |
519 | |||
520 |
8/10✓ Branch 1 taken 704 times.
✓ Branch 3 taken 704 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 704 times.
✓ Branch 8 taken 700 times.
✓ Branch 9 taken 4 times.
✓ Branch 10 taken 700 times.
✗ Branch 11 not taken.
✓ Branch 12 taken 700 times.
✓ Branch 13 taken 4 times.
|
704 | while(!p_parser->isEndOfFile() && !p_parser->isMatchSeq(vecPatern) && p_run){ |
521 |
2/3✓ Branch 1 taken 700 times.
✓ Branch 3 taken 700 times.
✗ Branch 4 not taken.
|
700 | if(parseAllLatexObj(contentQuote, tmpText)){} |
522 | else{ | ||
523 |
1/1✓ Branch 1 taken 700 times.
|
700 | incrementCurrentChar(tmpText); |
524 | } | ||
525 | } | ||
526 |
1/1✓ Branch 1 taken 4 times.
|
4 | playTextLatexObj(contentQuote, tmpText); |
527 | |||
528 |
1/1✓ Branch 1 taken 4 times.
|
4 | addLatexObj(env, contentQuote); |
529 |
1/1✓ Branch 1 taken 4 times.
|
4 | addLatexObj(env, authorQuote); |
530 | |||
531 |
1/1✓ Branch 1 taken 4 times.
|
4 | addLatexObj(parent, env); |
532 | 4 | return true; | |
533 | 170207 | } | |
534 | |||
535 | ///Parse a call to dot | ||
536 | /** @param[out] parent : parent PLatexObj | ||
537 | * @param[out] textObj : PLatexObj to deal with text | ||
538 | * @return true on success, false otherwise | ||
539 | */ | ||
540 | 168593 | bool PConfigParser::parserCallDot(PLatexObj & parent, PLatexObj & textObj){ | |
541 |
4/4✓ Branch 1 taken 168593 times.
✓ Branch 4 taken 168593 times.
✓ Branch 7 taken 168590 times.
✓ Branch 8 taken 3 times.
|
168593 | if(!p_parser->isMatchToken("\\calldot")){return false;} |
542 |
1/1✓ Branch 1 taken 3 times.
|
3 | playTextLatexObj(parent, textObj); |
543 |
1/1✓ Branch 1 taken 3 times.
|
3 | p_parser->getNextChar(); |
544 |
1/1✓ Branch 1 taken 3 times.
|
3 | PLatexObj tmp; |
545 |
1/1✓ Branch 1 taken 3 times.
|
3 | tmp.setType(PLatexType::CALLDOT); |
546 |
3/3✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
|
6 | PString baseContent(p_parser->getUntilKeyWithoutPaternRecurse("}", "{")); |
547 |
1/1✓ Branch 1 taken 3 times.
|
3 | PString fileName(baseContent); |
548 |
1/1✓ Branch 1 taken 3 times.
|
3 | tmp.setName(fileName); |
549 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | tmp.setText(p_parser->getFileName()); |
550 |
1/1✓ Branch 1 taken 3 times.
|
3 | addLatexObj(parent, tmp); |
551 | 3 | return true; | |
552 | 3 | } | |
553 | |||
554 | ///Parse a svg to png function | ||
555 | /** @param[out] parent : parent PLatexObj | ||
556 | * @param[out] textObj : PLatexObj to deal with text | ||
557 | * @return true on success, false otherwise | ||
558 | */ | ||
559 | 168590 | bool PConfigParser::parserSvgToPng(PLatexObj & parent, PLatexObj & textObj){ | |
560 |
4/4✓ Branch 1 taken 168590 times.
✓ Branch 4 taken 168590 times.
✓ Branch 7 taken 168588 times.
✓ Branch 8 taken 2 times.
|
168590 | if(!p_parser->isMatchToken("\\svgtopng")){return false;} |
561 |
1/1✓ Branch 1 taken 2 times.
|
2 | playTextLatexObj(parent, textObj); |
562 |
1/1✓ Branch 1 taken 2 times.
|
2 | p_parser->getNextChar(); |
563 |
1/1✓ Branch 1 taken 2 times.
|
2 | PLatexObj tmp; |
564 |
1/1✓ Branch 1 taken 2 times.
|
2 | tmp.setType(PLatexType::SVGTOPNG); |
565 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | PString fileName(p_parser->getUntilKeyWithoutPatern("}")); |
566 |
1/1✓ Branch 1 taken 2 times.
|
2 | tmp.setName(fileName); |
567 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | tmp.setText(p_parser->getFileName()); |
568 |
1/1✓ Branch 1 taken 2 times.
|
2 | addLatexObj(parent, tmp); |
569 | 2 | return true; | |
570 | 2 | } | |
571 | |||
572 | ///Parse a comment | ||
573 | /** @param[out] parent : parent PLatexObj | ||
574 | * @param[out] textObj : PLatexObj to deal with text | ||
575 | * @return true on success, false otherwise | ||
576 | */ | ||
577 | 170203 | bool PConfigParser::parseComment(PLatexObj & parent, PLatexObj & textObj){ | |
578 |
2/2✓ Branch 0 taken 2881 times.
✓ Branch 1 taken 167322 times.
|
170203 | if(!p_isAllowComment){return false;} |
579 |
4/4✓ Branch 1 taken 167322 times.
✓ Branch 4 taken 167322 times.
✓ Branch 7 taken 167251 times.
✓ Branch 8 taken 71 times.
|
167322 | if(!p_parser->isMatch("%")){return false;} |
580 |
1/1✓ Branch 1 taken 71 times.
|
71 | playTextLatexObj(parent, textObj); |
581 |
2/2✓ Branch 1 taken 71 times.
✓ Branch 4 taken 71 times.
|
71 | PString comment(p_parser->getUntilKeyWithoutPatern("\n")); |
582 |
1/1✓ Branch 1 taken 71 times.
|
71 | PLatexObj tmp; |
583 |
1/1✓ Branch 1 taken 71 times.
|
71 | tmp.setType(PLatexType::COMMENT); |
584 |
1/1✓ Branch 1 taken 71 times.
|
71 | tmp.setName(comment); |
585 |
1/1✓ Branch 1 taken 71 times.
|
71 | addLatexObj(parent, tmp); |
586 | 71 | return true; | |
587 | 71 | } | |
588 | |||
589 | ///Parse the debug function | ||
590 | /** @param[out] parent : parent PLatexObj | ||
591 | * @param[out] textObj : PLatexObj to deal with text | ||
592 | * @return true on success, false otherwise | ||
593 | */ | ||
594 | 170132 | bool PConfigParser::parseDebug(PLatexObj & parent, PLatexObj & textObj){ | |
595 |
3/3✓ Branch 2 taken 170132 times.
✓ Branch 5 taken 170078 times.
✓ Branch 6 taken 54 times.
|
170132 | if(!p_parser->isMatchToken("\\debug")){return false;} |
596 |
1/2✓ Branch 0 taken 54 times.
✗ Branch 1 not taken.
|
54 | if(p_isDebugMode){ |
597 |
1/1✓ Branch 1 taken 54 times.
|
54 | playTextLatexObj(parent, textObj); |
598 |
1/1✓ Branch 1 taken 54 times.
|
54 | PLatexObj tmp; |
599 |
1/1✓ Branch 1 taken 54 times.
|
54 | tmp.setType(PLatexType::DEBUG); |
600 |
2/2✓ Branch 1 taken 54 times.
✓ Branch 4 taken 54 times.
|
54 | PString text(getStringBetweenBraces("\\debug")); |
601 |
1/1✓ Branch 1 taken 54 times.
|
54 | tmp.setName(text); |
602 |
1/1✓ Branch 1 taken 54 times.
|
54 | addLatexObj(parent, tmp); |
603 | 54 | } | |
604 | 54 | return true; | |
605 | } | ||
606 | |||
607 | ///Parse latex Href | ||
608 | /** @param[out] parent : parent PLatexObj | ||
609 | * @param[out] textObj : PLatexObj to deal with text | ||
610 | * @return true on success, false otherwise | ||
611 | */ | ||
612 | 170078 | bool PConfigParser::parseHref(PLatexObj & parent, PLatexObj & textObj){ | |
613 |
4/4✓ Branch 1 taken 170078 times.
✓ Branch 4 taken 170078 times.
✓ Branch 7 taken 169816 times.
✓ Branch 8 taken 262 times.
|
170078 | if(!p_parser->isMatchToken("\\href")){return false;} |
614 |
1/1✓ Branch 1 taken 262 times.
|
262 | playTextLatexObj(parent, textObj); |
615 |
1/1✓ Branch 1 taken 262 times.
|
262 | PLatexObj tmp; |
616 |
1/1✓ Branch 1 taken 262 times.
|
262 | tmp.setType(PLatexType::HREF); |
617 |
2/2✓ Branch 1 taken 262 times.
✓ Branch 4 taken 262 times.
|
262 | PString link(getStringBetweenBraces("\\href")); |
618 |
1/1✓ Branch 1 taken 262 times.
|
262 | tmp.setName(link); |
619 | |||
620 |
3/3✓ Branch 1 taken 262 times.
✓ Branch 4 taken 262 times.
✓ Branch 7 taken 262 times.
|
262 | parseVecLatexObj(tmp, textObj, "{", "}"); |
621 |
14/20✓ Branch 1 taken 262 times.
✓ Branch 4 taken 262 times.
✓ Branch 7 taken 262 times.
✓ Branch 9 taken 247 times.
✓ Branch 10 taken 15 times.
✓ Branch 12 taken 247 times.
✓ Branch 15 taken 247 times.
✓ Branch 18 taken 247 times.
✓ Branch 20 taken 247 times.
✗ Branch 21 not taken.
✓ Branch 22 taken 247 times.
✓ Branch 23 taken 15 times.
✓ Branch 25 taken 262 times.
✗ Branch 26 not taken.
✓ Branch 28 taken 247 times.
✓ Branch 29 taken 15 times.
✗ Branch 30 not taken.
✗ Branch 31 not taken.
✗ Branch 33 not taken.
✗ Branch 34 not taken.
|
262 | if(!tmp.getName().isSameBegining("http") && !tmp.getName().isSameBegining("https")){ |
622 |
4/4✓ Branch 1 taken 247 times.
✓ Branch 4 taken 247 times.
✓ Branch 7 taken 247 times.
✓ Branch 10 taken 247 times.
|
494 | PPath buildFileName(copyFile(PPath(LATEX_RESSOURCES_OUTPUT_DIR), link)); |
623 |
2/2✓ Branch 1 taken 37 times.
✓ Branch 2 taken 210 times.
|
247 | if(buildFileName == ""){ |
624 |
4/5✓ Branch 1 taken 37 times.
✓ Branch 4 taken 37 times.
✓ Branch 7 taken 37 times.
✗ Branch 12 not taken.
✓ Branch 13 taken 37 times.
|
37 | if(PPath(tmp.getName()).getExtension() != "html"){ |
625 | ✗ | errorAt(); | |
626 | ✗ | std::cerr << "PConfigParser::parseHref : cannot copy file '"<<link<<"' in '" LATEX_RESSOURCES_OUTPUT_DIR "'" << std::endl; | |
627 | ✗ | return true; | |
628 | } | ||
629 |
2/2✓ Branch 1 taken 37 times.
✓ Branch 4 taken 37 times.
|
37 | buildFileName = link; |
630 | } | ||
631 |
1/1✓ Branch 1 taken 247 times.
|
247 | tmp.setName(buildFileName); |
632 |
1/2✓ Branch 1 taken 247 times.
✗ Branch 2 not taken.
|
247 | } |
633 |
1/1✓ Branch 1 taken 262 times.
|
262 | addLatexObj(parent, tmp); |
634 | 262 | return true; | |
635 | 262 | } | |
636 | |||
637 | ///Parse latex percent | ||
638 | /** @param[out] parent : parent PLatexObj | ||
639 | * @param[out] textObj : PLatexObj to deal with text | ||
640 | * @return true on success, false otherwise | ||
641 | */ | ||
642 | 173990 | bool PConfigParser::parsePercent(PLatexObj & parent, PLatexObj & textObj){ | |
643 |
4/4✓ Branch 1 taken 173990 times.
✓ Branch 4 taken 173990 times.
✓ Branch 7 taken 173932 times.
✓ Branch 8 taken 58 times.
|
173990 | if(!p_parser->isMatch("\\%")){return false;} |
644 |
1/1✓ Branch 1 taken 58 times.
|
58 | playTextLatexObj(parent, textObj); |
645 |
1/1✓ Branch 1 taken 58 times.
|
58 | PLatexObj tmp; |
646 |
1/1✓ Branch 1 taken 58 times.
|
58 | tmp.setType(PLatexType::PERCENT); |
647 |
1/1✓ Branch 1 taken 58 times.
|
58 | addLatexObj(parent, tmp); |
648 | 58 | return true; | |
649 | 58 | } | |
650 | |||
651 | ///Parse all the functions which have complex mono parameter in braces {...} | ||
652 | /** @param[out] parent : parent PLatexObj | ||
653 | * @param[out] textObj : PLatexObj to deal with text | ||
654 | * @param functionName : name of the expected function | ||
655 | * @param type : type of the expected function | ||
656 | * @return true on success, false otherwise | ||
657 | */ | ||
658 | 1862062 | bool PConfigParser::parseSectionTitle(PLatexObj & parent, PLatexObj & textObj, const PString & functionName, PLatexType::PLatexType type){ | |
659 |
3/3✓ Branch 1 taken 1862062 times.
✓ Branch 3 taken 1861467 times.
✓ Branch 4 taken 595 times.
|
1862062 | if(!p_parser->isMatchToken(functionName)){return false;} |
660 |
1/1✓ Branch 1 taken 595 times.
|
595 | playTextLatexObj(parent, textObj); |
661 |
1/1✓ Branch 1 taken 595 times.
|
595 | PLatexObj tmp; |
662 |
1/1✓ Branch 1 taken 595 times.
|
595 | tmp.setType(type); |
663 |
3/3✓ Branch 1 taken 595 times.
✓ Branch 4 taken 595 times.
✓ Branch 7 taken 595 times.
|
595 | tmp.setSourceFile(p_parser->getLocation().getFileName()); |
664 |
3/3✓ Branch 1 taken 595 times.
✓ Branch 4 taken 595 times.
✓ Branch 7 taken 595 times.
|
595 | tmp.setSourceLine(p_parser->getLocation().getLine()); |
665 | |||
666 |
1/1✓ Branch 1 taken 595 times.
|
595 | PString textOption(getOptionStringBetweenHook()); |
667 |
1/1✓ Branch 1 taken 595 times.
|
595 | tmp.setText(textOption); |
668 |
1/1✓ Branch 1 taken 595 times.
|
595 | PLatexObj objTitle; |
669 |
3/3✓ Branch 1 taken 595 times.
✓ Branch 4 taken 595 times.
✓ Branch 7 taken 595 times.
|
595 | parseVecLatexObj(objTitle, textObj, "{", "}"); |
670 |
2/2✓ Branch 1 taken 595 times.
✓ Branch 4 taken 595 times.
|
595 | tmp.setComplexTitle(objTitle.getVecContent()); |
671 |
1/1✓ Branch 1 taken 595 times.
|
595 | addLatexObj(parent, tmp); |
672 | 595 | return true; | |
673 | 595 | } | |
674 | |||
675 | ///Parse a vector of latex object | ||
676 | /** @param[out] parent : parent PLatexObj | ||
677 | * @param[out] textObj : PLatexObj to deal with text | ||
678 | * @param beginPatern : starting partern to start the parsing of the vector of PLatexObj (disabled is empty) | ||
679 | * @param endPatern : end patern of the vector of latex obj | ||
680 | */ | ||
681 | 1621 | void PConfigParser::parseVecLatexObj(PLatexObj & parent, PLatexObj & textObj, const PString & beginPatern, const PString & endPatern){ | |
682 |
1/2✓ Branch 1 taken 1621 times.
✗ Branch 2 not taken.
|
1621 | if(beginPatern != ""){ //If we check the begin patern |
683 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 2 taken 1619 times.
|
1621 | if(!p_parser->isMatch(beginPatern)){ //And it does not match |
684 | 2 | return; //We stop | |
685 | } | ||
686 | } | ||
687 |
1/1✓ Branch 2 taken 1619 times.
|
1619 | PARSER_SKIP_SPACE |
688 |
7/8✓ Branch 1 taken 26217 times.
✓ Branch 2 taken 6 times.
✓ Branch 3 taken 26217 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 24604 times.
✓ Branch 7 taken 1613 times.
✓ Branch 8 taken 24604 times.
✓ Branch 9 taken 1619 times.
|
26223 | while(!p_parser->isEndOfFile() && p_run && !p_parser->isMatch(endPatern)){ |
689 | 24604 | long unsigned int currentPos = p_parser->getCurrentCharIdx(); | |
690 | |||
691 |
2/2✓ Branch 1 taken 24431 times.
✓ Branch 2 taken 173 times.
|
24604 | if(parseAllLatexObj(parent, textObj)){} |
692 | else{ | ||
693 | 24431 | incrementCurrentChar(textObj); | |
694 | } | ||
695 |
2/6✗ Branch 1 not taken.
✓ Branch 2 taken 24604 times.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✓ Branch 7 taken 24604 times.
|
24604 | if(currentPos == p_parser->getCurrentCharIdx() && !p_parser->isEndOfFile()){ |
696 | ✗ | std::cerr << "PConfigParser::parseVecLatexObj : the parser is stucked at the position :" << std::endl << "\t" << p_parser->getLocation() << std::endl; | |
697 | ✗ | p_run = false; | |
698 | } | ||
699 | } | ||
700 |
1/2✓ Branch 0 taken 1619 times.
✗ Branch 1 not taken.
|
1619 | if(p_run) playTextLatexObj(parent, textObj); |
701 | } | ||
702 | |||
703 | ///Parse the includegraphic command | ||
704 | /** @param[out] parent : parent PLatexObj | ||
705 | * @param[out] textObj : PLatexObj to deal with text | ||
706 | * @return true on success, false otherwise | ||
707 | */ | ||
708 | 169816 | bool PConfigParser::parseIncludeGraphic(PLatexObj & parent, PLatexObj & textObj){ | |
709 |
4/4✓ Branch 1 taken 169816 times.
✓ Branch 4 taken 169816 times.
✓ Branch 7 taken 169661 times.
✓ Branch 8 taken 155 times.
|
169816 | if(!p_parser->isMatchToken("\\includegraphics")){return false;} |
710 |
1/1✓ Branch 1 taken 155 times.
|
155 | playTextLatexObj(parent, textObj); |
711 |
2/2✓ Branch 1 taken 155 times.
✓ Branch 4 taken 155 times.
|
155 | PARSER_SKIP_SPACE |
712 |
1/1✓ Branch 1 taken 155 times.
|
155 | char ch = p_parser->getCurrentCh(); |
713 |
2/2✓ Branch 1 taken 155 times.
✓ Branch 4 taken 155 times.
|
155 | PString prevToken(""),option(""); |
714 |
1/1✓ Branch 1 taken 155 times.
|
155 | prevToken += ch; |
715 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 155 times.
|
155 | if(ch == '['){ //We skip the options for now |
716 | ✗ | p_parser->getNextChar(); | |
717 | ✗ | option = p_parser->getUntilKeyWithoutPatern("]"); | |
718 | ✗ | prevToken += option; | |
719 | ✗ | ch = p_parser->getCurrentCh(); | |
720 | } | ||
721 |
2/2✓ Branch 1 taken 155 times.
✓ Branch 4 taken 155 times.
|
155 | PARSER_SKIP_SPACE |
722 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 155 times.
|
155 | if(ch != '{'){ |
723 | ✗ | errorAt(); | |
724 | ✗ | std::cerr << "PConfigParser::parseIncludeGraphic : expect '{' after '"+prevToken+"' instead of '"<<ch<<"'" << std::endl; | |
725 | ✗ | stopParsing(); | |
726 | ✗ | return ""; | |
727 | } | ||
728 |
1/1✓ Branch 1 taken 155 times.
|
155 | p_parser->getNextChar(); |
729 |
2/2✓ Branch 1 taken 155 times.
✓ Branch 4 taken 155 times.
|
155 | PString imageFile(p_parser->getUntilKeyWithoutPatern("}")); |
730 |
1/1✓ Branch 1 taken 155 times.
|
155 | PLatexObj tmp; |
731 |
1/1✓ Branch 1 taken 155 times.
|
155 | tmp.setType(PLatexType::IMAGE); |
732 | |||
733 |
1/1✓ Branch 1 taken 155 times.
|
155 | PString buildFileName(""); |
734 |
3/4✓ Branch 1 taken 155 times.
✓ Branch 4 taken 155 times.
✓ Branch 7 taken 155 times.
✗ Branch 8 not taken.
|
155 | if(!imageFile.isSameBegining("http")){ |
735 |
5/5✓ Branch 1 taken 155 times.
✓ Branch 4 taken 155 times.
✓ Branch 7 taken 155 times.
✓ Branch 10 taken 155 times.
✓ Branch 13 taken 155 times.
|
155 | buildFileName = copyFile(PPath(LATEX_IMAGE_OUTPUT_DIR), imageFile); |
736 | }else{ | ||
737 | ✗ | buildFileName = imageFile; | |
738 | } | ||
739 |
2/2✓ Branch 1 taken 104 times.
✓ Branch 2 taken 51 times.
|
155 | if(buildFileName == ""){return true;} |
740 |
1/1✓ Branch 1 taken 51 times.
|
51 | tmp.setName(buildFileName); |
741 |
1/1✓ Branch 1 taken 51 times.
|
51 | tmp.setText(option); |
742 | |||
743 |
1/1✓ Branch 1 taken 51 times.
|
51 | addLatexObj(parent, tmp); |
744 | 51 | return true; | |
745 | 155 | } | |
746 | |||
747 | ///Parse the addspeakers command | ||
748 | /** @param[out] parent : parent PLatexObj | ||
749 | * @param[out] textObj : PLatexObj to deal with text | ||
750 | * @return true on success, false otherwise | ||
751 | */ | ||
752 | 169661 | bool PConfigParser::parseAddSpeaker(PLatexObj & parent, PLatexObj & textObj){ | |
753 |
4/4✓ Branch 1 taken 169661 times.
✓ Branch 4 taken 169661 times.
✓ Branch 7 taken 169660 times.
✓ Branch 8 taken 1 times.
|
169661 | if(!p_parser->isMatchToken("\\addspeakers")){return false;} |
754 |
1/1✓ Branch 1 taken 1 times.
|
1 | playTextLatexObj(parent, textObj); |
755 |
2/2✓ Branch 1 taken 1 times.
✓ Branch 4 taken 1 times.
|
1 | PPath speakerConfig = getOptionStringBetweenBraces(); |
756 |
3/3✓ Branch 1 taken 1 times.
✓ Branch 4 taken 1 times.
✓ Branch 7 taken 1 times.
|
2 | PPath speakerFile = p_parser->getFileName().getParentDirectory() / speakerConfig; |
757 | |||
758 |
2/3✓ Branch 1 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
|
1 | if(!ptimetable_loadSpeaker(p_vecSpeaker, speakerFile)){ |
759 | ✗ | errorAt(); | |
760 | ✗ | std::cerr << "PConfigParser::parseTimeTable : cannot parse speakers configuration '"+speakerFile+"'" << std::endl; | |
761 | ✗ | stopParsing(); | |
762 | ✗ | return true; | |
763 | } | ||
764 | |||
765 | 1 | return true; | |
766 | 1 | } | |
767 | |||
768 | ///Parse the savespeakers command | ||
769 | /** @param[out] parent : parent PLatexObj | ||
770 | * @param[out] textObj : PLatexObj to deal with text | ||
771 | * @return true on success, false otherwise | ||
772 | */ | ||
773 | 169660 | bool PConfigParser::parseSaveSpeaker(PLatexObj & parent, PLatexObj & textObj){ | |
774 |
3/3✓ Branch 2 taken 169660 times.
✓ Branch 5 taken 169659 times.
✓ Branch 6 taken 1 times.
|
169660 | if(!p_parser->isMatchToken("\\savespeakers")){return false;} |
775 | 1 | playTextLatexObj(parent, textObj); | |
776 | 1 | getOptionStringBetweenBraces(); | |
777 | |||
778 |
2/2✓ Branch 2 taken 1 times.
✓ Branch 5 taken 1 times.
|
1 | pspeaker_tex(parent.getVecContent(), p_vecSpeaker, "sec_full_speakers"); |
779 | 1 | return true; | |
780 | } | ||
781 | |||
782 | ///Parse the timetable command | ||
783 | /** @param[out] parent : parent PLatexObj | ||
784 | * @param[out] textObj : PLatexObj to deal with text | ||
785 | * @return true on success, false otherwise | ||
786 | */ | ||
787 | 169659 | bool PConfigParser::parseTimeTable(PLatexObj & parent, PLatexObj & textObj){ | |
788 |
4/4✓ Branch 1 taken 169659 times.
✓ Branch 4 taken 169659 times.
✓ Branch 7 taken 169655 times.
✓ Branch 8 taken 4 times.
|
169659 | if(!p_parser->isMatchToken("\\timetable")){return false;} |
789 |
1/1✓ Branch 1 taken 4 times.
|
4 | playTextLatexObj(parent, textObj); |
790 |
2/2✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
|
4 | PPath timetableConfig = getOptionStringBetweenBraces(); |
791 |
3/3✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 7 taken 4 times.
|
8 | PPath timeTableFile = p_parser->getFileName().getParentDirectory() / timetableConfig; |
792 | //We have to try to load speakers in some are defined in the timetable configuration | ||
793 | //But we need also to add \addspeakers function to update a map of speakers in the PGenericParser | ||
794 | |||
795 | //Load the timetable toml config | ||
796 |
1/1✓ Branch 1 taken 4 times.
|
4 | PTimeTable timetable; |
797 | 4 | bool isAlreadyDefinedSpeaker = p_vecSpeaker.size() != 0lu; | |
798 |
2/2✓ Branch 0 taken 2 times.
✓ Branch 1 taken 2 times.
|
4 | if(isAlreadyDefinedSpeaker){ |
799 |
1/1✓ Branch 1 taken 2 times.
|
2 | timetable.setVecSpeaker(p_vecSpeaker); |
800 | } | ||
801 |
2/3✓ Branch 1 taken 4 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 4 times.
|
4 | if(!ptimetable_load(timetable, timeTableFile)){ |
802 | ✗ | errorAt(); | |
803 | ✗ | std::cerr << "PConfigParser::parseTimeTable : cannot parse timetable configuration '"+timeTableFile+"'" << std::endl; | |
804 | ✗ | stopParsing(); | |
805 | ✗ | return true; | |
806 | } | ||
807 | //Update begin and end time of blocks | ||
808 |
1/1✓ Branch 1 taken 4 times.
|
4 | ptimetable_updateEndTime(timetable); |
809 | //Create the HTML PLatexObj | ||
810 |
5/6✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 7 taken 4 times.
✓ Branch 10 taken 4 times.
✗ Branch 14 not taken.
✓ Branch 15 taken 4 times.
|
4 | if(!ptimetable_tex(parent.getVecContent(), timetable, PPath(LATEX_INVITATION_OUTPUT_DIR), !isAlreadyDefinedSpeaker)){ |
811 | ✗ | errorAt(); | |
812 | ✗ | std::cerr << "PConfigParser::parseTimeTable : cannot save timetable '"+timeTableFile+"'" << std::endl; | |
813 | ✗ | stopParsing(); | |
814 | } | ||
815 | 4 | return true; | |
816 | 4 | } | |
817 | |||
818 | ///Parse latex environement | ||
819 | /** @param[out] parent : parent PLatexObj | ||
820 | * @param[out] textObj : PLatexObj to deal with text | ||
821 | * @param environementName : name of the evironement | ||
822 | * @param type : type of the environement | ||
823 | * @return true on success, false otherwise | ||
824 | */ | ||
825 | 1518709 | bool PConfigParser::parseEnvironement(PLatexObj & parent, PLatexObj & textObj, const PString & environementName, PLatexType::PLatexType type){ | |
826 |
1/1✓ Branch 1 taken 1518709 times.
|
1518709 | std::vector<PString> vecPatern(getBeginSeqEnv(environementName)); |
827 |
3/3✓ Branch 1 taken 1518709 times.
✓ Branch 3 taken 1518383 times.
✓ Branch 4 taken 326 times.
|
1518709 | if(!p_parser->isMatchSeq(vecPatern)){return false;} |
828 |
2/2✓ Branch 1 taken 326 times.
✓ Branch 4 taken 326 times.
|
326 | return parseEnvironementContent(parent, textObj, environementName, type, true, true, "div"); |
829 | 1518709 | } | |
830 | |||
831 | ///Parse latex environement | ||
832 | /** @param[out] parent : parent PLatexObj | ||
833 | * @param[out] textObj : PLatexObj to deal with text | ||
834 | * @param environementName : name of the evironement | ||
835 | * @param type : type of the environement | ||
836 | * @param isAllowComment : true to allow comment, false otherwise | ||
837 | * @param isAllowMath : true to allow math, false otherwise | ||
838 | * @param envBalise : balise of the env to be used | ||
839 | * @return true on success, false otherwise | ||
840 | */ | ||
841 | 642 | bool PConfigParser::parseEnvironementContent(PLatexObj & parent, PLatexObj & textObj, const PString & environementName, | |
842 | PLatexType::PLatexType type, bool isAllowComment, bool isAllowMath, const PString & envBalise) | ||
843 | { | ||
844 |
1/1✓ Branch 1 taken 642 times.
|
642 | playTextLatexObj(parent, textObj); |
845 |
1/1✓ Branch 1 taken 642 times.
|
642 | PLatexObj env; |
846 |
1/1✓ Branch 1 taken 642 times.
|
642 | env.setType(type); |
847 |
1/1✓ Branch 1 taken 642 times.
|
642 | env.setName(environementName); |
848 |
1/1✓ Branch 1 taken 642 times.
|
642 | env.setBalise(envBalise); |
849 |
1/1✓ Branch 1 taken 642 times.
|
642 | PLatexObj tmpText; |
850 |
1/1✓ Branch 1 taken 642 times.
|
642 | tmpText.setType(PLatexType::TEXT); |
851 |
1/1✓ Branch 1 taken 642 times.
|
642 | std::vector<PString> vecPatern(getEndSeqEnv(environementName)); |
852 | |||
853 | 642 | bool saveIsAllowComment(p_isAllowComment), saveIsAllowMath(p_isAllowMath); | |
854 | 642 | p_isAllowComment = isAllowComment; | |
855 | 642 | p_isAllowMath = isAllowMath; | |
856 |
9/10✓ Branch 1 taken 23766 times.
✓ Branch 3 taken 23757 times.
✓ Branch 4 taken 9 times.
✓ Branch 6 taken 23757 times.
✓ Branch 8 taken 23124 times.
✓ Branch 9 taken 633 times.
✓ Branch 10 taken 23124 times.
✗ Branch 11 not taken.
✓ Branch 12 taken 23124 times.
✓ Branch 13 taken 642 times.
|
23766 | while(!p_parser->isEndOfFile() && !p_parser->isMatchSeq(vecPatern) && p_run){ |
857 |
3/3✓ Branch 1 taken 23124 times.
✓ Branch 3 taken 22799 times.
✓ Branch 4 taken 325 times.
|
23124 | if(parseAllLatexObj(env, tmpText)){} |
858 | else{ | ||
859 |
1/1✓ Branch 1 taken 22799 times.
|
22799 | incrementCurrentChar(tmpText); |
860 | } | ||
861 | } | ||
862 | 642 | p_isAllowComment = saveIsAllowComment; | |
863 | 642 | p_isAllowMath = saveIsAllowMath; | |
864 | |||
865 |
1/1✓ Branch 1 taken 642 times.
|
642 | playTextLatexObj(env, tmpText); |
866 |
1/1✓ Branch 1 taken 642 times.
|
642 | addLatexObj(parent, env); |
867 | 642 | return true; | |
868 | 642 | } | |
869 | |||
870 | ///Parse a tabular environement | ||
871 | /** @param[out] parent : parent PLatexObj | ||
872 | * @param[out] textObj : PLatexObj to deal with text | ||
873 | * @return true on success, false otherwise | ||
874 | */ | ||
875 | 168622 | bool PConfigParser::parseTabular(PLatexObj & parent, PLatexObj & textObj){ | |
876 |
2/2✓ Branch 1 taken 168622 times.
✓ Branch 4 taken 168622 times.
|
168622 | std::vector<PString> vecBeginPatern(getBeginSeqEnv("tabular")); |
877 |
3/3✓ Branch 1 taken 168622 times.
✓ Branch 3 taken 168620 times.
✓ Branch 4 taken 2 times.
|
168622 | if(!p_parser->isMatchSeq(vecBeginPatern)){return false;} |
878 |
1/1✓ Branch 1 taken 2 times.
|
2 | playTextLatexObj(parent, textObj); |
879 |
1/1✓ Branch 1 taken 2 times.
|
2 | getOptionStringBetweenBraces(); //Remove tabular option |
880 |
1/1✓ Branch 1 taken 2 times.
|
2 | PLatexObj envTabular; |
881 |
1/1✓ Branch 1 taken 2 times.
|
2 | envTabular.setType(PLatexType::TABULAR); |
882 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | envTabular.setName("tabular"); |
883 | |||
884 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | std::vector<PString> vecEndPatern(getEndSeqEnv("tabular")); |
885 | |||
886 |
8/10✓ Branch 1 taken 24 times.
✓ Branch 3 taken 24 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 24 times.
✓ Branch 8 taken 22 times.
✓ Branch 9 taken 2 times.
✓ Branch 10 taken 22 times.
✗ Branch 11 not taken.
✓ Branch 12 taken 22 times.
✓ Branch 13 taken 2 times.
|
24 | while(!p_parser->isEndOfFile() && !p_parser->isMatchSeq(vecEndPatern) && p_run){ //Parse all rows |
887 |
1/1✓ Branch 1 taken 22 times.
|
22 | PLatexObj rowObj; |
888 |
1/1✓ Branch 1 taken 22 times.
|
22 | rowObj.setType(PLatexType::TABROW); |
889 |
3/3✓ Branch 1 taken 124 times.
✓ Branch 3 taken 122 times.
✓ Branch 4 taken 2 times.
|
146 | while(!p_parser->isEndOfFile() && !p_parser->isMatchSeq(vecEndPatern, true) && |
890 |
11/15✓ Branch 1 taken 124 times.
✓ Branch 3 taken 124 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 122 times.
✓ Branch 9 taken 122 times.
✓ Branch 11 taken 102 times.
✓ Branch 12 taken 20 times.
✓ Branch 13 taken 102 times.
✗ Branch 14 not taken.
✓ Branch 15 taken 122 times.
✓ Branch 16 taken 2 times.
✓ Branch 18 taken 102 times.
✓ Branch 19 taken 22 times.
✗ Branch 20 not taken.
✗ Branch 21 not taken.
|
248 | !p_parser->isMatch("\\\\") && p_run) //Parse one row |
891 | { | ||
892 |
1/1✓ Branch 1 taken 102 times.
|
102 | PLatexObj cellObj; |
893 |
1/1✓ Branch 1 taken 102 times.
|
102 | cellObj.setType(PLatexType::TABCELL); |
894 | |||
895 |
1/1✓ Branch 1 taken 102 times.
|
102 | PLatexObj tmpText; |
896 |
1/1✓ Branch 1 taken 102 times.
|
102 | tmpText.setType(PLatexType::TEXT); |
897 | //Parse all cells | ||
898 |
3/3✓ Branch 1 taken 834 times.
✓ Branch 3 taken 832 times.
✓ Branch 4 taken 2 times.
|
936 | while(!p_parser->isEndOfFile() && !p_parser->isMatchSeq(vecEndPatern, true) && |
899 |
4/6✓ Branch 1 taken 832 times.
✓ Branch 4 taken 832 times.
✓ Branch 6 taken 812 times.
✓ Branch 7 taken 20 times.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
|
1664 | !p_parser->isMatchRewind("\\\\") && |
900 |
13/17✓ Branch 1 taken 834 times.
✓ Branch 3 taken 834 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 812 times.
✓ Branch 9 taken 812 times.
✓ Branch 11 taken 732 times.
✓ Branch 12 taken 80 times.
✓ Branch 13 taken 732 times.
✗ Branch 14 not taken.
✓ Branch 15 taken 812 times.
✓ Branch 16 taken 22 times.
✓ Branch 18 taken 832 times.
✓ Branch 19 taken 2 times.
✓ Branch 20 taken 732 times.
✓ Branch 21 taken 102 times.
✗ Branch 22 not taken.
✗ Branch 23 not taken.
|
2500 | !p_parser->isMatch("&") && p_run) //Parse one cell |
901 | { | ||
902 |
3/3✓ Branch 1 taken 732 times.
✓ Branch 3 taken 688 times.
✓ Branch 4 taken 44 times.
|
732 | if(parseAllLatexObj(cellObj, tmpText)){} |
903 | else{ | ||
904 |
1/1✓ Branch 1 taken 688 times.
|
688 | incrementCurrentChar(tmpText); |
905 | } | ||
906 | } | ||
907 |
1/1✓ Branch 1 taken 102 times.
|
102 | playTextLatexObj(cellObj, tmpText, true); |
908 |
3/3✓ Branch 1 taken 102 times.
✓ Branch 4 taken 100 times.
✓ Branch 5 taken 2 times.
|
102 | if(cellObj.getVecContent().size() != 0lu){ |
909 |
2/2✓ Branch 1 taken 100 times.
✓ Branch 4 taken 100 times.
|
100 | rowObj.getVecContent().push_back(cellObj); //Add cell in row |
910 | } | ||
911 | 102 | } | |
912 |
3/3✓ Branch 1 taken 22 times.
✓ Branch 4 taken 20 times.
✓ Branch 5 taken 2 times.
|
22 | if(rowObj.getVecContent().size() != 0lu){ |
913 |
2/2✓ Branch 1 taken 20 times.
✓ Branch 4 taken 20 times.
|
20 | envTabular.getVecContent().push_back(rowObj); //Add row in tabular |
914 | } | ||
915 | 22 | } | |
916 | |||
917 |
1/1✓ Branch 1 taken 2 times.
|
2 | addLatexObj(parent, envTabular); |
918 | 2 | return true; | |
919 | 168622 | } | |
920 | |||
921 | ///Parse an environement which contains only a string | ||
922 | /** @param[out] parent : parent PLatexObj | ||
923 | * @param[out] textObj : PLatexObj to deal with text | ||
924 | * @param environementName : name of the environement | ||
925 | * @param type : type of the environement | ||
926 | * @return true on success, false otherwise | ||
927 | */ | ||
928 | 845270 | bool PConfigParser::parseEnvStringOnly(PLatexObj & parent, PLatexObj & textObj, const PString & environementName, PLatexType::PLatexType type){ | |
929 |
1/1✓ Branch 1 taken 845270 times.
|
845270 | p_parser->pushPosition(); |
930 |
4/4✓ Branch 1 taken 845270 times.
✓ Branch 4 taken 845270 times.
✓ Branch 7 taken 840750 times.
✓ Branch 8 taken 4520 times.
|
845270 | if(!p_parser->isMatchToken("\\begin")){return false;} |
931 |
4/4✓ Branch 1 taken 4520 times.
✓ Branch 4 taken 4520 times.
✓ Branch 7 taken 4520 times.
✓ Branch 10 taken 4520 times.
|
9040 | PString envName(getStringBetweenBraces("\\begin").eraseFirstLastChar(" \t\n")); |
932 |
2/2✓ Branch 1 taken 4490 times.
✓ Branch 2 taken 30 times.
|
4520 | if(environementName != envName){ |
933 |
1/1✓ Branch 1 taken 4490 times.
|
4490 | p_parser->popPosition(); |
934 | 4490 | return false; | |
935 | } | ||
936 |
1/1✓ Branch 1 taken 30 times.
|
30 | playTextLatexObj(parent, textObj); |
937 |
4/4✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
✓ Branch 7 taken 30 times.
✓ Branch 10 taken 30 times.
|
60 | PString envContent(p_parser->getUntilKeyWithoutPatern("\\end{"+environementName+"}")); |
938 | |||
939 |
1/1✓ Branch 1 taken 30 times.
|
30 | PLatexObj tmp; |
940 |
1/1✓ Branch 1 taken 30 times.
|
30 | tmp.setType(type); |
941 |
1/1✓ Branch 1 taken 30 times.
|
30 | tmp.setText(envContent); |
942 | |||
943 |
1/1✓ Branch 1 taken 30 times.
|
30 | addLatexObj(parent, tmp); |
944 | 30 | return true; | |
945 | 4520 | } | |
946 | |||
947 | ///Parse an inline math formula | ||
948 | /** @param[out] parent : parent PLatexObj | ||
949 | * @param[out] textObj : PLatexObj to deal with text | ||
950 | * @return true on success, false otherwise | ||
951 | */ | ||
952 | 169030 | bool PConfigParser::parseInlineMath(PLatexObj & parent, PLatexObj & textObj){ | |
953 |
2/2✓ Branch 0 taken 2881 times.
✓ Branch 1 taken 166149 times.
|
169030 | if(!p_isAllowMath){return false;} |
954 |
5/5✓ Branch 1 taken 166149 times.
✓ Branch 4 taken 166149 times.
✓ Branch 7 taken 166149 times.
✓ Branch 11 taken 166061 times.
✓ Branch 12 taken 88 times.
|
166149 | if(!p_parser->isMatch("$", "\\")){return false;} |
955 |
1/1✓ Branch 1 taken 88 times.
|
88 | playTextLatexObj(parent, textObj); |
956 |
2/2✓ Branch 1 taken 88 times.
✓ Branch 4 taken 88 times.
|
88 | PString mathText(p_parser->getUntilKeyWithoutPatern("$")); |
957 |
1/1✓ Branch 1 taken 88 times.
|
88 | PLatexObj inlineMath; |
958 |
1/1✓ Branch 1 taken 88 times.
|
88 | inlineMath.setType(PLatexType::INLINEMATH); |
959 |
1/1✓ Branch 1 taken 88 times.
|
88 | inlineMath.setText(mathText); |
960 | |||
961 |
1/1✓ Branch 1 taken 88 times.
|
88 | addLatexObj(parent, inlineMath); |
962 | 88 | return true; | |
963 | 88 | } | |
964 | |||
965 | ///Parse an inline math formula | ||
966 | /** @param[out] parent : parent PLatexObj | ||
967 | * @param[out] textObj : PLatexObj to deal with text | ||
968 | * @return true on success, false otherwise | ||
969 | */ | ||
970 | 169030 | bool PConfigParser::parseDoubleInlineMath(PLatexObj & parent, PLatexObj & textObj){ | |
971 |
2/2✓ Branch 0 taken 2881 times.
✓ Branch 1 taken 166149 times.
|
169030 | if(!p_isAllowMath){return false;} |
972 |
4/5✓ Branch 1 taken 166149 times.
✓ Branch 4 taken 166149 times.
✓ Branch 7 taken 166149 times.
✓ Branch 11 taken 166149 times.
✗ Branch 12 not taken.
|
166149 | if(!p_parser->isMatch("$$", "\\")){return false;} |
973 | ✗ | playTextLatexObj(parent, textObj); | |
974 | ✗ | PString mathText(p_parser->getUntilKeyWithoutPatern("$$")); | |
975 | ✗ | PLatexObj inlineMath; | |
976 | ✗ | inlineMath.setType(PLatexType::DISPLAYMATH); | |
977 | ✗ | inlineMath.setText(mathText); | |
978 | |||
979 | ✗ | addLatexObj(parent, inlineMath); | |
980 | ✗ | return true; | |
981 | } | ||
982 | |||
983 | ///Parse a string an go back if the string exists | ||
984 | /** @param str : string to be serached | ||
985 | * @return true if the string has been found, false otherwise | ||
986 | */ | ||
987 | 370 | bool PConfigParser::parseStringAndGoBack(const PString & str){ | |
988 | 370 | p_parser->pushPosition(); | |
989 | 370 | bool b = p_parser->isMatch(str); | |
990 | 370 | p_parser->popPosition(); | |
991 | 370 | return b; | |
992 | } | ||
993 | |||
994 | ///Parse an item | ||
995 | /** @param[out] parent : parent PLatexObj | ||
996 | * @param[out] textObj : PLatexObj to deal with text | ||
997 | * @return true on success, false otherwise | ||
998 | */ | ||
999 | 168614 | bool PConfigParser::parseItem(PLatexObj & parent, PLatexObj & textObj){ | |
1000 |
4/4✓ Branch 1 taken 168614 times.
✓ Branch 4 taken 168614 times.
✓ Branch 7 taken 168593 times.
✓ Branch 8 taken 21 times.
|
168614 | if(!p_parser->isMatch("\\item")){return false;} |
1001 |
1/1✓ Branch 1 taken 21 times.
|
21 | playTextLatexObj(parent, textObj); |
1002 | |||
1003 |
1/1✓ Branch 1 taken 21 times.
|
21 | PLatexObj env; |
1004 |
1/1✓ Branch 1 taken 21 times.
|
21 | env.setType(PLatexType::ITEM); |
1005 | |||
1006 |
1/1✓ Branch 1 taken 21 times.
|
21 | PLatexObj tmpText; |
1007 |
1/1✓ Branch 1 taken 21 times.
|
21 | tmpText.setType(PLatexType::TEXT); |
1008 | |||
1009 | 21 | std::vector<PString> vecPaternItemize; | |
1010 |
2/2✓ Branch 1 taken 21 times.
✓ Branch 4 taken 21 times.
|
21 | vecPaternItemize.push_back("\\end"); |
1011 |
2/2✓ Branch 1 taken 21 times.
✓ Branch 4 taken 21 times.
|
21 | vecPaternItemize.push_back("{"); |
1012 |
2/2✓ Branch 1 taken 21 times.
✓ Branch 4 taken 21 times.
|
21 | vecPaternItemize.push_back("itemize"); |
1013 |
2/2✓ Branch 1 taken 21 times.
✓ Branch 4 taken 21 times.
|
21 | vecPaternItemize.push_back("}"); |
1014 | |||
1015 | 21 | std::vector<PString> vecPaternEnumerate; | |
1016 |
2/2✓ Branch 1 taken 21 times.
✓ Branch 4 taken 21 times.
|
21 | vecPaternEnumerate.push_back("\\end"); |
1017 |
2/2✓ Branch 1 taken 21 times.
✓ Branch 4 taken 21 times.
|
21 | vecPaternEnumerate.push_back("{"); |
1018 |
2/2✓ Branch 1 taken 21 times.
✓ Branch 4 taken 21 times.
|
21 | vecPaternEnumerate.push_back("enumerate"); |
1019 |
2/2✓ Branch 1 taken 21 times.
✓ Branch 4 taken 21 times.
|
21 | vecPaternEnumerate.push_back("}"); |
1020 | |||
1021 |
3/3✓ Branch 1 taken 376 times.
✓ Branch 3 taken 370 times.
✓ Branch 4 taken 6 times.
|
397 | while(!p_parser->isEndOfFile() && !p_parser->isMatchSeq(vecPaternItemize, true) && |
1022 |
2/3✓ Branch 1 taken 370 times.
✓ Branch 3 taken 370 times.
✗ Branch 4 not taken.
|
370 | !p_parser->isMatchSeq(vecPaternEnumerate, true) && |
1023 |
11/15✓ Branch 1 taken 376 times.
✓ Branch 3 taken 376 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 370 times.
✓ Branch 9 taken 370 times.
✓ Branch 11 taken 355 times.
✓ Branch 12 taken 15 times.
✓ Branch 13 taken 355 times.
✗ Branch 14 not taken.
✓ Branch 15 taken 370 times.
✓ Branch 16 taken 6 times.
✓ Branch 18 taken 355 times.
✓ Branch 19 taken 21 times.
✗ Branch 20 not taken.
✗ Branch 21 not taken.
|
752 | !parseStringAndGoBack("\\item") && p_run) |
1024 | { | ||
1025 |
3/3✓ Branch 1 taken 355 times.
✓ Branch 3 taken 343 times.
✓ Branch 4 taken 12 times.
|
355 | if(parseAllLatexObj(env, tmpText)){} |
1026 | else{ | ||
1027 |
1/1✓ Branch 1 taken 343 times.
|
343 | incrementCurrentChar(tmpText); |
1028 | } | ||
1029 | } | ||
1030 |
1/1✓ Branch 1 taken 21 times.
|
21 | playTextLatexObj(env, tmpText); |
1031 | |||
1032 |
1/1✓ Branch 1 taken 21 times.
|
21 | addLatexObj(parent, env); |
1033 | |||
1034 | |||
1035 | 21 | return true; | |
1036 | 21 | } | |
1037 | |||
1038 | ///Parse language parser (cplusplus, cmake, glsl, cuda, ...) | ||
1039 | /** @param[out] parent : parent PLatexObj | ||
1040 | * @param[out] textObj : PLatexObj to deal with text | ||
1041 | * @return true on success, false otherwise | ||
1042 | */ | ||
1043 | 167662 | bool PConfigParser::parseParserLanguage(PLatexObj & parent, PLatexObj & textObj){ | |
1044 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 167662 times.
|
167662 | if(p_vecNameExtraParser.size() == 0lu){return false;} |
1045 |
1/1✓ Branch 1 taken 167662 times.
|
167662 | p_parser->pushPosition(); |
1046 |
4/4✓ Branch 1 taken 167662 times.
✓ Branch 4 taken 167662 times.
✓ Branch 7 taken 167427 times.
✓ Branch 8 taken 235 times.
|
167662 | if(!p_parser->isMatchToken("\\begin")){return false;} |
1047 |
2/2✓ Branch 1 taken 235 times.
✓ Branch 4 taken 235 times.
|
235 | PARSER_SKIP_SPACE |
1048 |
1/1✓ Branch 1 taken 235 times.
|
235 | char ch = p_parser->getCurrentCh(); |
1049 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 235 times.
|
235 | if(ch != '{'){ |
1050 | ✗ | p_parser->popPosition(); //This is not the expected environement | |
1051 | ✗ | return false; | |
1052 | } | ||
1053 |
1/1✓ Branch 1 taken 235 times.
|
235 | p_parser->getNextChar(); |
1054 |
1/1✓ Branch 1 taken 235 times.
|
235 | PString matchEnv(p_parser->isMatch(p_vecNameExtraParser)); |
1055 |
2/2✓ Branch 1 taken 1 times.
✓ Branch 2 taken 234 times.
|
235 | if(matchEnv == ""){ |
1056 |
1/1✓ Branch 1 taken 1 times.
|
1 | p_parser->popPosition(); |
1057 | 1 | return false; | |
1058 | } | ||
1059 |
2/2✓ Branch 1 taken 234 times.
✓ Branch 4 taken 234 times.
|
234 | PARSER_SKIP_SPACE |
1060 |
1/1✓ Branch 1 taken 234 times.
|
234 | ch = p_parser->getCurrentCh(); |
1061 |
2/2✓ Branch 0 taken 3 times.
✓ Branch 1 taken 231 times.
|
234 | if(ch != '}'){ |
1062 |
1/1✓ Branch 1 taken 3 times.
|
3 | p_parser->popPosition(); //This is not the expected environement |
1063 | 3 | return false; | |
1064 | } | ||
1065 |
1/1✓ Branch 1 taken 231 times.
|
231 | p_parser->getNextChar(); |
1066 |
1/1✓ Branch 1 taken 231 times.
|
231 | playTextLatexObj(parent, textObj); |
1067 |
1/1✓ Branch 1 taken 231 times.
|
231 | PLatexObj tmp; |
1068 |
1/1✓ Branch 1 taken 231 times.
|
231 | tmp.setType(PLatexType::PARSER); |
1069 |
1/1✓ Branch 1 taken 231 times.
|
231 | tmp.setName(matchEnv); |
1070 | |||
1071 |
1/1✓ Branch 1 taken 231 times.
|
231 | PParserEnv parser(getParserEnv(p_vecExtraParser, matchEnv)); |
1072 |
1/1✓ Branch 1 taken 231 times.
|
231 | char saveEscapeChar = p_parser->getEscapeChar(); |
1073 |
1/1✓ Branch 1 taken 231 times.
|
231 | p_parser->setEscapeChar('\0'); |
1074 |
8/8✓ Branch 1 taken 231 times.
✓ Branch 4 taken 231 times.
✓ Branch 7 taken 231 times.
✓ Branch 10 taken 231 times.
✓ Branch 13 taken 231 times.
✓ Branch 16 taken 231 times.
✓ Branch 19 taken 231 times.
✓ Branch 22 taken 231 times.
|
462 | PString inputFileContent(p_parser->getUntilKeyWithoutPatern("\\end{"+matchEnv+"}").eraseFirstLastChar(" \n") + "\n"); |
1075 |
1/1✓ Branch 1 taken 231 times.
|
231 | p_parser->setEscapeChar(saveEscapeChar); |
1076 |
2/2✓ Branch 1 taken 231 times.
✓ Branch 4 taken 231 times.
|
231 | tmp.setNbline(inputFileContent.count('\n')); |
1077 | |||
1078 |
1/1✓ Branch 1 taken 231 times.
|
231 | PString envContent(parser_makeHighlighting(inputFileContent, parser)); |
1079 |
1/1✓ Branch 1 taken 231 times.
|
231 | tmp.setText(envContent); |
1080 | |||
1081 |
1/1✓ Branch 1 taken 231 times.
|
231 | addLatexObj(parent, tmp); |
1082 | 231 | return true; | |
1083 | 235 | } | |
1084 | |||
1085 | ///Parse a language parser with a function which get an input file | ||
1086 | /** @param[out] parent : parent PLatexObj | ||
1087 | * @param[out] textObj : PLatexObj to deal with text | ||
1088 | * @return true on success, false otherwise | ||
1089 | */ | ||
1090 | 167431 | bool PConfigParser::parseParserLanguageFunction(PLatexObj & parent, PLatexObj & textObj){ | |
1091 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 167431 times.
|
167431 | if(p_vecNameFunctionExtraParser.size() == 0lu){return false;} |
1092 |
1/1✓ Branch 1 taken 167431 times.
|
167431 | p_parser->pushPosition(); |
1093 |
1/1✓ Branch 1 taken 167431 times.
|
167431 | PString matchFunc(p_parser->isMatch(p_vecNameFunctionExtraParser)); |
1094 |
2/2✓ Branch 1 taken 167367 times.
✓ Branch 2 taken 64 times.
|
167431 | if(matchFunc == ""){ |
1095 |
1/1✓ Branch 1 taken 167367 times.
|
167367 | p_parser->popPosition(); |
1096 | 167367 | return false; | |
1097 | } | ||
1098 |
2/2✓ Branch 1 taken 64 times.
✓ Branch 4 taken 64 times.
|
64 | PARSER_SKIP_SPACE |
1099 |
1/1✓ Branch 1 taken 64 times.
|
64 | char ch = p_parser->getCurrentCh(); |
1100 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 64 times.
|
64 | if(ch != '{'){ |
1101 | ✗ | p_parser->popPosition(); //This is not the expected environement | |
1102 | ✗ | return false; | |
1103 | } | ||
1104 |
1/1✓ Branch 1 taken 64 times.
|
64 | playTextLatexObj(parent, textObj); |
1105 |
1/1✓ Branch 1 taken 64 times.
|
64 | PLatexObj tmp; |
1106 |
1/1✓ Branch 1 taken 64 times.
|
64 | tmp.setType(PLatexType::PARSER); |
1107 |
1/1✓ Branch 1 taken 64 times.
|
64 | PString matchEnv(matchFunc.eraseChar('\\')); |
1108 |
1/1✓ Branch 1 taken 64 times.
|
64 | tmp.setName(matchEnv); |
1109 | |||
1110 |
1/1✓ Branch 1 taken 64 times.
|
64 | p_parser->getNextChar(); |
1111 |
3/3✓ Branch 1 taken 64 times.
✓ Branch 4 taken 64 times.
✓ Branch 7 taken 64 times.
|
128 | PString baseContent(p_parser->getUntilKeyWithoutPaternRecurse("}", "{")); |
1112 |
1/1✓ Branch 1 taken 64 times.
|
64 | PPath fileName(baseContent); |
1113 |
1/2✓ Branch 1 taken 64 times.
✗ Branch 2 not taken.
|
64 | if(fileName != ""){ |
1114 |
2/3✓ Branch 1 taken 64 times.
✓ Branch 3 taken 64 times.
✗ Branch 4 not taken.
|
64 | if(fileName[0] != '/'){ |
1115 |
4/4✓ Branch 1 taken 64 times.
✓ Branch 4 taken 64 times.
✓ Branch 7 taken 64 times.
✓ Branch 10 taken 64 times.
|
64 | fileName = p_parser->getFileName().getParentDirectory() / fileName; |
1116 | } | ||
1117 |
1/1✓ Branch 1 taken 64 times.
|
64 | PParserEnv parser(getParserEnv(p_vecExtraParser, matchEnv)); |
1118 |
1/1✓ Branch 1 taken 64 times.
|
64 | PString inputFileContent(""); |
1119 |
3/3✓ Branch 1 taken 64 times.
✓ Branch 3 taken 4 times.
✓ Branch 4 taken 60 times.
|
64 | if(fileName.isFileExist()){ |
1120 |
5/5✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 7 taken 4 times.
✓ Branch 10 taken 4 times.
✓ Branch 13 taken 4 times.
|
4 | inputFileContent = fileName.loadFileContent().eraseFirstLastChar(" \n") + "\n"; |
1121 | }else{ | ||
1122 |
2/2✓ Branch 1 taken 60 times.
✓ Branch 4 taken 60 times.
|
60 | inputFileContent = baseContent + " "; |
1123 | } | ||
1124 |
2/2✓ Branch 1 taken 64 times.
✓ Branch 4 taken 64 times.
|
64 | tmp.setNbline(inputFileContent.count('\n')); //The first line has no \n, if there is a \n there are two lines |
1125 | |||
1126 |
1/1✓ Branch 1 taken 64 times.
|
64 | PString envContent(parser_makeHighlighting(inputFileContent, parser)); |
1127 |
1/1✓ Branch 1 taken 64 times.
|
64 | tmp.setText(envContent); |
1128 | |||
1129 |
1/1✓ Branch 1 taken 64 times.
|
64 | addLatexObj(parent, tmp); |
1130 | 64 | } | |
1131 | |||
1132 | 64 | return true; | |
1133 | 167431 | } | |
1134 | |||
1135 | ///Parse extra environement (terminal, cplusplus, cmake, conseil, attention, ...) | ||
1136 | /** @param[out] parent : parent PLatexObj | ||
1137 | * @param[out] textObj : PLatexObj to deal with text | ||
1138 | * @return true on success, false otherwise | ||
1139 | */ | ||
1140 | 168588 | bool PConfigParser::parseExtraEnvironement(PLatexObj & parent, PLatexObj & textObj){ | |
1141 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 168588 times.
|
168588 | if(p_vecNameExtraEnv.size() == 0lu){return false;} |
1142 |
1/1✓ Branch 1 taken 168588 times.
|
168588 | p_parser->pushPosition(); |
1143 |
4/4✓ Branch 1 taken 168588 times.
✓ Branch 4 taken 168588 times.
✓ Branch 7 taken 168036 times.
✓ Branch 8 taken 552 times.
|
168588 | if(!p_parser->isMatch("\\begin")){return false;} |
1144 |
2/2✓ Branch 1 taken 552 times.
✓ Branch 4 taken 552 times.
|
552 | PARSER_SKIP_SPACE |
1145 |
1/1✓ Branch 1 taken 552 times.
|
552 | char ch = p_parser->getCurrentCh(); |
1146 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 552 times.
|
552 | if(ch != '{'){ |
1147 | ✗ | errorAt(); | |
1148 | ✗ | std::cerr << "PConfigParser::parseExtraEnvironement : expect '{' after '\\begin' instead of '"<<ch<<"'" << std::endl; | |
1149 | ✗ | stopParsing(); | |
1150 | ✗ | return true; | |
1151 | } | ||
1152 |
1/1✓ Branch 1 taken 552 times.
|
552 | p_parser->getNextChar(); |
1153 |
1/1✓ Branch 1 taken 552 times.
|
552 | PString matchEnv(p_parser->isMatch(p_vecNameExtraEnv)); |
1154 |
2/2✓ Branch 1 taken 235 times.
✓ Branch 2 taken 317 times.
|
552 | if(matchEnv == ""){ |
1155 |
1/1✓ Branch 1 taken 235 times.
|
235 | p_parser->popPosition(); |
1156 | 235 | return false; | |
1157 | } | ||
1158 |
2/2✓ Branch 1 taken 317 times.
✓ Branch 4 taken 317 times.
|
317 | PARSER_SKIP_SPACE |
1159 |
1/1✓ Branch 1 taken 317 times.
|
317 | ch = p_parser->getCurrentCh(); |
1160 |
2/2✓ Branch 0 taken 1 times.
✓ Branch 1 taken 316 times.
|
317 | if(ch != '}'){ |
1161 |
1/1✓ Branch 1 taken 1 times.
|
1 | errorAt(); |
1162 |
4/4✓ Branch 1 taken 1 times.
✓ Branch 4 taken 1 times.
✓ Branch 7 taken 1 times.
✓ Branch 10 taken 1 times.
|
1 | std::cerr << "PConfigParser::parseExtraEnvironement : expect '}' after '\\begin{matchEnv' instead of '"<<ch<<"'" << std::endl; |
1163 |
1/1✓ Branch 1 taken 1 times.
|
1 | stopParsing(); |
1164 | 1 | return true; | |
1165 | } | ||
1166 |
1/1✓ Branch 1 taken 316 times.
|
316 | p_parser->getNextChar(); |
1167 |
1/1✓ Branch 1 taken 316 times.
|
316 | return parseExtraEnvironementContent(parent, textObj, matchEnv, PLatexType::ENVIRONEMENT); |
1168 | 552 | } | |
1169 | |||
1170 | ///Parse latex environement | ||
1171 | /** @param[out] parent : parent PLatexObj | ||
1172 | * @param[out] textObj : PLatexObj to deal with text | ||
1173 | * @param environementName : name of the evironement | ||
1174 | * @param type : type of the environement | ||
1175 | * @return true on success, false otherwise | ||
1176 | */ | ||
1177 | 316 | bool PConfigParser::parseExtraEnvironementContent(PLatexObj & parent, PLatexObj & textObj, const PString & environementName, PLatexType::PLatexType type){ | |
1178 | 316 | PEnvironement & configEnv = p_vecExtraEnv[environementName]; | |
1179 | 948 | return parseEnvironementContent(parent, textObj, environementName, | |
1180 | 316 | type, configEnv.getIsAllowComment(), configEnv.getIsAlloxMath(), configEnv.getBalise()); | |
1181 | } | ||
1182 | |||
1183 | |||
1184 | ///Parse extra environement (terminal, cplusplus, cmake, conseil, attention, ...) | ||
1185 | /** @param[out] parent : parent PLatexObj | ||
1186 | * @param[out] textObj : PLatexObj to deal with text | ||
1187 | * @return true on success, false otherwise | ||
1188 | */ | ||
1189 | 168271 | bool PConfigParser::parseExtraEnvironementFunction(PLatexObj & parent, PLatexObj & textObj){ | |
1190 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 168271 times.
|
168271 | if(p_vecNameFunctionExtraEnv.size() == 0lu){return false;} |
1191 |
1/1✓ Branch 1 taken 168271 times.
|
168271 | p_parser->pushPosition(); |
1192 |
1/1✓ Branch 1 taken 168271 times.
|
168271 | PString matchFunc(p_parser->isMatch(p_vecNameFunctionExtraEnv)); |
1193 |
2/2✓ Branch 1 taken 167823 times.
✓ Branch 2 taken 448 times.
|
168271 | if(matchFunc == ""){ |
1194 |
1/1✓ Branch 1 taken 167823 times.
|
167823 | p_parser->popPosition(); |
1195 | 167823 | return false; | |
1196 | } | ||
1197 |
2/2✓ Branch 1 taken 448 times.
✓ Branch 4 taken 448 times.
|
448 | PARSER_SKIP_SPACE |
1198 |
1/1✓ Branch 1 taken 448 times.
|
448 | char ch = p_parser->getCurrentCh(); |
1199 |
2/2✓ Branch 0 taken 447 times.
✓ Branch 1 taken 1 times.
|
448 | if(ch != '{'){ |
1200 |
1/1✓ Branch 1 taken 447 times.
|
447 | p_parser->popPosition(); //This is not the expected environement |
1201 | 447 | return false; | |
1202 | } | ||
1203 |
1/1✓ Branch 1 taken 1 times.
|
1 | playTextLatexObj(parent, textObj); |
1204 |
1/1✓ Branch 1 taken 1 times.
|
1 | PLatexObj tmp; |
1205 |
1/1✓ Branch 1 taken 1 times.
|
1 | tmp.setType(PLatexType::ENVIRONEMENT); |
1206 | |||
1207 |
1/1✓ Branch 1 taken 1 times.
|
1 | PString matchEnv(matchFunc.eraseChar('\\')); |
1208 |
1/1✓ Branch 1 taken 1 times.
|
1 | tmp.setName(matchEnv); |
1209 | |||
1210 |
1/1✓ Branch 1 taken 1 times.
|
1 | PEnvironement & configEnv = p_vecExtraEnv[matchEnv]; |
1211 |
2/2✓ Branch 1 taken 1 times.
✓ Branch 4 taken 1 times.
|
1 | tmp.setBalise(configEnv.getBalise()); |
1212 | |||
1213 |
1/1✓ Branch 1 taken 1 times.
|
1 | p_parser->getNextChar(); |
1214 |
3/3✓ Branch 1 taken 1 times.
✓ Branch 4 taken 1 times.
✓ Branch 7 taken 1 times.
|
2 | PPath fileName(p_parser->getUntilKeyWithoutPatern("}")); |
1215 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
1 | if(fileName != ""){ |
1216 |
2/3✓ Branch 1 taken 1 times.
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
|
1 | if(fileName[0] != '/'){ |
1217 |
4/4✓ Branch 1 taken 1 times.
✓ Branch 4 taken 1 times.
✓ Branch 7 taken 1 times.
✓ Branch 10 taken 1 times.
|
1 | fileName = p_parser->getFileName().getParentDirectory() / fileName; |
1218 | } | ||
1219 |
3/3✓ Branch 1 taken 1 times.
✓ Branch 4 taken 1 times.
✓ Branch 7 taken 1 times.
|
2 | PString envContent(fileName.loadFileContent().eraseFirstLastChar(" \t\n")); |
1220 |
1/1✓ Branch 1 taken 1 times.
|
1 | PLatexObj content; |
1221 |
1/1✓ Branch 1 taken 1 times.
|
1 | content.setType(PLatexType::TEXT); |
1222 |
1/1✓ Branch 1 taken 1 times.
|
1 | content.setText(envContent); |
1223 |
2/2✓ Branch 1 taken 1 times.
✓ Branch 4 taken 1 times.
|
1 | tmp.getVecContent().push_back(content); |
1224 |
1/1✓ Branch 1 taken 1 times.
|
1 | addLatexObj(parent, tmp); |
1225 | 1 | } | |
1226 | 1 | return true; | |
1227 | 168271 | } | |
1228 | |||
1229 | ///Parse extra environement (terminal, cplusplus, cmake, conseil, attention, ...) | ||
1230 | /** @param[out] parent : parent PLatexObj | ||
1231 | * @param[out] textObj : PLatexObj to deal with text | ||
1232 | * @return true on success, false otherwise | ||
1233 | */ | ||
1234 | 168270 | bool PConfigParser::parseExtraFunction(PLatexObj & parent, PLatexObj & textObj){ | |
1235 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 168270 times.
|
168270 | if(p_vecNameExtraFunction.size() == 0lu){return false;} |
1236 |
1/1✓ Branch 1 taken 168270 times.
|
168270 | p_parser->pushPosition(); |
1237 |
1/1✓ Branch 1 taken 168270 times.
|
168270 | PString matchFunc(p_parser->isMatch(p_vecNameExtraFunction)); |
1238 |
2/2✓ Branch 1 taken 167424 times.
✓ Branch 2 taken 846 times.
|
168270 | if(matchFunc == ""){ |
1239 |
1/1✓ Branch 1 taken 167424 times.
|
167424 | p_parser->popPosition(); |
1240 | 167424 | return false; | |
1241 | } | ||
1242 |
4/4✓ Branch 1 taken 846 times.
✓ Branch 4 taken 846 times.
✓ Branch 7 taken 238 times.
✓ Branch 8 taken 608 times.
|
846 | if(!isMatchRewind("{")){ |
1243 |
1/1✓ Branch 1 taken 238 times.
|
238 | p_parser->popPosition(); //This is not the expected environement |
1244 | 238 | return false; | |
1245 | } | ||
1246 |
1/1✓ Branch 1 taken 608 times.
|
608 | playTextLatexObj(parent, textObj); |
1247 |
1/1✓ Branch 1 taken 608 times.
|
608 | PLatexObj tmp; |
1248 |
1/1✓ Branch 1 taken 608 times.
|
608 | tmp.setType(PLatexType::FUNCTION); |
1249 |
1/1✓ Branch 1 taken 608 times.
|
608 | PString matchEnv(matchFunc.eraseChar('\\')); |
1250 |
1/1✓ Branch 1 taken 608 times.
|
608 | tmp.setName(matchEnv); |
1251 | |||
1252 |
1/1✓ Branch 1 taken 608 times.
|
608 | PEnvironement & configEnv = p_vecExtraFunction[matchEnv]; |
1253 |
2/2✓ Branch 1 taken 608 times.
✓ Branch 4 taken 608 times.
|
608 | tmp.setBalise(configEnv.getBalise()); |
1254 | |||
1255 |
3/3✓ Branch 1 taken 608 times.
✓ Branch 4 taken 608 times.
✓ Branch 7 taken 608 times.
|
608 | parseVecLatexObj(tmp, textObj, "{", "}"); |
1256 | |||
1257 |
1/1✓ Branch 1 taken 608 times.
|
608 | addLatexObj(parent, tmp); |
1258 | 608 | return true; | |
1259 | 168270 | } | |
1260 | |||
1261 | ///Skip a mon parameter | ||
1262 | /** @param functionName : name of the function to be parsed | ||
1263 | * @return true if the function has been found, false otherwise | ||
1264 | */ | ||
1265 | 869950 | bool PConfigParser::skipMonoParam(const PString & functionName){ | |
1266 |
1/2✓ Branch 1 taken 869950 times.
✗ Branch 2 not taken.
|
869950 | if(!p_parser->isMatchToken(functionName)){return false;} |
1267 | //Skip hook option | ||
1268 | ✗ | getOptionStringBetweenHook(); | |
1269 | //Skip brace content | ||
1270 | ✗ | getOptionStringBetweenBraces(); | |
1271 | ✗ | return true; | |
1272 | } | ||
1273 | |||
1274 | |||
1275 |