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

Regexes treated as comments? #12

Open
thekvn opened this issue Feb 20, 2012 · 2 comments
Open

Regexes treated as comments? #12

thekvn opened this issue Feb 20, 2012 · 2 comments

Comments

@thekvn
Copy link

thekvn commented Feb 20, 2012

Error: missing blank before close comment on:

server.all(/.*/, function (req, res, next) {
  req.sdc = server.clients;
  next();
});

and

server.get(/\/.*/, function (req, res) {
  res.render('index');
});
@davepacheco
Copy link
Contributor

The usual workaround is to add a /* JSSTYLED */ comment on the previous line (which is not to say this couldn't be improved).

@mcavage
Copy link

mcavage commented Jun 1, 2012

This would be really nice to have fixed. This is kind of obnoxious to work around with if/else blocks of regex's. For example, each line below results in an error from jsstlye (and yes, you can use BEGIN - END, but still).

0                 } else if (/^;; QUESTION SECTION:/.test(l)) {
51                         section = 'question';
52                 } else if (/^;; ANSWER SECTION:/.test(l)) {
53                         section = 'answer';
54                 } else if (/^;; ADDITIONAL SECTION:/.test(l)) {
55                         section = 'additional';
56                 } else if (/^;; AUTHORITY SECTION:/.test(l)) {
57                         section = 'authority';
58                 }
59 
60                 if (section === 'question') {
61                         if (/^;([A-Za-z0-9])*\./.test(l)) {
62                                 results.question =
63                                         l.match(/([A-Za-z0-9_\-\.])+/)[0];
64                         }
65                 }
66 
67                 if (section === 'answer') {
68                         if (/^([_A-Za-z0-9])+/.test(l)) {
69                                 var tokens = l.match(/(.*)/)[0].split(/\t/);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants