Skip to content

Commit f273426

Browse files
authored
Merge pull request #391 from viralpraxis/fix-readme-parse-with-comments-examples
Fix README `parse_with_comments` examples
2 parents 380163a + 6e174fe commit f273426

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ To preserve the comments from the source:
4444
require 'parser/current'
4545
require 'unparser'
4646

47-
ast, comments = Unparser.parse_with_comments('your(ruby(code)) # with comments')
47+
ast, comments = Unparser.parser.parse_with_comments(Unparser.buffer('your(ruby(code)) # with comments'))
4848

49-
Unparser.unparse(ast, comments) # => 'your(ruby(code)) # with comments'
49+
Unparser.unparse(ast, comments: comments) # => 'your(ruby(code)) # with comments'
5050
```
5151

5252
Passing in manually constructed AST:

0 commit comments

Comments
 (0)