Commit Graph

64 Commits

Author SHA1 Message Date
Adam Fowler
c21651ce50 method -> transform 2021-03-22 12:11:22 +00:00
Adam Fowler
35d52603e2 Template inheritance (#9)
* Move all context variables into HBMustacheContext

* Add support for reading inherited sections

* Render inherited tokens

* Test inheritance spec, fix two minor issues

* fix warning

* swift format
2021-03-22 12:02:22 +00:00
Adam Fowler
af345e9138 Link FoundationNetworking on Linux 2021-03-22 11:46:04 +00:00
Adam Fowler
c4f8aea756 Use mustache spec json files for tests (#10)
* swift format

* Use json files for mustache/spec repo for testing spec

* Add option to ignore certain tests

* Clean up error messages, swift format

* more swift format
2021-03-22 11:41:52 +00:00
Adam Fowler
ef4f016863 Update README.md 2021-03-22 07:55:30 +00:00
Adam Fowler
fb849f063d Minor update from project-template 2021-03-21 18:57:24 +00:00
Adam Fowler
a08b1e8087 Swift format, swift 5.3 2021-03-21 11:56:08 +00:00
Adam Fowler
3c50d1c15c comments 2021-03-19 17:49:02 +00:00
Adam Fowler
66cbb25e16 Readme updates (#7)
* Add Additional features to readme

* Edits

* Update README.md
2021-03-19 15:08:57 +00:00
Adam Fowler
f9f8c1320a Renaming
HBMustacheMethods -> HBMustacheTransformable
HBMustacheContext -> HBMustacheSequenceContext
2021-03-19 14:48:44 +00:00
Adam Fowler
09f5c5953e Update README.md 2021-03-18 17:38:19 +00:00
Adam Fowler
05740bd7bc Replace raw UTF8 parser with String parser (#6)
* Replace UTF8 parser with String based one

* swift format

* Add parsing errors that include context about where error is

* Remove old error tests
2021-03-18 17:26:42 +00:00
Adam Fowler
a602593b5d Remove Logging imports 2021-03-18 16:29:23 +00:00
Adam Fowler
0ff5038162 End sections includes method 2021-03-18 15:33:47 +00:00
Adam Fowler
aa30dcbddf Don't log files that dont load throw error instead
remove swift-log dependency
2021-03-18 15:25:46 +00:00
Adam Fowler
4af21bb4cf Fix issue where parser return bad sub parsers if you reach end of text 2021-03-18 15:25:00 +00:00
Adam Fowler
b637c4c4a4 Tidy standalone processing 2021-03-18 12:58:48 +00:00
Adam Fowler
751126d729 Add support for Set Delimiters (#5)
* Added ParserState

* Add support for setting delimiters

* Add spec tests for setting delimiters

* swift format
2021-03-18 12:43:36 +00:00
Adam Fowler
66e9b23c47 Merge pull request #4 from hummingbird-project/mustache-spec
Conform to Mustache spec
2021-03-18 11:09:50 +00:00
Adam Fowler
9b17bd6827 Render optimisation 2021-03-18 10:55:55 +00:00
Adam Fowler
c560bd0fd9 swift format 2021-03-18 10:34:52 +00:00
Adam Fowler
16a2c54be6 Added sections tests. Allow for searching of context stack 2021-03-18 10:32:42 +00:00
Adam Fowler
b07ad42b49 Started section spec tests 2021-03-17 22:33:30 +00:00
Adam Fowler
169a7bbbf4 Added SpecPartialsTests and fixed issues 2021-03-17 18:30:55 +00:00
Adam Fowler
b4d6a518c7 Fixed all issues found in spec so far
parse has got quite complex might look to simplify
2021-03-17 17:02:59 +00:00
Adam Fowler
753079fa9d Add inverted tests 2021-03-16 17:16:51 +00:00
Adam Fowler
9ddc49b7bc Add interpolation tests, start inverted 2021-03-15 20:35:05 +00:00
Adam Fowler
2d96ca34d8 Add fix for ampersand 2021-03-15 20:34:48 +00:00
Adam Fowler
a76a02a8dc Add Comment spec 2021-03-15 18:57:55 +00:00
Adam Fowler
b1b65525e8 Make Template and Library final class 2021-03-15 18:37:54 +00:00
Adam Fowler
66edcba185 swift format 2021-03-15 18:24:06 +00:00
Adam Fowler
955e1eb9e4 Updates from project template 2021-03-15 18:22:41 +00:00
Adam Fowler
e0d7e364e8 Use ' instead of ' as the latter isnt in the HTML4 standard 2021-03-15 17:28:22 +00:00
Adam Fowler
d601a29e35 Add quote, apostrophe to list of chars to html escape 2021-03-15 16:40:37 +00:00
Adam Fowler
03cfa42c02 Add swift-log so we can log loading errors 2021-03-15 16:08:10 +00:00
Adam Fowler
5a2f22df4f Update README.md 2021-03-15 15:24:37 +00:00
Adam Fowler
876f3c99f5 Update README.md 2021-03-15 15:24:03 +00:00
Adam Fowler
5dd3ab2af1 render(_, withTemplateNamed) -> render(_, withTemplate) 2021-03-15 15:18:50 +00:00
Adam Fowler
e391f5ae05 Comments 2021-03-15 15:09:16 +00:00
Adam Fowler
978b14a96a Wrap Lambda function in a struct to avoid crash in Mirror 2021-03-15 14:46:40 +00:00
Adam Fowler
3559faac61 Rectify HBMustacheContext methods odd and even 2021-03-15 14:33:28 +00:00
Adam Fowler
e2cfbb7acc Make runMethod calls public, add some comments 2021-03-15 14:27:32 +00:00
Adam Fowler
e0a0b3fe8e Extend String methods to Substring 2021-03-15 11:07:08 +00:00
Adam Fowler
adb3401398 Extend Int methods to all Integer types 2021-03-15 11:00:43 +00:00
Adam Fowler
958fb97775 Added first/last to array, minusone to Int 2021-03-15 10:57:37 +00:00
Adam Fowler
0f2c3bcea9 Added sorted methods 2021-03-15 10:53:33 +00:00
Adam Fowler
465ad49f1f Add index filter 2021-03-14 17:53:20 +00:00
Adam Fowler
33b488fe40 Add support for first/last functions 2021-03-14 12:47:00 +00:00
Adam Fowler
5f49dd6953 Moving stuff about/renaming 2021-03-14 10:19:51 +00:00
Adam Fowler
06251739d7 Keep pointer to Library in template 2021-03-14 08:51:16 +00:00