Skip to content

Commit

Permalink
Update launch.json and tasks.json, TODO regular expression in ttwCust…
Browse files Browse the repository at this point in the history
…omFunctions.h
  • Loading branch information
fabfab1 committed Feb 16, 2024
1 parent 5fd2aec commit 66cf353
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 14 deletions.
Binary file added .compiler/main.exe
Binary file not shown.
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/main.cpp",
"program": "${workspaceFolder}/.compiler/main",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
Expand Down
23 changes: 10 additions & 13 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,20 @@
"version": "2.0.0",
"tasks": [
{
"label": "Build",
"type": "shell",
"command": "npm run build",
"label": "build",
"command": "gcc",
"args": [
"-g",
"${workspaceFolder}/main.cpp",
"-o",
"${workspaceFolder}/.compiler/main",
"-lstdc++"
],
"group": {
"kind": "build",
"isDefault": true
}
},
{
"label": "Test",
"type": "shell",
"command": "npm run test",
"group": {
"kind": "test",
"isDefault": true
}
},
// Add more tasks here if needed
}
]
}
9 changes: 9 additions & 0 deletions ttwCustomFunctions.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@ void apply_citation_style_hyphens(vector<string> &articleFile, struct documentSe
//find citations like 1993, 3-46 oder 2006b, 300-201... (only in the footnote section)

for(size_t i=documentSections.lineNrFootnotesBegin_; i<articleFile.size(); i++){
// TODO: FAB (from CoPilot) The regular expression string currently has an unknown escape sequence warning.
// This is because in C++, backslashes in strings are used to introduce escape sequences.
// If we want to include an actual backslash in the string, we need to escape it by using two backslashes.
// In this case, we're trying to use a backslash to escape a special character in a regular expression.
// However, because this is a string literal, the C++ compiler is trying to interpret the backslash as starting an escape sequence.
// To fix this, we need to use four backslashes to represent a single backslash in the regular expression.
// So the corrected line of code should be:
// std::regex r1{"[0-9]{4}[a-z]?,\\\\s[0-9]{1,4}[Γ\\-]{1,3}[0-9]{1,4}"};
// instead of std::regex r1{"[0-9]{4}[a-z]?,\\s[0-9]{1,4}[Γ\\-]{1,3}[0-9]{1,4}"};
std::regex r1{"[0-9]{4}[a-z]?,\\s[0-9]{1,4}[–|\-]{1,3}[0-9]{1,4}"};
std::smatch m1;
std::sregex_iterator begin{ articleFile[i].begin(), articleFile[i].end(), r1};
Expand Down

0 comments on commit 66cf353

Please sign in to comment.