cloudy-astrophysics / bug-tracker-migration-test

Trial run for importing the nublado.org Trac tickets as GitHub issues
0 stars 0 forks source link

do not use C as a comment character (trac #391) #393

Closed cloudy-bot closed 4 years ago

cloudy-bot commented 6 years ago

reported by: @CloudyLex

see the extensive discussion on both user groups, and Peter recommended solution

Migrated from https://www.nublado.org/ticket/391

{
    "status": "closed",
    "changetime": "2019-02-04T12:09:37Z",
    "_ts": "1549282177514312",
    "description": "see the extensive discussion on both user groups, and Peter recommended solution",
    "reporter": "gary",
    "cc": "",
    "resolution": "fixed",
    "time": "2017-07-10T15:56:53Z",
    "component": "input parser",
    "summary": "do not use C as a comment character",
    "priority": "blocker",
    "keywords": "",
    "version": "trunk",
    "milestone": "c17.01",
    "owner": "peter",
    "type": "defect - wrong answer"
}
cloudy-bot commented 6 years ago

As the description is not very descriptive, this is the problem. Under certain circumstances species labels such as "C 1" could be misinterpreted as a comment. Since we were already discussing limiting the number of comment characters, the following action was decided.

For c17_branch:

  • remove "c " and "C " as a valid comment character, thus preventing the bug.

  • make "#" the comment character for visible comments ("c " used to do that).

  • add "##" as a new comment character for hidden comments.

(here "visible comments" are echoed in the output, while "hidden comments" are not). A script will be created to assist in modifying the comment characters. These changes are intended to be released in c17.01.

For the trunk:

  • do the same as on c17_branch.

  • additionally, remove all comment characters other than "#" and "##".

The script (called ccc.pl) will take input scripts directly to a state that will be valid on the trunk (this is to avoid double work when the next main release comes out).

While investigating this, a number of other (minor) bugs were found in the parser.

A - Init files do not strip comments starting after column 1, so the following line is correctly marked invalid in the main script, but will be happily accepted in an init file:

    hden // 8

B - The main script accepts '***' as an EOF marker, but the init file does not (it treats it as a regular command). When running Cloudy as a subroutine, passing this to cdRead() will also cause it to be stored as a normal command and treated as a regular comment. I know this is an unlikely usage pattern, but the treatment should still be the same...

C - cdRead() acts as what I call the "preparser" or pass 1 over the input script in order to set several variables that need a value before the regular parser (or pass 2) starts. Lines in init files are not included in this process. This can lead to differences in behavior (or even bugs) when lines are moved from the main script to an init file.

D - Treatment of alternate (MS) EOL sequences is inconsistent. In most places they are not stripped correctly.

E - The code will now pick up on underscores and square brackets in comments if these comments do not start in the first column. One example where this happens is in the blr_n14_p18.in script.

All these bugs will be fixed on the newcomment branch.

cloudy-bot commented 6 years ago

@peter-van-hoof-noaccount commented:

The first set of changes (implementing the changes appropriate for c17_branch) have been merged to the trunk in r11769 and r11770, and subsequently merged to c17_branch in r11772 and r11773.

cloudy-bot commented 6 years ago

@peter-van-hoof-noaccount commented:

A minor bug-fix of the !StripComment() routine was merged to the trunk in r11778 and to c17_branch in r11779. In r11780, the comment characters //, *, %, and ; were deprecated on c17_branch. We now print a NOTE if they occur in the input, stating this fact.

cloudy-bot commented 6 years ago

@peter-van-hoof-noaccount commented:

Incorrect array dimensions were fixed in r11784 on c17_branch.

cloudy-bot commented 6 years ago

Changes to remove all comment characters other than '#' and '##' were committed to the trunk in r11797. This finalizes fixing this problem.

cloudy-bot commented 6 years ago

Milestone renamed

cloudy-bot commented 6 years ago

Milestone renamed

cloudy-bot commented 6 years ago

Milestone renamed