Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb31ccfb

Browse files
Merge pull request#337 from eventualbuddha/fix-string-interpolation-raw
Ensure string interpolation segments have `raw' values.
2 parentsa40829b +9434c17 commitb31ccfb

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

‎lib/parser.js‎

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎src/grammar.pegcoffee‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@
170170
if left instanceof CS.String
171171
if left is init
172172
c left, s
173+
left.raw = s.raw
173174
delete left.generated
174175
left.data = "#{left.data}#{s.data}"
175176
return memo

‎test/parser.coffee‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,11 @@ suite 'Parser', ->
164164
ast=parse'0x0',raw:yes
165165
eq'0x0',ast.body.statements[0].raw
166166

167+
test'strings',->
168+
ast=parse'"aaaaaa#{bbbbbb}cccccc"',raw:yes
169+
eq'aaaaaa',ast.body.statements[0].left.left.raw
170+
eq'cccccc',ast.body.statements[0].right.raw
171+
167172
suite'position/offset preservation',->
168173

169174
test'basic indentation',->

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp