master
Melroy van den Berg 2020-11-15 04:51:00 +01:00
parent 42c87cb281
commit c8d90adc46
4 changed files with 63 additions and 6 deletions

57
.vscode/settings.json vendored
View File

@ -9,6 +9,61 @@
"qmainwindow": "cpp",
"qtextedit": "cpp",
"new": "cpp",
"qvboxlayout": "cpp"
"qvboxlayout": "cpp",
"array": "cpp",
"atomic": "cpp",
"cctype": "cpp",
"chrono": "cpp",
"clocale": "cpp",
"cmath": "cpp",
"codecvt": "cpp",
"condition_variable": "cpp",
"cstdarg": "cpp",
"cstddef": "cpp",
"cstdint": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"ctime": "cpp",
"cwchar": "cpp",
"cwctype": "cpp",
"deque": "cpp",
"list": "cpp",
"unordered_map": "cpp",
"vector": "cpp",
"exception": "cpp",
"algorithm": "cpp",
"filesystem": "cpp",
"functional": "cpp",
"iterator": "cpp",
"map": "cpp",
"memory": "cpp",
"memory_resource": "cpp",
"numeric": "cpp",
"optional": "cpp",
"random": "cpp",
"ratio": "cpp",
"string": "cpp",
"string_view": "cpp",
"system_error": "cpp",
"tuple": "cpp",
"type_traits": "cpp",
"utility": "cpp",
"fstream": "cpp",
"future": "cpp",
"initializer_list": "cpp",
"iomanip": "cpp",
"iosfwd": "cpp",
"iostream": "cpp",
"istream": "cpp",
"limits": "cpp",
"mutex": "cpp",
"sstream": "cpp",
"stdexcept": "cpp",
"streambuf": "cpp",
"thread": "cpp",
"cinttypes": "cpp",
"typeinfo": "cpp",
"variant": "cpp",
"bit": "cpp"
}
}

2
check.sh Executable file
View File

@ -0,0 +1,2 @@
#!/usr/bin/env bash
cppcheck --enable=all --suppressions-list=suppressions.txt --error-exitcode=1 "$@" -I lib/commonmarker/src/ -I lib/commonmarker/extensions/ ./src

View File

@ -18,10 +18,7 @@ static inline void outc(cmark_renderer *renderer, cmark_node *node,
cmark_render_code_point(renderer, c);
}
MarkdownRender::MarkdownRender()
{
exePath = std::filesystem::current_path().string();
}
MarkdownRender::MarkdownRender(): exePath(std::filesystem::current_path().string()) {}
std::string const MarkdownRender::render()
{
@ -59,10 +56,11 @@ std::string MarkdownRender::parseRenderFromFile(const std::string& filePath)
t = clock();
// Parse to AST with cmark
cmark_node *root_node;
FILE *file;
if( ( file = fopen(filePath.c_str(), "r" ) ) != NULL )
{
cmark_node *root_node;
// TODO: Copy/paste cmark_parse_file() content, allowing me to add extensions to the parser.
root_node = cmark_parse_file(file, options);
fclose(file);

2
suppressions.txt Normal file
View File

@ -0,0 +1,2 @@
missingIncludeSystem
missingInclude:lib/*