-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dart: Added string interpolation and improved metadata (#3197)
- Loading branch information
1 parent
86028ad
commit e137035
Showing
4 changed files
with
237 additions
and
26 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,148 @@ | ||
@deprecated | ||
@override | ||
@todo('seth', 'make this do something') | ||
@ToDo('seth', 'make this do something') | ||
|
||
@DataTable("sale_orders") | ||
class SaleOrder { | ||
@DataColumn("sale_order_date") | ||
DateTime date; | ||
} | ||
|
||
@table | ||
class Product { | ||
@column | ||
String name; | ||
} | ||
|
||
const DataColumn column = const DataColumn(); | ||
|
||
const DataTable table = const DataTable(); | ||
|
||
class DataTable { | ||
final String name; | ||
|
||
const DataTable([this.name]); | ||
} | ||
|
||
class DataColumn { | ||
final String name; | ||
|
||
const DataColumn([this.name]); | ||
} | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["metadata", "@deprecated"], | ||
|
||
["metadata", "@override"], | ||
["metadata", "@todo"], | ||
|
||
["metadata", "@ToDo"], | ||
["punctuation", "("], | ||
["string", "'seth'"], | ||
["string-literal", [ | ||
["string", "'seth'"] | ||
]], | ||
["punctuation", ","], | ||
["string", "'make this do something'"], | ||
["punctuation", ")"] | ||
["string-literal", [ | ||
["string", "'make this do something'"] | ||
]], | ||
["punctuation", ")"], | ||
|
||
["metadata", "@DataTable"], | ||
["punctuation", "("], | ||
["string-literal", [ | ||
["string", "\"sale_orders\""] | ||
]], | ||
["punctuation", ")"], | ||
|
||
["keyword", "class"], | ||
["class-name", ["SaleOrder"]], | ||
["punctuation", "{"], | ||
|
||
["metadata", "@DataColumn"], | ||
["punctuation", "("], | ||
["string-literal", [ | ||
["string", "\"sale_order_date\""] | ||
]], | ||
["punctuation", ")"], | ||
|
||
["class-name", ["DateTime"]], | ||
" date", | ||
["punctuation", ";"], | ||
|
||
["punctuation", "}"], | ||
|
||
["metadata", "@table"], | ||
["keyword", "class"], ["class-name", ["Product"]], ["punctuation", "{"], | ||
["metadata", "@column"], | ||
["class-name", ["String"]], " name", ["punctuation", ";"], | ||
["punctuation", "}"], | ||
|
||
["keyword", "const"], | ||
["class-name", ["DataColumn"]], | ||
" column ", | ||
["operator", "="], | ||
["keyword", "const"], | ||
["class-name", ["DataColumn"]], | ||
["punctuation", "("], | ||
["punctuation", ")"], | ||
["punctuation", ";"], | ||
|
||
["keyword", "const"], | ||
["class-name", ["DataTable"]], | ||
" table ", | ||
["operator", "="], | ||
["keyword", "const"], | ||
["class-name", ["DataTable"]], | ||
["punctuation", "("], | ||
["punctuation", ")"], | ||
["punctuation", ";"], | ||
|
||
["keyword", "class"], | ||
["class-name", ["DataTable"]], | ||
["punctuation", "{"], | ||
|
||
["keyword", "final"], | ||
["class-name", ["String"]], | ||
" name", | ||
["punctuation", ";"], | ||
|
||
["keyword", "const"], | ||
["class-name", ["DataTable"]], | ||
["punctuation", "("], | ||
["punctuation", "["], | ||
["keyword", "this"], | ||
["punctuation", "."], | ||
"name", | ||
["punctuation", "]"], | ||
["punctuation", ")"], | ||
["punctuation", ";"], | ||
|
||
["punctuation", "}"], | ||
|
||
["keyword", "class"], | ||
["class-name", ["DataColumn"]], | ||
["punctuation", "{"], | ||
|
||
["keyword", "final"], | ||
["class-name", ["String"]], | ||
" name", | ||
["punctuation", ";"], | ||
|
||
["keyword", "const"], | ||
["class-name", ["DataColumn"]], | ||
["punctuation", "("], | ||
["punctuation", "["], | ||
["keyword", "this"], | ||
["punctuation", "."], | ||
"name", | ||
["punctuation", "]"], | ||
["punctuation", ")"], | ||
["punctuation", ";"], | ||
|
||
["punctuation", "}"] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for metadata. | ||
Checks for metadata. |
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