File tree Expand file tree Collapse file tree 3 files changed +57
-1
lines changed
Expand file tree Collapse file tree 3 files changed +57
-1
lines changed Original file line number Diff line number Diff line change 1- import { Block , Parens } from 'decaffeinate-coffeescript/lib/coffee-script/nodes' ;
1+ import {
2+ Block , Comment , Parens
3+ } from 'decaffeinate-coffeescript/lib/coffee-script/nodes' ;
24import { Node , SeqOp } from '../nodes' ;
35import ParseContext from '../util/ParseContext' ;
46import mapAny from './mapAny' ;
@@ -9,6 +11,7 @@ export default function mapParens(context: ParseContext, node: Parens): Node {
911 }
1012
1113 let { expressions } = node . body ;
14+ expressions = expressions . filter ( ( expr ) => ! ( expr instanceof Comment ) ) ;
1215
1316 if ( expressions . length === 1 ) {
1417 return mapAny ( context , expressions [ 0 ] ) ;
Original file line number Diff line number Diff line change 1+ () -> (
2+ ### yo###
3+ a
4+ )
Original file line number Diff line number Diff line change 1+ {
2+ "body" : {
3+ "column" : 1 ,
4+ "end" : 24 ,
5+ "inline" : false ,
6+ "line" : 1 ,
7+ "raw" : " () -> (\n ###yo###\n a\n )" ,
8+ "start" : 0 ,
9+ "statements" : [
10+ {
11+ "body" : {
12+ "column" : 7 ,
13+ "end" : 24 ,
14+ "inline" : true ,
15+ "line" : 1 ,
16+ "raw" : " (\n ###yo###\n a\n )" ,
17+ "start" : 6 ,
18+ "statements" : [
19+ {
20+ "column" : 3 ,
21+ "data" : " a" ,
22+ "end" : 22 ,
23+ "line" : 3 ,
24+ "raw" : " a" ,
25+ "start" : 21 ,
26+ "type" : " Identifier"
27+ }
28+ ],
29+ "type" : " Block"
30+ },
31+ "column" : 1 ,
32+ "end" : 24 ,
33+ "line" : 1 ,
34+ "parameters" : [
35+ ],
36+ "raw" : " () -> (\n ###yo###\n a\n )" ,
37+ "start" : 0 ,
38+ "type" : " Function"
39+ }
40+ ],
41+ "type" : " Block"
42+ },
43+ "column" : 1 ,
44+ "end" : 25 ,
45+ "line" : 1 ,
46+ "raw" : " () -> (\n ###yo###\n a\n )\n " ,
47+ "start" : 0 ,
48+ "type" : " Program"
49+ }
You can’t perform that action at this time.
0 commit comments