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