Commit graph

22 commits

Author SHA1 Message Date
Chris Wong
26a9d7484d
Disallow int literals in attribute values () 2024-01-15 00:45:49 +11:00
Teodor Källman
8c47208568
Accept literals in attribute names ()
* Accept literals in attribute names

* Accept literals in attribute names

* Propper handling of literals in name_to_string()
2023-11-14 15:05:48 +11:00
Chris Wong
317bf9e5ec
Rename Attribute to NamedAttr () 2021-11-07 11:39:44 +00:00
Alexandre Macabies
2909e5129c
Add support for Option<T> attributes ()
* Add support for Option<T> attributes

Introduces the `attr=[value]` syntax that assumes `value` is an
`Option<T>`. Renders `attr="value"` for `Some(value)` and entirely
omits the attribute for `None`.

Implements and therefore closes .

* Call `Generator::splice` directly

* Handle struct literals (edge case)

Co-authored-by: Chris Wong <xbuns@google.com>
2021-10-29 16:24:34 +11:00
Chris Wong
8990049101
Improve error message for non-string literals ()
Closes 
2021-03-21 22:20:37 +11:00
Chris Wong
9f7331f427
Remove Attrs type alias () 2021-03-13 20:25:56 +11:00
Chris Wong
50a7e9ce37 Format everything! 2020-09-27 21:36:27 +10:00
CreepySkeleton
7d16af9a06 Make use of SpanRange instead of Span 2020-08-31 11:57:55 +03:00
CreepySkeleton
ef120ab2d0 Transfer codebase from ParseResult to abort! 2020-08-30 23:28:49 +03:00
Chris Wong
65874efb98 Remove redundant closures 2019-02-21 21:22:22 +13:00
Chris Wong
8d8d5960a5 Extend AST to allow arbitrary exprs in classes and IDs 2018-08-13 15:44:04 -07:00
Chris Wong
d8d5af97f8 Span the whole class or ID in duplicate attribute errors 2018-08-12 14:12:59 +12:00
Chris Wong
3847880404 Span the whole attribute in duplicate attribute errors 2018-08-12 14:12:52 +12:00
Chris Wong
5aa0f85ec1 Show errors for a duplicate attribute in source order
* Also disallow multiple IDs
2018-08-12 14:07:31 +12:00
Chris Wong
b9279f7f3f Add .span() method to derive the span of an AST node 2018-06-16 21:27:57 +12:00
Chris Wong
4b25728efe Add at_span to Let 2018-06-16 20:59:41 +12:00
Chris Wong
0ceb271a50 Add outer_span property to Splice 2018-06-16 20:55:42 +12:00
Chris Wong
bfa15a0081 Rename Block.span to Block.outer_span 2018-06-16 20:49:46 +12:00
Chris Wong
9d56ba0bcb Keep spans for semicolons; change element body to a block 2018-06-09 20:51:34 +12:00
Chris Wong
9763541ca7 Keep the span of the leading @ symbol 2018-06-09 17:59:24 +12:00
Chris Wong
254ac54103 Merge If and Special variants 2018-05-29 19:18:30 +12:00
Chris Wong
9d90e94c87
Change macro internals to use an explicit AST () 2018-05-17 20:38:44 +12:00