Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fcm make: Error parsing contractions in comments #174

Open
ScottWales opened this issue Feb 2, 2015 · 1 comment
Open

fcm make: Error parsing contractions in comments #174

ScottWales opened this issue Feb 2, 2015 · 1 comment
Labels
Milestone

Comments

@ScottWales
Copy link

FCM is ignoring lines that have an apostrophy in an inline comment

$foo = -a # Can't use contractions!
build.prop{fc.flags} = $foo

I expect that FCM will use the flag -a, however no flags actually get used

$ cat fcm-make-as-parsed.cfg
build.prop{fc.flags} = 

Per http://metomi.github.io/fcm/doc/user_guide/annex_cfg.html#syntax.comment any characters on a line after the # should get ignored. If you add a second apostrophy to the comment it gets parsed correctly

$foo = -a # ''
build.prop{fc.flags} = $foo
$ cat fcm-make-as-parsed.cfg 
build.prop{fc.flags} = a
@matthewrmshin matthewrmshin self-assigned this Feb 2, 2015
@matthewrmshin matthewrmshin modified the milestones: soon, later Feb 2, 2015
@matthewrmshin
Copy link
Member

The problematic line can be found here: https://github.com/metomi/fcm/blob/master/lib/FCM/Util/ConfigReader.pm#L323

The parsing logic uses the parse_line function in the standard Perl Text::ParseWords module.

The parsing logic is meant to allow you to handle cases like:

$foo = -a "the # sign" # comment

Unfortunately, it does not handle the case you have reported. I cannot think of an easy fix right away, so please avoid using apostrophes in inline comments for now.

@matthewrmshin matthewrmshin removed their assignment Sep 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants