Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
made line comments unspace-able (gkz/LiveScript#550)
  • Loading branch information
satyr committed Sep 28, 2014
1 parent e3db772 commit 61d79bb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/lexer.js
Expand Up @@ -1495,7 +1495,7 @@ SYMBOL = /[-+\/&|^:]=|\.{1,3}|([-+&|@:])\1|[-~=|]>|[!=]==?|<(?:<(?:=|<{0,2})|[-~
SPACE = /[^\n\S]*(?:#.*)?/g;
MULTIDENT = /(?:\s*#.*)*(?:\n([^\n\S]*))*/g;
SIMPLESTR = /'[^\\']*(?:\\[\s\S][^\\']*)*'|/g;
BSTOKEN = /\\(?:(\S[^\s,;)}\]]*)|\s*)/g;
BSTOKEN = /\\(?:(\S[^\s,;)}\]]*)|(?:\s+(?:#.*)?)*)/g;
JSTOKEN = /(`+)([^`][\s\S]*?)\1|/g;
NUMBER = /0x[\dA-Fa-f][\dA-Fa-f_]*|([2-9]|[12]\d|3[0-6])r([\dA-Za-z]\w*)|((\d[\d_]*)(\.\d[\d_]*)?(?:e[+-]?\d[\d_]*)?)[$\w]*|/g;
NUMBER_OMIT = /_+/g;
Expand Down
2 changes: 1 addition & 1 deletion src/lexer.co
Expand Up @@ -1061,7 +1061,7 @@ SYMBOL = //
SPACE = /[^\n\S]*(?:#.*)?/g
MULTIDENT = /(?:\s*#.*)*(?:\n([^\n\S]*))*/g
SIMPLESTR = /'[^\\']*(?:\\[\s\S][^\\']*)*'|/g
BSTOKEN = // \\ (?: (\S[^\s,;)}\]]*) | \s* ) //g
BSTOKEN = // \\ (?: (\S[^\s,;)}\]]*) | (?:\s+(?:#.*)?)* ) //g
JSTOKEN = /(`+)([^`][\s\S]*?)\1|/g

NUMBER = //
Expand Down
8 changes: 8 additions & 0 deletions test/comment.co
Expand Up @@ -57,6 +57,14 @@ test =

eq test, 'test test test'


# [livescript#550](https://github.com/gkz/LiveScript/issues/550)
{1, \ # comment
#!comment
#!comment
2}


/*
This is a block comment.
Just like JS.
Expand Down

0 comments on commit 61d79bb

Please sign in to comment.