Commit ce14f243 authored by Mark Olesen's avatar Mark Olesen
Browse files

Removed handling of single-quoted strings.

parent 42c04b85
......@@ -15,21 +15,21 @@ FoamFile
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#inputMode merge
'.*' parentValue1;
'[n-z].*' parentValue2;
'f.*' parentValue3;
".*" parentValue1;
"[n-z].*" parentValue2;
"f.*" parentValue3;
keyX parentValue4;
keyY parentValue5;
'(.*)Dict'
"(.*)Dict"
{
foo subdictValue0;
bar $f.*; // should this really match 'foo'?
// result is dependent on insert order!
'a.*c' subdictValue3;
'ab.*' subdictValue2;
'a.*' subdictValue1;
"a.*c" subdictValue3;
"ab.*" subdictValue2;
"a.*" subdictValue1;
abcd \1;
}
......
......@@ -82,7 +82,7 @@ topoSetSources
// Cells in cell zone
zoneToCell
{
name '.*Zone'; // Name of cellZone, regular expressions allowed
name ".*Zone"; // Name of cellZone, regular expressions allowed
}
// values of field within certain range
......
......@@ -56,13 +56,13 @@ topoSetSources
// All faces of patch
patchToFace
{
name '.*Wall'; // Name of patch, regular expressions allowed
name ".*Wall"; // Name of patch, regular expressions allowed
}
// All faces of faceZone
zoneToFace
{
name '.*Zone1'; // Name of faceZone, regular expressions allowed
name ".*Zone1"; // Name of faceZone, regular expressions allowed
}
// Faces with face centre within box
......
......@@ -60,7 +60,7 @@ topoSetSources
// All points in pointzone
zoneToPoint
{
name '.*Zone'; // name of pointZone, regular expressions allowed
name ".*Zone"; // name of pointZone, regular expressions allowed
}
// Select based on surface
......
......@@ -48,7 +48,7 @@ void Foam::Ostream::decrIndent()
// Write keyType
// write regular expression as single-quoted string
// write regular expression as quoted string
// write plain word as word (unquoted)
Foam::Ostream& Foam::Ostream::write(const keyType& kw)
{
......
......@@ -115,7 +115,7 @@ public:
//- Write string
virtual Ostream& write(const string&) = 0;
//- Write std::string surrounded by single quotes.
//- Write std::string surrounded by quotes.
// Optional write without quotes.
virtual Ostream& writeQuoted
(
......
......@@ -136,7 +136,7 @@ public:
//- Write string
Ostream& write(const string&);
//- Write std::string surrounded by single quotes.
//- Write std::string surrounded by quotes.
// Optional write without quotes.
Ostream& writeQuoted
(
......
......@@ -152,9 +152,8 @@ Foam::Istream& Foam::ISstream::read(token& t)
return *this;
}
// Strings: enclosed by single or double quotes.
// Strings: enclosed by double quotes.
case token::BEGIN_STRING :
case token::BEGIN_QSTRING :
{
putback(c);
string* sPtr = new string;
......@@ -369,11 +368,8 @@ Foam::Istream& Foam::ISstream::read(string& str)
char endTok = token::END_STRING;
if (c == token::BEGIN_QSTRING)
{
endTok = token::END_QSTRING;
}
else if (c != token::BEGIN_STRING)
// Note, we could also handle single-quoted strings here (if desired)
if (c != token::BEGIN_STRING)
{
buf[0] = '\0';
......
......@@ -118,7 +118,7 @@ Foam::Ostream& Foam::OSstream::writeQuoted
{
if (quoted)
{
os_ << token::BEGIN_QSTRING;
os_ << token::BEGIN_STRING;
register int backslash = 0;
for
......@@ -141,7 +141,7 @@ Foam::Ostream& Foam::OSstream::writeQuoted
lineNumber_++;
backslash++; // backslash escape for newline
}
else if (c == token::END_QSTRING)
else if (c == token::END_STRING)
{
backslash++; // backslash escape for quote
}
......@@ -158,7 +158,7 @@ Foam::Ostream& Foam::OSstream::writeQuoted
// silently drop any trailing backslashes
// they would otherwise appear like an escaped end-quote
os_ << token::END_QSTRING;
os_ << token::END_STRING;
}
else
{
......
......@@ -141,7 +141,7 @@ public:
// double-quote.
virtual Ostream& write(const string&);
//- Write std::string surrounded by single quotes.
//- Write std::string surrounded by quotes.
// Optional write without quotes.
virtual Ostream& writeQuoted
(
......
......@@ -114,8 +114,8 @@ public:
//- Write string
virtual Ostream& write(const string&);
//- Write std::string
// Specify if string should be single quoted or remain unquoted.
//- Write std::string surrounded by quotes.
// Optional write without quotes.
virtual Ostream& writeQuoted
(
const std::string&,
......
......@@ -109,8 +109,6 @@ public:
BEGIN_STRING = '"',
END_STRING = BEGIN_STRING,
BEGIN_QSTRING = '\'',
END_QSTRING = BEGIN_QSTRING,
ASSIGN = '=',
ADD = '+',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment