Sounds like YAML parser can do the job.

At least, `require('js-yaml').safeLoad(fs.readFileSync('./config.gypi', 
'utf8'))` works. :P


23.01.2014, 18:59, "Fedor Indutny" <[email protected]>:
> I meant python comments: 
> https://github.com/joyent/node/blob/master/node.gyp#L83
>
> But I think some simple regexp to trim them and eval could really make
> the trick work.
>
> On Thu, Jan 23, 2014 at 6:56 PM, Arnout Kazemier <[email protected]> wrote:
>
>>  Then you could do something like `data = (new Function(‘return ‘+ gyp)())`
>>  to get the data.
>>
>>  Founder: 3rd-Eden
>>  Product: Observe.it
>>
>>  Lead Software Engineer: Nodejitsu.com
>>
>>  Twitter: @3rdEden
>>
>>  Github: @3rd-Eden
>>
>>  Skype: arnoutkazemier
>>
>>  Facebook: arnout.kazemier
>>
>>  Mobile: +31623254031
>>
>>  On Thursday 23 January 2014 at 15:15, Fedor Indutny wrote:
>>
>>  Won't work either, I guess. As it may contain comments.
>>
>>  On Thu, Jan 23, 2014 at 6:15 PM, Arnout Kazemier <[email protected]> wrote:
>>
>>  eval it?
>>
>>  On Thursday 23 January 2014 at 15:01, Kevin Ingwersen wrote:
>>
>>  Hey!
>>
>>  Is it possible to parse GYP files in nodejs? JSON.parse fails at the first
>>  single-quote x.x
>>
>>  Kind regards, Ingwie
>>
>>  --
>>  --
>>  Job Board: http://jobs.nodejs.org/
>>  Posting guidelines:
>>  https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
>>  You received this message because you are subscribed to the Google
>>  Groups "nodejs" group.
>>  To post to this group, send email to [email protected]
>>  To unsubscribe from this group, send email to
>>  [email protected]
>>  For more options, visit this group at
>>  http://groups.google.com/group/nodejs?hl=en?hl=en
>>
>>  ---
>>  You received this message because you are subscribed to the Google Groups
>>  "nodejs" group.
>>  To unsubscribe from this group and stop receiving emails from it, send an
>>  email to [email protected].
>>  For more options, visit https://groups.google.com/groups/opt_out.
>>
>>  --
>>  --
>>  Job Board: http://jobs.nodejs.org/
>>  Posting guidelines:
>>  https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
>>  You received this message because you are subscribed to the Google
>>  Groups "nodejs" group.
>>  To post to this group, send email to [email protected]
>>  To unsubscribe from this group, send email to
>>  [email protected]
>>  For more options, visit this group at
>>  http://groups.google.com/group/nodejs?hl=en?hl=en
>>
>>  ---
>>  You received this message because you are subscribed to the Google Groups
>>  "nodejs" group.
>>  To unsubscribe from this group and stop receiving emails from it, send an
>>  email to [email protected].
>>  For more options, visit https://groups.google.com/groups/opt_out.
>>
>>  --
>>  --
>>  Job Board: http://jobs.nodejs.org/
>>  Posting guidelines:
>>  https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
>>  You received this message because you are subscribed to the Google
>>  Groups "nodejs" group.
>>  To post to this group, send email to [email protected]
>>  To unsubscribe from this group, send email to
>>  [email protected]
>>  For more options, visit this group at
>>  http://groups.google.com/group/nodejs?hl=en?hl=en
>>
>>  ---
>>  You received this message because you are subscribed to the Google Groups
>>  "nodejs" group.
>>  To unsubscribe from this group and stop receiving emails from it, send an
>>  email to [email protected].
>>  For more options, visit https://groups.google.com/groups/opt_out.
>>
>>  --
>>  --
>>  Job Board: http://jobs.nodejs.org/
>>  Posting guidelines:
>>  https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
>>  You received this message because you are subscribed to the Google
>>  Groups "nodejs" group.
>>  To post to this group, send email to [email protected]
>>  To unsubscribe from this group, send email to
>>  [email protected]
>>  For more options, visit this group at
>>  http://groups.google.com/group/nodejs?hl=en?hl=en
>>
>>  ---
>>  You received this message because you are subscribed to the Google Groups
>>  "nodejs" group.
>>  To unsubscribe from this group and stop receiving emails from it, send an
>>  email to [email protected].
>>  For more options, visit https://groups.google.com/groups/opt_out.
>
> --
> --
> Job Board: http://jobs.nodejs.org/
> Posting guidelines: 
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en
>
> ---
> You received this message because you are subscribed to the Google Groups 
> "nodejs" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.

-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to