Skip to content

Commit 3486133

Browse files
committed
Using absent? design instead of recursive
This reads a bit better. Also found it after the fact in the parslet examples.
1 parent 258a369 commit 3486133

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

lib/csscss/parser/css.rb

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,8 @@ def parse(source)
1212
class Parser < Parslet::Parser
1313
include Common
1414

15-
rule(:end_comment) {
16-
match['^\\*'].repeat >> str("*") >> (match('/') | end_comment)
17-
}
18-
1915
rule(:comment) {
20-
space? >> str('/*') >> end_comment >> space?
16+
space? >> str('/*') >> (str('*/').absent? >> any).repeat >> str('*/') >> space?
2117
}
2218

2319
rule(:css_space?) {

0 commit comments

Comments
 (0)