Commit graph

74 commits

Author SHA1 Message Date
Isaac van Bakel
f1f67e5aac Added compile tests to check keyword warning
compiletest_rs is now used to check that elements which have keyword
names are now warned against in a UI test.
compiletest_rs has been added as a build dependency.
2018-10-19 22:39:11 +01:00
Chris Wong
e0c7fcf055 Initial stab at porting to new proc macro interface 2017-07-23 13:58:42 +12:00
Chris Wong
c57ee6e683 Remove RenderOnce
Closes 
2016-12-23 20:38:53 +13:00
Chris Wong
585ed3851b Implement toggled classes
Closes 
2016-11-19 15:59:33 +13:00
Chris Wong
8f77990e8c Remove unnecessary #[feature(conservative_impl_trait)] 2016-11-19 15:59:06 +13:00
Chris Wong
68feeeff1b Change empty attribute syntax to use [square brackets]
Closes 
See 
2016-11-17 20:39:02 +13:00
Chris Wong
39602a075c Implement let expressions
Closes 
2016-11-12 14:46:49 +13:00
Chris Wong
202cc8decf Fix Clippy warnings 2016-11-06 12:40:57 +13:00
Utkarsh Kukreti
553a6bc037 Add support for @while and @while let.
Fixes .
2016-10-19 21:46:37 +05:30
Chris Wong
9fa87721e6 Rewrite Render and RenderOnce traits
... to make them more user-friendly.

Closes 
2016-10-08 21:50:59 +13:00
Chris Wong
f48966b5bb Fix test breakage oh no 2016-10-05 20:51:16 +13:00
Chris Wong
c05bb02d97 Remove call expressions 2016-09-23 19:36:42 +12:00
Chris Wong
f12efe4299 Rewrite everything to use Strings instead of writers
After fiddling around with zero-allocation solutions, I concluded that
all non-allocating approaches are too annoying to work with in realistic
code. Using closures leads to yak-shaving with lifetimes; and because
Iron needs to take ownership of the response body we often end up
cloning the input data anyway.

Removing this constraint has let me simplify the entire system, removing
a net 300 lines from the library. The `html!` macro no longer takes a
writer, and instead returns a `PreEscaped<String>`. This means that the
result of an `html!` can be spliced directly into another `html!`,
removing the need for the `impl Template` rigmarole.

To rub it in, benchmarks show the new code is in fact *faster* than it
was before. How lovely.
2016-09-23 19:22:22 +12:00
Chris Wong
83efd5877f Add missing test 2016-09-19 21:42:34 +12:00
Chris Wong
7045191c19 Add the "call" keyword back in
This change should make the syntax look a bit less mysterious
2016-09-02 23:23:39 +12:00
Chris Wong
ed9228fa93 Require parentheses around calls
This simplifies the parser quite a bit
2016-08-22 21:53:23 +12:00
Chris Wong
97a71d7bc3 Require that all literal strings are quoted
Unquoted literals are confusing, annoying to implement, and rarely used.
We're better off without them.
2016-08-18 22:31:12 +12:00
Chris Wong
6a6b23d8ae Switch to new splice syntax using parentheses
Closes 
2016-08-18 22:12:14 +12:00
Chris Wong
61791a6aef @call yay -> @yay 2016-08-15 20:46:04 +12:00
Chris Wong
aded75f01f Add some juicy impl Trait niceness 2016-08-15 20:32:39 +12:00
Chris Wong
d2bf70da9a Allow names with multiple hyphens in a row
Fixes 
2016-08-07 20:39:31 +12:00
Chris Wong
1ec48a3725 Refactor tests
Closes 
2016-07-31 21:34:46 +12:00
msifeed
e222f5385d Fixed minuses in namespaces 2016-07-18 14:40:45 +03:00
msifeed
bad49d49c0 Add namespace support for element and attribute names 2016-07-18 13:07:58 +03:00
Chris Wong
92ba854773 Implement ID shorthand
Closes 
2016-06-03 23:06:39 +12:00
Wim Looman
f35707cce0 Add test for match inside an attribute 2016-02-09 19:45:59 +01:00
Wim Looman
b254d7fbc4 Add support for a match keyword 2016-02-09 19:44:54 +01:00
Chris Wong
f113623657 Merge pull request from Nemo157/change-symbology
Change symbology
2016-02-08 23:38:23 +11:00
Wim Looman
1b307449f3 Add @ prefix on else back in 2016-02-07 11:02:33 +01:00
Wim Looman
da86d54b05 Remove div shorthand 2016-02-07 10:59:20 +01:00
Wim Looman
0e1bd1c926 Add tests for issue 2016-02-03 12:01:32 +01:00
Wim Looman
bd0b135a0d Replace # -> @ and remove from else 2016-02-03 12:01:31 +01:00
Wim Looman
b1680636cf Add a shorthand syntax to define element classes 2016-02-02 16:20:11 +01:00
Wim Looman
831df66cdb Add tests for issue 2016-02-02 16:00:14 +01:00
Wim Looman
6c8fbb5bad Change splice operator and add in render by-move 2016-02-02 15:56:59 +01:00
Chris Wong
0440f5c74f Merge pull request from Nemo157/path-in-splice
Allow path lookups in un-delimited splices
2016-02-02 21:30:48 +11:00
Wim Looman
6b0b7a00d7 Allow path lookups in un-delimited splices 2016-02-01 18:18:10 +01:00
Wim Looman
6858108f9c Allow tuple attribute lookups 2016-02-01 18:03:50 +01:00
Chris Wong
34f14dd41d Don't choke on SubstNt tokens
Closes 
2015-11-05 21:46:43 +13:00
Chris Wong
2e0aa3e433 Replace $$ syntax with a general trait thing 2015-10-06 19:25:29 +13:00
Chris Wong
cf0cf095c2 Revert "Add #call_box instruction"
This reverts commit 0311bab45b.
2015-09-26 13:56:52 +12:00
Chris Wong
0311bab45b Add #call_box instruction 2015-09-24 11:50:33 +12:00
Chris Wong
7d124e616e Add #call instruction 2015-09-23 14:29:45 +12:00
Chris Wong
b50a3be6f6 Handle hyphens in attribute and element names
Closes 
2015-09-15 17:51:27 +12:00
Chris Wong
6030eed9f7 Rename write_html! to html_utf8!
The new name makes it clear what the macro is doing: encoding the output
to UTF-8.
2015-09-12 14:21:01 +12:00
Chris Wong
37835b3b24 Rename $if and $for to #if and #for
`#if` and `#for` aren't splices. They are a different concept, so should
have different syntax as well.
2015-09-12 13:53:14 +12:00
Chris Wong
ebbd5d2e54 Add a write_html! macro
This handles the common case of wrapping the stream in a `Utf8Writer`.
2015-09-07 19:46:06 +12:00
Chris Wong
cdcacab1ea Add Utf8Writer 2015-09-06 12:59:41 +12:00
Chris Wong
28b1624f4c Rename write_html! to html!
It's more concise
2015-09-03 11:06:05 +12:00
Chris Wong
1badbd9df2 De-closureify the API
Closes 
2015-09-01 18:26:50 +12:00