DMTF / YANG-to-Redfish-Converter

This tool converts a YANG model file to the corresponding Redfish schema, specified in OData CSDL, in accordance with the YANG-to-CSDL Mapping Specification.
Other
4 stars 5 forks source link

Use proper pre-processor to remove C-style comments from YANG files #2

Closed tomasg2012 closed 6 years ago

tomasg2012 commented 6 years ago

Current process is indiscriminate of string syntax and will cause line breaks in strings that contain URLs.

tomasg2012 commented 6 years ago

As of now, it works for http links but might break other kinds of links.

@jcleung5549 Would it be acceptable just to write in the README to suggest a utility or command line tool to strip comments? Or should a stronger script be included with the repo, I've only been able to find perl scripts with the kind of power to remove comments consistently. It's also an issue that YANG files themselves are not inherently C files, such that it may trip certain comment stripping logic.

jcleung5549 commented 6 years ago

Yes, for now. The wording in rfc6020 makes it assumes a C-style file. If there are usages that violate this, then should there be escape characters in the offending YANG files? The converter might just be more rigorous that other YANG tooling. Please send (or attach) an offending YANG model.

From rfc6020, section 6.1.1 (Comments) Comments are C++ style. A single line comment starts with "//" and ends at the end of the line. A block comment is enclosed within "/" and "/".