Forums

Full Version: actual config format
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Parsing .car files with a perl-module, i found:
Code:
include ../../carparts/f1_front
include ../../carparts/f1_rear
isn`t standard. My proposal:
Code:
[includes]
include = ../../carparts/f1_front, ../../carparts/f1_rear
or:
Code:
[include.carparts]
include = f1_front, f1_rear
I plan is to get rid of them, make includes implicit and look for the referred object in the current and shared directory.
annotation:
read .car file in a Perl hash, sending with JSON in a webpage;
Javascript using prototype.js ("<!--EVENT..." is a template-placeholder representing the Hash):
Code:
var dotcar = '<!--EVENT::dotcar:json_dump () /-->'.evalJSON(true);
document.write('Kupplungsfläche: ' + dotcar.clutch.area + ';' );
document.write('Bremsscheibenfläche: ' + dotcar.wheel.fl.brake.area + ';' );
Second write won´t work, because prototype uses point-syntax.
Consider section names with "_" or ":"
The dot in the section name is simply a separator to denote the object hierarchy. I am not so fit with javascript. Are you trying to evaluate section names?
NaN Wrote:The dot in the section name is simply a separator to denote the object hierarchy. I am not so fit with javascript. Are you trying to evaluate section names?
Yes.
dotcar is a JS object (by prototypejs):
Code:
dotcar.wheel_fl_brake.area
works
Code:
dotcar.wheel.fl.brake.area
doesn´t work
It´s not a severe problem for me, the workaround was simple.
But it demonstrates, that a name (string) is not a hierarchy. Point syntax is often used for this, so another character may be better for a "flat" section name, "_" or ":".
Quote:may be better for a "flat" section name
wheel.fl.brake is not a flat name. The fl identifier is meant to be completely arbitrary. To support variable number of wheels. I think I still have the patch to support this. Unfortunately it is written against the unstable(removed) suspension/wheel code.