-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(embed): escape dollar symbol of JSON string literal (#21)
With the original version, `embed.dart` cannot generate a compilable Dart code if the source JSON has a string literal containing a dollar symbol ($). For example, the following code will be generated from {"dollar": "$"}: ```dart const _$variable = (dollar: "$"); // the string literal "$" is not valid, which is a beginning of string interpolation. ``` In the revised version, I fixed it to generate the following code from that JSON: ```dart const _$variable = (dollar: "\$"); // $ is escaped! ``` I also added a test case.
- Loading branch information
Showing
4 changed files
with
17 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters