mirror of
https://github.com/yhirose/cpp-peglib.git
synced 2024-12-22 20:05:31 +00:00
Code cleanup.
This commit is contained in:
parent
8c029c07eb
commit
0ddb5682af
@ -31,7 +31,7 @@ int main(int argc, const char** argv)
|
|||||||
auto opt_help = false;
|
auto opt_help = false;
|
||||||
vector<const char*> path_list;
|
vector<const char*> path_list;
|
||||||
|
|
||||||
int argi = 1;
|
auto argi = 1;
|
||||||
while (argi < argc) {
|
while (argi < argc) {
|
||||||
auto arg = argv[argi++];
|
auto arg = argv[argi++];
|
||||||
if (string("--help") == arg) {
|
if (string("--help") == arg) {
|
||||||
@ -61,7 +61,7 @@ int main(int argc, const char** argv)
|
|||||||
|
|
||||||
peglib::peg peg;
|
peglib::peg peg;
|
||||||
|
|
||||||
peg.log = [&](size_t ln, size_t col, const string& msg) {
|
peg.log = [&](auto ln, auto col, const auto& msg) {
|
||||||
cerr << syntax_path << ":" << ln << ":" << col << ": " << msg << endl;
|
cerr << syntax_path << ":" << ln << ":" << col << ": " << msg << endl;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -80,11 +80,11 @@ int main(int argc, const char** argv)
|
|||||||
if (!read_file(source_path, source)) {
|
if (!read_file(source_path, source)) {
|
||||||
auto beg = source_path;
|
auto beg = source_path;
|
||||||
auto end = source_path + strlen(source_path);
|
auto end = source_path + strlen(source_path);
|
||||||
source.assign(beg, end);
|
source.assign(beg, end);
|
||||||
source_path = "[commendline]";
|
source_path = "[commendline]";
|
||||||
}
|
}
|
||||||
|
|
||||||
peg.log = [&](size_t ln, size_t col, const string& msg) {
|
peg.log = [&](auto ln, auto col, const auto& msg) {
|
||||||
cerr << source_path << ":" << ln << ":" << col << ": " << msg << endl;
|
cerr << source_path << ":" << ln << ":" << col << ": " << msg << endl;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -16,12 +16,6 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="peglint.cc" />
|
<ClCompile Include="peglint.cc" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
|
||||||
<None Include="test.peg" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Text Include="test.txt" />
|
|
||||||
</ItemGroup>
|
|
||||||
<PropertyGroup Label="Globals">
|
<PropertyGroup Label="Globals">
|
||||||
<ProjectGuid>{F85B641A-7538-4809-8175-C528FF632CF6}</ProjectGuid>
|
<ProjectGuid>{F85B641A-7538-4809-8175-C528FF632CF6}</ProjectGuid>
|
||||||
<Keyword>Win32Proj</Keyword>
|
<Keyword>Win32Proj</Keyword>
|
||||||
|
Loading…
Reference in New Issue
Block a user