Skip to content

Commit

Permalink
refactor: make template strings work better and strip quotes in strin…
Browse files Browse the repository at this point in the history
…gs directly within the lexer
  • Loading branch information
aboeglin committed Apr 21, 2024
1 parent 4befcd8 commit 2c6a7be
Show file tree
Hide file tree
Showing 59 changed files with 335 additions and 356 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
(Typed
([] :=> TCon (TC "String" Star) "prelude")
(Area (Loc 43 3 11) (Loc 45 3 13))
(LStr "\"\""))
(LStr ""))
[ Typed
([] :=>
TApp
Expand All @@ -74,7 +74,7 @@
(Typed
([] :=> TCon (TC "String" Star) "prelude")
(Area (Loc 55 4 7) (Loc 65 4 17))
(PStr "\"continue\""))
(PStr "continue"))
(Typed
([] :=> TCon (TC "{}" Star) "prelude")
(Area (Loc 77 5 9) (Loc 79 5 11))
Expand Down
52 changes: 26 additions & 26 deletions .snapshots/correctly_infer_various_record_transformations/golden
Original file line number Diff line number Diff line change
Expand Up @@ -4214,7 +4214,7 @@
[ Typed
([] :=> TCon (TC "String" Star) "prelude")
(Area (Loc 0 0 0) (Loc 0 0 0))
(LStr "\"{ \"")
(LStr "{ ")
, Typed
([ IsIn
"Monoid"
Expand Down Expand Up @@ -4301,7 +4301,7 @@
] :=>
TCon (TC "String" Star) "prelude")
(Area (Loc 0 0 0) (Loc 0 0 0))
(LStr "\"b: \""))
(LStr "b: "))
False))
(Typed
([ IsIn
Expand Down Expand Up @@ -4395,7 +4395,7 @@
, Typed
([] :=> TCon (TC "String" Star) "prelude")
(Area (Loc 0 0 0) (Loc 0 0 0))
(LStr "\", \"")
(LStr ", ")
, Typed
([ IsIn
"Monoid"
Expand Down Expand Up @@ -4482,7 +4482,7 @@
] :=>
TCon (TC "String" Star) "prelude")
(Area (Loc 0 0 0) (Loc 0 0 0))
(LStr "\"c: \""))
(LStr "c: "))
False))
(Typed
([ IsIn
Expand Down Expand Up @@ -4585,7 +4585,7 @@
, Typed
([] :=> TCon (TC "String" Star) "prelude")
(Area (Loc 0 0 0) (Loc 0 0 0))
(LStr "\" }\"")
(LStr " }")
])
])))
, Forall
Expand Down Expand Up @@ -4671,7 +4671,7 @@
[ Typed
([] :=> TCon (TC "String" Star) "prelude")
(Area (Loc 0 0 0) (Loc 0 0 0))
(LStr "\"{ \"")
(LStr "{ ")
, Typed
([ IsIn
"Monoid"
Expand Down Expand Up @@ -4758,7 +4758,7 @@
] :=>
TCon (TC "String" Star) "prelude")
(Area (Loc 0 0 0) (Loc 0 0 0))
(LStr "\"p: \""))
(LStr "p: "))
False))
(Typed
([ IsIn
Expand Down Expand Up @@ -4849,7 +4849,7 @@
, Typed
([] :=> TCon (TC "String" Star) "prelude")
(Area (Loc 0 0 0) (Loc 0 0 0))
(LStr "\" }\"")
(LStr " }")
])
])))
, Forall
Expand Down Expand Up @@ -4984,7 +4984,7 @@
[ Typed
([] :=> TCon (TC "String" Star) "prelude")
(Area (Loc 0 0 0) (Loc 0 0 0))
(LStr "\"{ \"")
(LStr "{ ")
, Typed
([ IsIn
"Monoid"
Expand Down Expand Up @@ -5071,7 +5071,7 @@
] :=>
TCon (TC "String" Star) "prelude")
(Area (Loc 0 0 0) (Loc 0 0 0))
(LStr "\"p: \""))
(LStr "p: "))
False))
(Typed
([ IsIn
Expand Down Expand Up @@ -5171,7 +5171,7 @@
, Typed
([] :=> TCon (TC "String" Star) "prelude")
(Area (Loc 0 0 0) (Loc 0 0 0))
(LStr "\", \"")
(LStr ", ")
, Typed
([ IsIn
"Monoid"
Expand Down Expand Up @@ -5258,7 +5258,7 @@
] :=>
TCon (TC "String" Star) "prelude")
(Area (Loc 0 0 0) (Loc 0 0 0))
(LStr "\"y: \""))
(LStr "y: "))
False))
(Typed
([ IsIn
Expand Down Expand Up @@ -5358,7 +5358,7 @@
, Typed
([] :=> TCon (TC "String" Star) "prelude")
(Area (Loc 0 0 0) (Loc 0 0 0))
(LStr "\", \"")
(LStr ", ")
, Typed
([ IsIn
"Monoid"
Expand Down Expand Up @@ -5445,7 +5445,7 @@
] :=>
TCon (TC "String" Star) "prelude")
(Area (Loc 0 0 0) (Loc 0 0 0))
(LStr "\"z: \""))
(LStr "z: "))
False))
(Typed
([ IsIn
Expand Down Expand Up @@ -5560,7 +5560,7 @@
, Typed
([] :=> TCon (TC "String" Star) "prelude")
(Area (Loc 0 0 0) (Loc 0 0 0))
(LStr "\" }\"")
(LStr " }")
])
])))
, Forall
Expand Down Expand Up @@ -7375,7 +7375,7 @@
[ Typed
([] :=> TCon (TC "String" Star) "prelude")
(Area (Loc 0 0 0) (Loc 0 0 0))
(LStr "\"{ \"")
(LStr "{ ")
, Typed
([ IsIn
"Monoid"
Expand Down Expand Up @@ -7462,7 +7462,7 @@
] :=>
TCon (TC "String" Star) "prelude")
(Area (Loc 0 0 0) (Loc 0 0 0))
(LStr "\"p: \""))
(LStr "p: "))
False))
(Typed
([ IsIn
Expand Down Expand Up @@ -7556,7 +7556,7 @@
, Typed
([] :=> TCon (TC "String" Star) "prelude")
(Area (Loc 0 0 0) (Loc 0 0 0))
(LStr "\", \"")
(LStr ", ")
, Typed
([ IsIn
"Monoid"
Expand Down Expand Up @@ -7643,7 +7643,7 @@
] :=>
TCon (TC "String" Star) "prelude")
(Area (Loc 0 0 0) (Loc 0 0 0))
(LStr "\"z: \""))
(LStr "z: "))
False))
(Typed
([ IsIn
Expand Down Expand Up @@ -7746,7 +7746,7 @@
, Typed
([] :=> TCon (TC "String" Star) "prelude")
(Area (Loc 0 0 0) (Loc 0 0 0))
(LStr "\" }\"")
(LStr " }")
])
])))
, Forall
Expand Down Expand Up @@ -7866,7 +7866,7 @@
[ Typed
([] :=> TCon (TC "String" Star) "prelude")
(Area (Loc 0 0 0) (Loc 0 0 0))
(LStr "\"{ \"")
(LStr "{ ")
, Typed
([ IsIn
"Monoid"
Expand Down Expand Up @@ -7953,7 +7953,7 @@
] :=>
TCon (TC "String" Star) "prelude")
(Area (Loc 0 0 0) (Loc 0 0 0))
(LStr "\"g: \""))
(LStr "g: "))
False))
(Typed
([ IsIn
Expand Down Expand Up @@ -8047,7 +8047,7 @@
, Typed
([] :=> TCon (TC "String" Star) "prelude")
(Area (Loc 0 0 0) (Loc 0 0 0))
(LStr "\", \"")
(LStr ", ")
, Typed
([ IsIn
"Monoid"
Expand Down Expand Up @@ -8134,7 +8134,7 @@
] :=>
TCon (TC "String" Star) "prelude")
(Area (Loc 0 0 0) (Loc 0 0 0))
(LStr "\"p: \""))
(LStr "p: "))
False))
(Typed
([ IsIn
Expand Down Expand Up @@ -8237,7 +8237,7 @@
, Typed
([] :=> TCon (TC "String" Star) "prelude")
(Area (Loc 0 0 0) (Loc 0 0 0))
(LStr "\" }\"")
(LStr " }")
])
])))
, Forall
Expand Down Expand Up @@ -8400,7 +8400,7 @@
(Typed
([] :=> TCon (TC "String" Star) "prelude")
(Area (Loc 82 6 12) (Loc 84 6 14))
(LStr "\"\"")))
(LStr "")))
, Forall [] ([] :=> TCon (TC "String" Star) "prelude")
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1311,7 +1311,7 @@
TCon
(TC "String" Star) "prelude")
(Area (Loc 0 0 0) (Loc 0 0 0))
(LStr "\"Point(\"")
(LStr "Point(")
, Typed
([ IsIn
"Show"
Expand Down Expand Up @@ -1464,7 +1464,7 @@
TCon
(TC "String" Star) "prelude")
(Area (Loc 0 0 0) (Loc 0 0 0))
(LStr "\")\"")
(LStr ")")
])))
, Typed
([] :=>
Expand All @@ -1488,7 +1488,7 @@
(Typed
([] :=> TCon (TC "String" Star) "prelude")
(Area (Loc 0 0 0) (Loc 0 0 0))
(LStr "\"Unknown\"")))
(LStr "Unknown")))
])
])))
, Forall
Expand Down
6 changes: 3 additions & 3 deletions .snapshots/should_allow_aliasing_of_types/golden
Original file line number Diff line number Diff line change
Expand Up @@ -7282,7 +7282,7 @@
TCon
(TC "String" Star) "prelude")
(Area (Loc 0 0 0) (Loc 0 0 0))
(LStr "\"Wish(\"")
(LStr "Wish(")
, Typed
([ IsIn
"Show"
Expand Down Expand Up @@ -7657,7 +7657,7 @@
TCon
(TC "String" Star) "prelude")
(Area (Loc 0 0 0) (Loc 0 0 0))
(LStr "\")\"")
(LStr ")")
])))
, Typed
([] :=>
Expand Down Expand Up @@ -7698,7 +7698,7 @@
(Typed
([] :=> TCon (TC "String" Star) "prelude")
(Area (Loc 0 0 0) (Loc 0 0 0))
(LStr "\"Unknown\"")))
(LStr "Unknown")))
])
])))
, Forall
Expand Down
Loading

0 comments on commit 2c6a7be

Please sign in to comment.