mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-30 16:58:40 -04:00
allow embedded comments
This commit is contained in:
parent
5e60444a12
commit
6698db48d9
@ -401,9 +401,16 @@ read_prc_line(const string &line) {
|
||||
}
|
||||
size_t value_begin = p;
|
||||
|
||||
// The value extends from here to the end of the line, so trim
|
||||
// whitespace backwards off from the end of the line.
|
||||
p = line.length();
|
||||
// Is there an embedded comment on this line?
|
||||
p = line.find(" #", value_begin);
|
||||
if (p == string::npos) {
|
||||
// No, the value extends all the way to the end of the line.
|
||||
p = line.length();
|
||||
}
|
||||
|
||||
// The value extends from here to the end of the line (or to the
|
||||
// start of the embedded comment), so trim whitespace backwards off
|
||||
// from there.
|
||||
while (p > value_begin && isspace((unsigned char)line[p - 1])) {
|
||||
p--;
|
||||
}
|
||||
|
@ -44,8 +44,10 @@ This specifies that the variable "load-display" should have the value
|
||||
"pandagl".
|
||||
|
||||
Comments may also appear in the file; they are introduced by a leading
|
||||
hash mark (#). A comment must be on a line by itself; you may not
|
||||
place a comment on the same line with a variable definition.
|
||||
hash mark (#). A comment may be on a line by itself, or it may be on
|
||||
the same line following a variable definition; if it is on the same
|
||||
line as a variable definition, the hash mark must be preceded by at
|
||||
least one space to separate it from the definition.
|
||||
|
||||
|
||||
The legal values that you may specify for any particular variable
|
||||
|
Loading…
x
Reference in New Issue
Block a user