File tree 2 files changed +8
-2
lines changed
src/Language/JavaScript/Parser
2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,11 @@ testLiteralParser = describe "Parse literals:" $ do
47
47
testLiteral " '\\ u1234'" `shouldBe` " Right (JSAstLiteral (JSStringLiteral '\\ u1234'))"
48
48
testLiteral " '\\ uabcd'" `shouldBe` " Right (JSAstLiteral (JSStringLiteral '\\ uabcd'))"
49
49
testLiteral " \"\\ r\\ n\" " `shouldBe` " Right (JSAstLiteral (JSStringLiteral \"\\ r\\ n\" ))"
50
+ testLiteral " \"\\ b\" " `shouldBe` " Right (JSAstLiteral (JSStringLiteral \"\\ b\" ))"
51
+ testLiteral " \"\\ f\" " `shouldBe` " Right (JSAstLiteral (JSStringLiteral \"\\ f\" ))"
52
+ testLiteral " \"\\ t\" " `shouldBe` " Right (JSAstLiteral (JSStringLiteral \"\\ t\" ))"
53
+ testLiteral " \"\\ v\" " `shouldBe` " Right (JSAstLiteral (JSStringLiteral \"\\ v\" ))"
54
+ testLiteral " \"\\ 0\" " `shouldBe` " Right (JSAstLiteral (JSStringLiteral \"\\ 0\" ))"
50
55
testLiteral " \" hello\\ nworld\" " `shouldBe` " Right (JSAstLiteral (JSStringLiteral \" hello\\ nworld\" ))"
51
56
testLiteral " 'hello\\ nworld'" `shouldBe` " Right (JSAstLiteral (JSStringLiteral 'hello\\ nworld'))"
52
57
Original file line number Diff line number Diff line change @@ -64,8 +64,9 @@ $not_eol_char = ~$eol_char -- anything but an end of line character
64
64
65
65
$string_chars = [^ \n \r ' \" \\ ]
66
66
67
- @sq_escapes = \\ ( \\ | ' | r | n | x )
68
- @dq_escapes = \\ ( \\ | \" | r | n | x )
67
+ -- See e.g. http://es5.github.io/x7.html#x7.8.4 (Table 4)
68
+ @sq_escapes = \\ ( \\ | ' | b | f | n | r | t | v | 0 | x )
69
+ @dq_escapes = \\ ( \\ | \" | b | f | n | r | t | v | 0 | x )
69
70
70
71
@unicode_escape = \\ u $hex_digit{4}
71
72
You can’t perform that action at this time.
0 commit comments