diff options
author | orivej <orivej@yandex-team.ru> | 2022-02-10 16:44:49 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:44:49 +0300 |
commit | 718c552901d703c502ccbefdfc3c9028d608b947 (patch) | |
tree | 46534a98bbefcd7b1f3faa5b52c138ab27db75b7 /contrib/tools/ragel6/inputdata.cpp | |
parent | e9656aae26e0358d5378e5b63dcac5c8dbe0e4d0 (diff) | |
download | ydb-718c552901d703c502ccbefdfc3c9028d608b947.tar.gz |
Restoring authorship annotation for <orivej@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/tools/ragel6/inputdata.cpp')
-rw-r--r-- | contrib/tools/ragel6/inputdata.cpp | 72 |
1 files changed, 36 insertions, 36 deletions
diff --git a/contrib/tools/ragel6/inputdata.cpp b/contrib/tools/ragel6/inputdata.cpp index 7d8322ff70..95767717bd 100644 --- a/contrib/tools/ragel6/inputdata.cpp +++ b/contrib/tools/ragel6/inputdata.cpp @@ -46,7 +46,7 @@ void InputData::cdDefaultFileName( const char *inputFile ) switch ( hostLang->lang ) { case HostLang::C: defExtension = ".c"; break; case HostLang::D: defExtension = ".d"; break; - case HostLang::D2: defExtension = ".d"; break; + case HostLang::D2: defExtension = ".d"; break; default: break; } outputFileName = fileNameFromStem( inputFile, defExtension ); @@ -55,15 +55,15 @@ void InputData::cdDefaultFileName( const char *inputFile ) } /* Invoked by the parser when the root element is opened. */ -void InputData::goDefaultFileName( const char *inputFile ) -{ - /* If the output format is code and no output file name is given, then - * make a default. */ - if ( outputFileName == 0 ) - outputFileName = fileNameFromStem( inputFile, ".go" ); -} - -/* Invoked by the parser when the root element is opened. */ +void InputData::goDefaultFileName( const char *inputFile ) +{ + /* If the output format is code and no output file name is given, then + * make a default. */ + if ( outputFileName == 0 ) + outputFileName = fileNameFromStem( inputFile, ".go" ); +} + +/* Invoked by the parser when the root element is opened. */ void InputData::javaDefaultFileName( const char *inputFile ) { /* If the output format is code and no output file name is given, then @@ -95,39 +95,39 @@ void InputData::csharpDefaultFileName( const char *inputFile ) } } -/* Invoked by the parser when the root element is opened. */ -void InputData::ocamlDefaultFileName( const char *inputFile ) -{ - /* If the output format is code and no output file name is given, then - * make a default. */ - if ( outputFileName == 0 ) - outputFileName = fileNameFromStem( inputFile, ".ml" ); -} - +/* Invoked by the parser when the root element is opened. */ +void InputData::ocamlDefaultFileName( const char *inputFile ) +{ + /* If the output format is code and no output file name is given, then + * make a default. */ + if ( outputFileName == 0 ) + outputFileName = fileNameFromStem( inputFile, ".ml" ); +} + void InputData::makeOutputStream() { if ( ! generateDot && ! generateXML ) { switch ( hostLang->lang ) { case HostLang::C: case HostLang::D: - case HostLang::D2: + case HostLang::D2: cdDefaultFileName( inputFileName ); break; case HostLang::Java: javaDefaultFileName( inputFileName ); break; - case HostLang::Go: - goDefaultFileName( inputFileName ); - break; + case HostLang::Go: + goDefaultFileName( inputFileName ); + break; case HostLang::Ruby: rubyDefaultFileName( inputFileName ); break; case HostLang::CSharp: csharpDefaultFileName( inputFileName ); break; - case HostLang::OCaml: - ocamlDefaultFileName( inputFileName ); - break; + case HostLang::OCaml: + ocamlDefaultFileName( inputFileName ); + break; } } @@ -252,24 +252,24 @@ void InputData::writeOutput() else if ( generateDot ) static_cast<GraphvizDotGen*>(dotGenParser->pd->cgd)->writeDotFile(); else { - bool hostLineDirective = true; + bool hostLineDirective = true; for ( InputItemList::Iter ii = inputItems; ii.lte(); ii++ ) { if ( ii->type == InputItem::Write ) { CodeGenData *cgd = ii->pd->cgd; ::keyOps = &cgd->thisKeyOps; - hostLineDirective = cgd->writeStatement( ii->loc, - ii->writeArgs.length()-1, ii->writeArgs.data ); + hostLineDirective = cgd->writeStatement( ii->loc, + ii->writeArgs.length()-1, ii->writeArgs.data ); } else { - if ( hostLineDirective ) { - /* Write statements can turn off host line directives for - * host sections that follow them. */ - *outStream << '\n'; - lineDirective( *outStream, inputFileName, ii->loc.line ); - } + if ( hostLineDirective ) { + /* Write statements can turn off host line directives for + * host sections that follow them. */ + *outStream << '\n'; + lineDirective( *outStream, inputFileName, ii->loc.line ); + } *outStream << ii->data.str(); - hostLineDirective = true; + hostLineDirective = true; } } } |