guard-mthaml 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +34 -0
- data/lib/guard/mthaml.rb +140 -0
- data/lib/guard/mthaml/compiler/MtHaml.php +255 -0
- data/lib/guard/mthaml/templates/Guardfile +12 -0
- data/lib/guard/mthaml/version.rb +5 -0
- data/vendor/autoload.php +7 -0
- data/vendor/coffeescript/coffeescript/LICENSE +22 -0
- data/vendor/coffeescript/coffeescript/README.md +96 -0
- data/vendor/coffeescript/coffeescript/composer.json +23 -0
- data/vendor/coffeescript/coffeescript/grammar.y +309 -0
- data/vendor/coffeescript/coffeescript/make.php +115 -0
- data/vendor/coffeescript/coffeescript/src/CoffeeScript/Compiler.php +76 -0
- data/vendor/coffeescript/coffeescript/src/CoffeeScript/Error.php +15 -0
- data/vendor/coffeescript/coffeescript/src/CoffeeScript/Helpers.php +116 -0
- data/vendor/coffeescript/coffeescript/src/CoffeeScript/Init.php +96 -0
- data/vendor/coffeescript/coffeescript/src/CoffeeScript/Lexer.php +1356 -0
- data/vendor/coffeescript/coffeescript/src/CoffeeScript/Nodes.php +105 -0
- data/vendor/coffeescript/coffeescript/src/CoffeeScript/Parser.php +3326 -0
- data/vendor/coffeescript/coffeescript/src/CoffeeScript/Rewriter.php +552 -0
- data/vendor/coffeescript/coffeescript/src/CoffeeScript/Scope.php +196 -0
- data/vendor/coffeescript/coffeescript/src/CoffeeScript/SyntaxError.php +9 -0
- data/vendor/coffeescript/coffeescript/src/CoffeeScript/Value.php +20 -0
- data/vendor/coffeescript/coffeescript/src/CoffeeScript/yy/Access.php +31 -0
- data/vendor/coffeescript/coffeescript/src/CoffeeScript/yy/Arr.php +69 -0
- data/vendor/coffeescript/coffeescript/src/CoffeeScript/yy/Assign.php +353 -0
- data/vendor/coffeescript/coffeescript/src/CoffeeScript/yy/Base.php +288 -0
- data/vendor/coffeescript/coffeescript/src/CoffeeScript/yy/Block.php +294 -0
- data/vendor/coffeescript/coffeescript/src/CoffeeScript/yy/Call.php +283 -0
- data/vendor/coffeescript/coffeescript/src/CoffeeScript/yy/Class.php +282 -0
- data/vendor/coffeescript/coffeescript/src/CoffeeScript/yy/Closure.php +49 -0
- data/vendor/coffeescript/coffeescript/src/CoffeeScript/yy/Code.php +203 -0
- data/vendor/coffeescript/coffeescript/src/CoffeeScript/yy/Comment.php +39 -0
- data/vendor/coffeescript/coffeescript/src/CoffeeScript/yy/Existence.php +42 -0
- data/vendor/coffeescript/coffeescript/src/CoffeeScript/yy/Extends.php +26 -0
- data/vendor/coffeescript/coffeescript/src/CoffeeScript/yy/For.php +250 -0
- data/vendor/coffeescript/coffeescript/src/CoffeeScript/yy/If.php +161 -0
- data/vendor/coffeescript/coffeescript/src/CoffeeScript/yy/In.php +99 -0
- data/vendor/coffeescript/coffeescript/src/CoffeeScript/yy/Index.php +27 -0
- data/vendor/coffeescript/coffeescript/src/CoffeeScript/yy/Literal.php +96 -0
- data/vendor/coffeescript/coffeescript/src/CoffeeScript/yy/Obj.php +126 -0
- data/vendor/coffeescript/coffeescript/src/CoffeeScript/yy/Op.php +292 -0
- data/vendor/coffeescript/coffeescript/src/CoffeeScript/yy/Param.php +119 -0
- data/vendor/coffeescript/coffeescript/src/CoffeeScript/yy/Parens.php +45 -0
- data/vendor/coffeescript/coffeescript/src/CoffeeScript/yy/Range.php +225 -0
- data/vendor/coffeescript/coffeescript/src/CoffeeScript/yy/Return.php +56 -0
- data/vendor/coffeescript/coffeescript/src/CoffeeScript/yy/Slice.php +47 -0
- data/vendor/coffeescript/coffeescript/src/CoffeeScript/yy/Splat.php +100 -0
- data/vendor/coffeescript/coffeescript/src/CoffeeScript/yy/Switch.php +121 -0
- data/vendor/coffeescript/coffeescript/src/CoffeeScript/yy/Throw.php +37 -0
- data/vendor/coffeescript/coffeescript/src/CoffeeScript/yy/Try.php +79 -0
- data/vendor/coffeescript/coffeescript/src/CoffeeScript/yy/Value.php +210 -0
- data/vendor/coffeescript/coffeescript/src/CoffeeScript/yy/While.php +112 -0
- data/vendor/coffeescript/coffeescript/tests/cases/arrays.coffee +77 -0
- data/vendor/coffeescript/coffeescript/tests/cases/assignment.coffee +352 -0
- data/vendor/coffeescript/coffeescript/tests/cases/booleans.coffee +21 -0
- data/vendor/coffeescript/coffeescript/tests/cases/classes.coffee +681 -0
- data/vendor/coffeescript/coffeescript/tests/cases/comments.coffee +207 -0
- data/vendor/coffeescript/coffeescript/tests/cases/compilation.coffee +72 -0
- data/vendor/coffeescript/coffeescript/tests/cases/comprehensions.coffee +501 -0
- data/vendor/coffeescript/coffeescript/tests/cases/control_flow.coffee +430 -0
- data/vendor/coffeescript/coffeescript/tests/cases/eval.coffee +29 -0
- data/vendor/coffeescript/coffeescript/tests/cases/exception_handling.coffee +102 -0
- data/vendor/coffeescript/coffeescript/tests/cases/formatting.coffee +146 -0
- data/vendor/coffeescript/coffeescript/tests/cases/function_invocation.coffee +552 -0
- data/vendor/coffeescript/coffeescript/tests/cases/functions.coffee +188 -0
- data/vendor/coffeescript/coffeescript/tests/cases/helpers.coffee +96 -0
- data/vendor/coffeescript/coffeescript/tests/cases/importing.coffee +18 -0
- data/vendor/coffeescript/coffeescript/tests/cases/interpolation.coffee +138 -0
- data/vendor/coffeescript/coffeescript/tests/cases/javascript_literals.coffee +10 -0
- data/vendor/coffeescript/coffeescript/tests/cases/numbers.coffee +76 -0
- data/vendor/coffeescript/coffeescript/tests/cases/objects.coffee +271 -0
- data/vendor/coffeescript/coffeescript/tests/cases/operators.coffee +277 -0
- data/vendor/coffeescript/coffeescript/tests/cases/option_parser.coffee +43 -0
- data/vendor/coffeescript/coffeescript/tests/cases/ranges.coffee +88 -0
- data/vendor/coffeescript/coffeescript/tests/cases/regexps.coffee +63 -0
- data/vendor/coffeescript/coffeescript/tests/cases/scope.coffee +43 -0
- data/vendor/coffeescript/coffeescript/tests/cases/slicing_and_splicing.coffee +143 -0
- data/vendor/coffeescript/coffeescript/tests/cases/soaks.coffee +134 -0
- data/vendor/coffeescript/coffeescript/tests/cases/strict.coffee +155 -0
- data/vendor/coffeescript/coffeescript/tests/cases/strings.coffee +107 -0
- data/vendor/coffeescript/coffeescript/tests/css/style.css +43 -0
- data/vendor/coffeescript/coffeescript/tests/index.php +119 -0
- data/vendor/coffeescript/coffeescript/tests/js/lib/coffeescript_1.1.1.js +8 -0
- data/vendor/coffeescript/coffeescript/tests/js/lib/coffeescript_1.2.0.js +8 -0
- data/vendor/coffeescript/coffeescript/tests/js/lib/coffeescript_1.3.0.js +8 -0
- data/vendor/coffeescript/coffeescript/tests/js/lib/coffeescript_1.3.1.js +8 -0
- data/vendor/coffeescript/coffeescript/tests/js/lib/diff.js +276 -0
- data/vendor/coffeescript/coffeescript/tests/js/main.js +123 -0
- data/vendor/coffeescript/coffeescript/vendor/ParserGenerator/LICENSE.txt +10 -0
- data/vendor/coffeescript/coffeescript/vendor/ParserGenerator/PHP/Lempar.php +948 -0
- data/vendor/coffeescript/coffeescript/vendor/ParserGenerator/PHP/ParserGenerator/Action.php +257 -0
- data/vendor/coffeescript/coffeescript/vendor/ParserGenerator/PHP/ParserGenerator/ActionTable.php +299 -0
- data/vendor/coffeescript/coffeescript/vendor/ParserGenerator/PHP/ParserGenerator/Config.php +574 -0
- data/vendor/coffeescript/coffeescript/vendor/ParserGenerator/PHP/ParserGenerator/Data.php +1857 -0
- data/vendor/coffeescript/coffeescript/vendor/ParserGenerator/PHP/ParserGenerator/Parser.php +851 -0
- data/vendor/coffeescript/coffeescript/vendor/ParserGenerator/PHP/ParserGenerator/PropagationLink.php +126 -0
- data/vendor/coffeescript/coffeescript/vendor/ParserGenerator/PHP/ParserGenerator/Rule.php +144 -0
- data/vendor/coffeescript/coffeescript/vendor/ParserGenerator/PHP/ParserGenerator/State.php +283 -0
- data/vendor/coffeescript/coffeescript/vendor/ParserGenerator/PHP/ParserGenerator/Symbol.php +288 -0
- data/vendor/coffeescript/coffeescript/vendor/ParserGenerator/PHP/ParserGenerator/cli.php +5 -0
- data/vendor/coffeescript/coffeescript/vendor/ParserGenerator/ParserGenerator.php +811 -0
- data/vendor/composer/ClassLoader.php +383 -0
- data/vendor/composer/autoload_classmap.php +9 -0
- data/vendor/composer/autoload_namespaces.php +12 -0
- data/vendor/composer/autoload_psr4.php +10 -0
- data/vendor/composer/autoload_real.php +50 -0
- data/vendor/composer/installed.json +166 -0
- data/vendor/michelf/php-markdown/License.md +36 -0
- data/vendor/michelf/php-markdown/Michelf/Markdown.inc.php +10 -0
- data/vendor/michelf/php-markdown/Michelf/Markdown.php +3117 -0
- data/vendor/michelf/php-markdown/Michelf/MarkdownExtra.inc.php +11 -0
- data/vendor/michelf/php-markdown/Michelf/MarkdownExtra.php +38 -0
- data/vendor/michelf/php-markdown/Michelf/MarkdownInterface.inc.php +9 -0
- data/vendor/michelf/php-markdown/Michelf/MarkdownInterface.php +37 -0
- data/vendor/michelf/php-markdown/Readme.md +305 -0
- data/vendor/michelf/php-markdown/Readme.php +31 -0
- data/vendor/michelf/php-markdown/composer.json +31 -0
- data/vendor/mthaml/mthaml/CHANGELOG +48 -0
- data/vendor/mthaml/mthaml/LICENSE +44 -0
- data/vendor/mthaml/mthaml/README.markdown +262 -0
- data/vendor/mthaml/mthaml/composer.json +45 -0
- data/vendor/mthaml/mthaml/docs/Makefile +153 -0
- data/vendor/mthaml/mthaml/docs/_static/mthaml.css +30 -0
- data/vendor/mthaml/mthaml/docs/_theme/mthaml/theme.conf +4 -0
- data/vendor/mthaml/mthaml/docs/conf.py +242 -0
- data/vendor/mthaml/mthaml/docs/index.rst +18 -0
- data/vendor/mthaml/mthaml/docs/twig-syntax.rst +274 -0
- data/vendor/mthaml/mthaml/examples/README.md +5 -0
- data/vendor/mthaml/mthaml/examples/autoload.php +8 -0
- data/vendor/mthaml/mthaml/examples/example-php.haml +5 -0
- data/vendor/mthaml/mthaml/examples/example-php.php +37 -0
- data/vendor/mthaml/mthaml/examples/example-twig-noext.twig +11 -0
- data/vendor/mthaml/mthaml/examples/example-twig.haml +9 -0
- data/vendor/mthaml/mthaml/examples/example-twig.php +60 -0
- data/vendor/mthaml/mthaml/examples/example.twig.haml +8 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Autoloader.php +22 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Environment.php +178 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Escaping.php +33 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Exception.php +9 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Exception/SyntaxErrorException.php +9 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Filter/AbstractFilter.php +43 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Filter/Cdata.php +16 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Filter/CoffeeScript.php +33 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Filter/Css.php +26 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Filter/Escaped.php +22 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Filter/FilterInterface.php +15 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Filter/Javascript.php +26 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Filter/Less.php +27 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Filter/Less/LeafoLess.php +20 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Filter/Less/OyejorgeLess.php +23 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Filter/Markdown.php +58 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Filter/Markdown/CebeMarkdown.php +22 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Filter/Markdown/Ciconia.php +21 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Filter/Markdown/MichelfMarkdown.php +21 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Filter/Markdown/Parsedown.php +21 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Filter/Php.php +37 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Filter/Plain.php +24 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Filter/Preserve.php +19 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Filter/Scss.php +37 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Filter/Twig.php +47 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Indentation/Indentation.php +96 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Indentation/IndentationException.php +9 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Indentation/IndentationInterface.php +50 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Indentation/Undefined.php +41 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Node/Comment.php +71 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Node/Doctype.php +96 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Node/EscapableAbstract.php +19 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Node/Filter.php +51 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Node/Insert.php +42 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Node/InterpolatedString.php +73 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Node/NestAbstract.php +117 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Node/NestInterface.php +10 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Node/NodeAbstract.php +77 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Node/ObjectRefClass.php +42 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Node/ObjectRefId.php +42 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Node/Root.php +35 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Node/Run.php +71 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Node/Statement.php +45 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Node/Tag.php +90 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Node/TagAttribute.php +62 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Node/TagAttributeInterpolation.php +24 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Node/TagAttributeList.php +24 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Node/Text.php +37 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/NodeVisitor/Autoclose.php +25 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/NodeVisitor/Escaping.php +105 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/NodeVisitor/MergeAttrs.php +110 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/NodeVisitor/Midblock.php +37 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/NodeVisitor/NodeVisitorAbstract.php +226 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/NodeVisitor/NodeVisitorInterface.php +97 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/NodeVisitor/PhpRenderer.php +288 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/NodeVisitor/Printer.php +265 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/NodeVisitor/RendererAbstract.php +581 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/NodeVisitor/TwigRenderer.php +252 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Parser.php +862 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Parser/Buffer.php +147 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Runtime.php +218 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Runtime/AttributeInterpolation.php +16 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Runtime/AttributeList.php +16 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Support/Php/Executor.php +157 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Support/Twig/Extension.php +47 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Support/Twig/Lexer.php +48 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Support/Twig/Loader.php +81 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Target/Php.php +23 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Target/TargetAbstract.php +87 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Target/TargetInterface.php +12 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Target/Twig.php +23 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/TreeBuilder.php +100 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/TreeBuilderException.php +9 -0
- data/vendor/mthaml/mthaml/phpunit.xml +25 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/EnvironmentTest.php +59 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/HamlSpecTest.php +83 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/IndentationTest.php +140 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/Node/DoctypeTest.php +51 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/Node/NodeTest.php +110 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/NodeVisitor/PhpRendererTest.php +113 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/NodeVisitor/TwigRendererTest.php +68 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/NodeVisitorsTest.php +44 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/Parser/BufferTest.php +77 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/ParserTest.php +47 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/RuntimeTest.php +356 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/Support/Php/ExecutorTest.php +83 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/Support/Twig/LoaderTest.php +65 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/TestCase.php +49 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/TestCaseTest.php +50 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/Support/Php/Executor.001.haml +1 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/attr_list_php.test +20 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/attr_list_twig.test +12 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/boolean_attr_php.test +16 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/boolean_attr_twig.test +16 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/bug28_php.test +15 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/bug28_twig.test +15 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/bug42.test +13 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/bug8_twig.test +10 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/coffeescript_filter.test +31 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/comments.test +26 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/cond_cmt.test +25 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/doctype.test +18 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/doctype_html4.test +20 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/doctype_invalid.test +12 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/doctype_invalid_xhtml.test +12 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/doctype_php.test +18 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/doctype_xhtml.test +30 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/filters.test +51 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/insert_non_echo_php.test +11 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/insert_non_echo_twig.test +11 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/interpolation_in_html_attrs_php.test +31 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/interpolation_in_html_attrs_twig.test +31 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/less_filter_leafo.test +33 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/less_filter_oyejorge.test +49 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/markdown_filter_cebemarkdown.test +35 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/markdown_filter_ciconia.test +36 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/markdown_filter_michelf.test +34 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/markdown_filter_parsedown.test +31 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/markdown_optimization_filter_michelf.test +23 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/mergeattrs.test +18 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/nuke_inner_whitespace.test +77 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/nuke_outer_whitespace.test +122 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/object_ref_php.test +14 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/object_ref_twig.test +14 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/php.test +109 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/php_autoescaping.test +22 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/php_autoescaping_once.test +25 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/php_blocks.test +29 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/php_filters.test +42 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/scss_filter.test +32 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/strip_inline_comments_php.test +22 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/test.test +24 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/trailing_semicolon_php.test +14 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/try_catch_php.test +17 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/twig.test +112 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/twig_blocks.test +29 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/twig_filters.test +37 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/twig_whitespace.test +32 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/whitespace.test +63 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/nodevisitors/autoclose.test +30 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/nodevisitors/escaping.test +52 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/nodevisitors/escaping_attr_once.test +52 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/nodevisitors/escaping_html_false.test +52 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/nodevisitors/mergeattrs.test +26 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/nodevisitors/midblock.test +54 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/nodevisitors/midblock_002.test +32 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/attr_list.test +14 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/attrs.test +42 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/attrs_002.test +35 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/attrs_003.test +30 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/attrs_html_linebreak.test +17 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/blocks.test +27 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/blocks_002.test +15 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/boolean_attr.test +19 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/bug28.test +15 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/bug8.test +11 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/cond_cmt.test +23 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/doctype.test +11 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/double_equal.test +7 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/empty_line_after_multiline.test +10 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/errors_001.test +8 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/errors_002.test +8 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/errors_003.test +8 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/errors_004.test +6 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/errors_005.test +5 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/errors_006.test +7 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/errors_007.test +7 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/errors_008.test +7 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/errors_009.test +5 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/errors_010.test +5 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/errors_013.test +5 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/errors_016.test +7 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/errors_017.test +8 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/errors_018.test +6 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/errors_019.test +6 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/errors_020.test +5 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/filters.test +20 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/filters_002.test +19 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/filters_003.test +13 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/filters_004.test +21 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/filters_005.test +22 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/filters_006.test +23 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/insertflags.test +17 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/interpolation.test +36 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/interpolation_in_html_attrs.test +17 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/multiline.test +18 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/multiline_code.test +59 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/multiple_attr_kinds.test +47 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/non_rendered_comment.test +31 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/ns.test +11 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/object_ref.test +22 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/object_ref_error1.test +5 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/object_ref_error2.test +5 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/quotes_in_haml.test +10 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/ruby19_attrs.test +11 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/ruby_attrs_comma.test +23 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/ruby_attrs_comma_errors_001.test +5 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/ruby_attrs_comma_errors_002.test +5 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/ruby_attrs_comma_errors_003.test +5 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/standard.test +114 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/tagflags.test +39 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/runtime/php_filters.test +28 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/runtime/twig_filters.test +31 -0
- data/vendor/mthaml/mthaml/test/bootstrap.php +3 -0
- metadata +398 -0
@@ -0,0 +1,22 @@
|
|
1
|
+
--FILE--
|
2
|
+
<?php
|
3
|
+
$env = new MtHaml\Environment('php', array('enable_escaper' => true));
|
4
|
+
echo $env->compileString($parts['HAML'], "$file.haml");
|
5
|
+
--HAML--
|
6
|
+
%html
|
7
|
+
%body{:some=> "attr& #{$foo}"}
|
8
|
+
%p{"#{$foo}" => "foo"}(z=$x)
|
9
|
+
= "escaped"
|
10
|
+
&= "escaped"
|
11
|
+
!= "not escaped"
|
12
|
+
--EXPECT--
|
13
|
+
<html>
|
14
|
+
<body <?php echo MtHaml\Runtime::renderAttributes(array(array('some', ('attr& ' . $foo))), 'html5', 'UTF-8'); ?>>
|
15
|
+
<p <?php echo MtHaml\Runtime::renderAttributes(array(array($foo, 'foo'), array('z', $x)), 'html5', 'UTF-8'); ?>>
|
16
|
+
<?php echo htmlspecialchars("escaped",ENT_QUOTES,'UTF-8'); ?>
|
17
|
+
<?php echo htmlspecialchars("escaped",ENT_QUOTES,'UTF-8'); ?>
|
18
|
+
<?php echo "not escaped"; ?>
|
19
|
+
</p>
|
20
|
+
</body>
|
21
|
+
</html>
|
22
|
+
|
@@ -0,0 +1,25 @@
|
|
1
|
+
--FILE--
|
2
|
+
<?php
|
3
|
+
$env = new MtHaml\Environment('php', array(
|
4
|
+
'enable_escaper' => true,
|
5
|
+
'escape_attrs' => 'once',
|
6
|
+
));
|
7
|
+
echo $env->compileString($parts['HAML'], "$file.haml");
|
8
|
+
--HAML--
|
9
|
+
%html
|
10
|
+
%body{:some=> "attr& #{$foo}"}
|
11
|
+
%p{"#{$foo}" => "foo"}(z=$x)
|
12
|
+
= "escaped"
|
13
|
+
&= "escaped"
|
14
|
+
!= "not escaped"
|
15
|
+
--EXPECT--
|
16
|
+
<html>
|
17
|
+
<body <?php echo MtHaml\Runtime::renderAttributes(array(array('some', ('attr& ' . $foo))), 'html5', 'UTF-8'); ?>>
|
18
|
+
<p <?php echo MtHaml\Runtime::renderAttributes(array(array($foo, 'foo'), array('z', $x)), 'html5', 'UTF-8'); ?>>
|
19
|
+
<?php echo htmlspecialchars("escaped",ENT_QUOTES,'UTF-8'); ?>
|
20
|
+
<?php echo htmlspecialchars("escaped",ENT_QUOTES,'UTF-8'); ?>
|
21
|
+
<?php echo "not escaped"; ?>
|
22
|
+
</p>
|
23
|
+
</body>
|
24
|
+
</html>
|
25
|
+
|
@@ -0,0 +1,29 @@
|
|
1
|
+
--HAML--
|
2
|
+
- if ($a)
|
3
|
+
%ul
|
4
|
+
- foreach($items as $item)
|
5
|
+
%li
|
6
|
+
= $item
|
7
|
+
= $foo
|
8
|
+
- else
|
9
|
+
no item
|
10
|
+
|
11
|
+
--FILE--
|
12
|
+
<?php
|
13
|
+
$env = new MtHaml\Environment('php', array('enable_escaper' => false));
|
14
|
+
echo $env->compileString($parts['HAML'], "$file.haml");
|
15
|
+
|
16
|
+
--EXPECT--
|
17
|
+
<?php if ($a) { ?>
|
18
|
+
<ul>
|
19
|
+
<?php foreach($items as $item) { ?>
|
20
|
+
<li>
|
21
|
+
<?php echo $item; ?>
|
22
|
+
</li>
|
23
|
+
<?php } ?>
|
24
|
+
</ul>
|
25
|
+
<?php echo $foo; ?>
|
26
|
+
<?php } else { ?>
|
27
|
+
no item
|
28
|
+
<?php } ?>
|
29
|
+
|
@@ -0,0 +1,42 @@
|
|
1
|
+
--FILE--
|
2
|
+
<?php
|
3
|
+
$env = new MtHaml\Environment('php', array('enable_escaper' => false, 'mthaml_variable' => '$mthaml'));
|
4
|
+
echo $env->compileString($parts['HAML'], "$file.haml");
|
5
|
+
|
6
|
+
--HAML--
|
7
|
+
#php
|
8
|
+
:php
|
9
|
+
echo $a;
|
10
|
+
:php
|
11
|
+
foreach (array(#{var_export(foo, true)}) as $item) {
|
12
|
+
}
|
13
|
+
#twig
|
14
|
+
:twig
|
15
|
+
{{ foo|filter }}
|
16
|
+
{% for i in 1..5 %}
|
17
|
+
{{ "- \#{i}" }}
|
18
|
+
{% endfor %}
|
19
|
+
:twig
|
20
|
+
{{ #{$foo}|filter }}
|
21
|
+
--EXPECT--
|
22
|
+
<div id="php">
|
23
|
+
<?php
|
24
|
+
echo $a;
|
25
|
+
?>
|
26
|
+
<?php echo MtHaml\Runtime::filter($mthaml, 'php', get_defined_vars(),
|
27
|
+
('foreach (array(' . (var_export(foo, true)) . ') as $item) {'). "\n" .
|
28
|
+
'}'. "\n"
|
29
|
+
) ?>
|
30
|
+
</div>
|
31
|
+
<div id="twig">
|
32
|
+
<?php echo MtHaml\Runtime::filter($mthaml, 'twig', get_defined_vars(),
|
33
|
+
'{{ foo|filter }}'. "\n" .
|
34
|
+
'{% for i in 1..5 %}'. "\n" .
|
35
|
+
' {{ "- #{i}" }}'. "\n" .
|
36
|
+
'{% endfor %}'. "\n"
|
37
|
+
) ?>
|
38
|
+
<?php echo MtHaml\Runtime::filter($mthaml, 'twig', get_defined_vars(),
|
39
|
+
('{{ ' . $foo . '|filter }}'). "\n"
|
40
|
+
) ?>
|
41
|
+
</div>
|
42
|
+
|
@@ -0,0 +1,32 @@
|
|
1
|
+
--FILE--
|
2
|
+
<?php
|
3
|
+
$filter = new MtHaml\Filter\Scss(new scssc);
|
4
|
+
$env = new MtHaml\Environment('twig', array('enable_escaper' => false), array('scss' => $filter));
|
5
|
+
echo $env->compileString($parts['HAML'], "$file.haml");
|
6
|
+
|
7
|
+
--HAML--
|
8
|
+
:scss
|
9
|
+
@mixin color ($color) {
|
10
|
+
color: $color;
|
11
|
+
}
|
12
|
+
|
13
|
+
p {
|
14
|
+
@include color(blue);
|
15
|
+
}
|
16
|
+
:scss
|
17
|
+
p.#{class} {
|
18
|
+
text-align: left;
|
19
|
+
}
|
20
|
+
--EXPECT--
|
21
|
+
<style type="text/css">
|
22
|
+
/*<![CDATA[*/
|
23
|
+
p {
|
24
|
+
color: blue; }
|
25
|
+
|
26
|
+
/*]]>*/
|
27
|
+
</style>
|
28
|
+
{% filter mthaml_scss %}p.{% line 10 %}{{ class }} {
|
29
|
+
text-align: left;
|
30
|
+
}
|
31
|
+
{% endfilter %}
|
32
|
+
|
data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/strip_inline_comments_php.test
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
--FILE--
|
2
|
+
<?php
|
3
|
+
$env = new MtHaml\Environment('php', array('enable_escaper' => false));
|
4
|
+
echo $env->compileString($parts['HAML'], "$file.haml");
|
5
|
+
|
6
|
+
--HAML--
|
7
|
+
= 1 + 2 # comment
|
8
|
+
= 1 + 2 // comment
|
9
|
+
- if ($foo) # comment
|
10
|
+
.
|
11
|
+
- else // comment
|
12
|
+
.
|
13
|
+
|
14
|
+
--EXPECT--
|
15
|
+
<?php echo 1 + 2; ?>
|
16
|
+
<?php echo 1 + 2; ?>
|
17
|
+
<?php if ($foo) { ?>
|
18
|
+
.
|
19
|
+
<?php } else { ?>
|
20
|
+
.
|
21
|
+
<?php } ?>
|
22
|
+
|
@@ -0,0 +1,24 @@
|
|
1
|
+
--FILE--
|
2
|
+
<?php
|
3
|
+
$env = new MtHaml\Environment('twig', array('enable_escaper' => false));
|
4
|
+
echo $env->compileString($parts['HAML'], "$file.haml");
|
5
|
+
--HAML--
|
6
|
+
- if a
|
7
|
+
= b
|
8
|
+
- elseif c
|
9
|
+
- for d in e
|
10
|
+
- if f
|
11
|
+
= d
|
12
|
+
= g
|
13
|
+
--EXPECT--
|
14
|
+
{% if a %}
|
15
|
+
{{ b }}
|
16
|
+
{% elseif c %}
|
17
|
+
{% for d in e %}
|
18
|
+
{% if f %}
|
19
|
+
{{ d }}
|
20
|
+
{% endif %}
|
21
|
+
{% endfor %}
|
22
|
+
{% endif %}
|
23
|
+
{% line 7 %}{{ g }}
|
24
|
+
|
@@ -0,0 +1,14 @@
|
|
1
|
+
--FILE--
|
2
|
+
<?php
|
3
|
+
$env = new MtHaml\Environment('php', array('enable_escaper' => false));
|
4
|
+
echo $env->compileString($parts['HAML'], "$file.haml");
|
5
|
+
|
6
|
+
--HAML--
|
7
|
+
- foo()
|
8
|
+
- foo();
|
9
|
+
- case "foo":
|
10
|
+
--EXPECT--
|
11
|
+
<?php foo(); ?>
|
12
|
+
<?php foo(); ?>
|
13
|
+
<?php case "foo": ?>
|
14
|
+
|
@@ -0,0 +1,17 @@
|
|
1
|
+
--HAML--
|
2
|
+
- try
|
3
|
+
= foo()
|
4
|
+
- catch(\Exception $e)
|
5
|
+
bar
|
6
|
+
--FILE--
|
7
|
+
<?php
|
8
|
+
$env = new MtHaml\Environment('php', array('enable_escaper' => false));
|
9
|
+
echo $env->compileString($parts['HAML'], "$file.haml");
|
10
|
+
|
11
|
+
--EXPECT--
|
12
|
+
<?php try { ?>
|
13
|
+
<?php echo foo(); ?>
|
14
|
+
<?php } catch(\Exception $e) { ?>
|
15
|
+
bar
|
16
|
+
<?php } ?>
|
17
|
+
|
@@ -0,0 +1,112 @@
|
|
1
|
+
--FILE--
|
2
|
+
<?php
|
3
|
+
$env = new MtHaml\Environment('twig', array('enable_escaper' => false));
|
4
|
+
echo $env->compileString($parts['HAML'], "$file.haml");
|
5
|
+
|
6
|
+
--HAML--
|
7
|
+
!!!
|
8
|
+
%html{:xmlns => "http://www.w3.org/1999/xhtml", "xml:lang" => "en-US", "lang" => "en-US"}
|
9
|
+
%head
|
10
|
+
%title This is some title
|
11
|
+
%meta{"http-equiv" => "Content-Type", :content => "text/html; charset=utf-8"}
|
12
|
+
%body
|
13
|
+
/ Hey, a comment!
|
14
|
+
.header
|
15
|
+
This is the header,
|
16
|
+
with multiple lines in it.
|
17
|
+
= 1 + 9 + 8 + 2
|
18
|
+
/
|
19
|
+
And now, a
|
20
|
+
= "multiline comment"
|
21
|
+
%p everything can be nested in comments
|
22
|
+
#body= " Hey I print something!"
|
23
|
+
- for number in range(0, 120)
|
24
|
+
= number
|
25
|
+
Wow.|
|
26
|
+
%p
|
27
|
+
= "Holy cow " ~ |
|
28
|
+
"multiline " ~ |
|
29
|
+
"tags! " ~ |
|
30
|
+
"A pipe (|) even!" |
|
31
|
+
= [1, 2, 3]|length
|
32
|
+
= "Holy cow " ~ |
|
33
|
+
"multiline " ~ |
|
34
|
+
"tags! " |
|
35
|
+
%div.silent
|
36
|
+
- set foo = "this"
|
37
|
+
- set foo = foo ~ " shouldn't"
|
38
|
+
- set foo = foo ~ " be displayed"
|
39
|
+
= foo ~ " but now it should!"
|
40
|
+
-# Woah crap a non rendered comment!
|
41
|
+
|
42
|
+
-# That was a line that shouldn't close everything.
|
43
|
+
\= Escape
|
44
|
+
%ul.really.cool
|
45
|
+
- for a in ('a'..'f')
|
46
|
+
%li= a
|
47
|
+
#combo.of_divs_with_underscore= "with this text"
|
48
|
+
#escaping-test
|
49
|
+
= "this is not escaped"
|
50
|
+
&= "this is escaped"
|
51
|
+
!= "this is forcibly not escaped"
|
52
|
+
.footer
|
53
|
+
%strong.shout= "footer"
|
54
|
+
{% twig here should not be executed {
|
55
|
+
{ neither here {{ or here {% or here {
|
56
|
+
%
|
57
|
+
--EXPECT--
|
58
|
+
<!DOCTYPE html>
|
59
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US">
|
60
|
+
<head>
|
61
|
+
<title>This is some title</title>
|
62
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
63
|
+
</head>
|
64
|
+
<body>
|
65
|
+
<!-- Hey, a comment! -->
|
66
|
+
<div class="header">
|
67
|
+
This is the header,
|
68
|
+
with multiple lines in it.
|
69
|
+
{% line 11 %}{{ 1 + 9 + 8 + 2 }}
|
70
|
+
</div>
|
71
|
+
<!--
|
72
|
+
And now, a
|
73
|
+
{% line 14 %}{{ "multiline comment" }}
|
74
|
+
<p>everything can be nested in comments</p>
|
75
|
+
-->
|
76
|
+
<div id="body">{% line 16 %}{{ " Hey I print something!" }}</div>
|
77
|
+
{% for number in range(0, 120) %}
|
78
|
+
{{ number }}
|
79
|
+
{% endfor %}
|
80
|
+
Wow.|
|
81
|
+
<p>
|
82
|
+
{% line 24 %}{{ "Holy cow " ~ "multiline " ~ "tags! " ~ "A pipe (|) even!" }}
|
83
|
+
{{ [1, 2, 3]|length }}
|
84
|
+
{% line 28 %}{{ "Holy cow " ~ "multiline " ~ "tags! " }}
|
85
|
+
</p>
|
86
|
+
<div class="silent">
|
87
|
+
{% line 30 %} {% set foo = "this" %}
|
88
|
+
{% set foo = foo ~ " shouldn't" %}
|
89
|
+
{% set foo = foo ~ " be displayed" %}
|
90
|
+
{{ foo ~ " but now it should!" }}
|
91
|
+
</div>
|
92
|
+
= Escape
|
93
|
+
<ul class="really cool">
|
94
|
+
{% line 39 %} {% for a in ('a'..'f') %}
|
95
|
+
<li>{{ a }}</li>
|
96
|
+
{% endfor %}
|
97
|
+
</ul>
|
98
|
+
<div id="combo" class="of_divs_with_underscore">{% line 41 %}{{ "with this text" }}</div>
|
99
|
+
<div id="escaping-test">
|
100
|
+
{{ "this is not escaped" }}
|
101
|
+
{{ ("this is escaped")|escape }}
|
102
|
+
{{ ("this is forcibly not escaped")|raw }}
|
103
|
+
</div>
|
104
|
+
<div class="footer">
|
105
|
+
<strong class="shout">{% line 47 %}{{ "footer" }}</strong>
|
106
|
+
{{ '{%' }} twig here should not be executed {
|
107
|
+
{ neither here {{ '{{' }} or here {{ '{%' }} or here {
|
108
|
+
%
|
109
|
+
</div>
|
110
|
+
</body>
|
111
|
+
</html>
|
112
|
+
|
@@ -0,0 +1,29 @@
|
|
1
|
+
--HAML--
|
2
|
+
- if a
|
3
|
+
%ul
|
4
|
+
- for item in items
|
5
|
+
%li
|
6
|
+
= item
|
7
|
+
= foo
|
8
|
+
- else
|
9
|
+
no item
|
10
|
+
|
11
|
+
--FILE--
|
12
|
+
<?php
|
13
|
+
$env = new MtHaml\Environment('twig', array('enable_escaper' => false));
|
14
|
+
echo $env->compileString($parts['HAML'], "$file.haml");
|
15
|
+
|
16
|
+
--EXPECT--
|
17
|
+
{% if a %}
|
18
|
+
<ul>
|
19
|
+
{% for item in items %}
|
20
|
+
<li>
|
21
|
+
{{ item }}
|
22
|
+
</li>
|
23
|
+
{% endfor %}
|
24
|
+
</ul>
|
25
|
+
{% line 6 %}{{ foo }}
|
26
|
+
{% else %}
|
27
|
+
no item
|
28
|
+
{% endif %}
|
29
|
+
|
@@ -0,0 +1,37 @@
|
|
1
|
+
--FILE--
|
2
|
+
<?php
|
3
|
+
$env = new MtHaml\Environment('twig', array('enable_escaper' => false));
|
4
|
+
echo $env->compileString($parts['HAML'], "$file.haml");
|
5
|
+
|
6
|
+
--HAML--
|
7
|
+
#php
|
8
|
+
:php
|
9
|
+
echo $a;
|
10
|
+
:php
|
11
|
+
foreach (array(#{foo}) as $item) {
|
12
|
+
}
|
13
|
+
#twig
|
14
|
+
:twig
|
15
|
+
{{ foo|filter }}
|
16
|
+
{% for i in 1..5 %}
|
17
|
+
{{ "- \#{i}" }}
|
18
|
+
{% endfor %}
|
19
|
+
:twig
|
20
|
+
{{ #{foo}|filter }}
|
21
|
+
--EXPECT--
|
22
|
+
<div id="php">
|
23
|
+
{% filter mthaml_php %}echo $a;
|
24
|
+
{% endfilter %}
|
25
|
+
{% filter mthaml_php %}foreach (array({% line 5 %}{{ foo }}) as $item) {
|
26
|
+
}
|
27
|
+
{% endfilter %}
|
28
|
+
</div>
|
29
|
+
<div id="twig">
|
30
|
+
{{ foo|filter }}
|
31
|
+
{% for i in 1..5 %}
|
32
|
+
{{ "- #{i}" }}
|
33
|
+
{% endfor %}
|
34
|
+
{% filter mthaml_twig %}{{ '{{' }} {{ foo }}|filter }}
|
35
|
+
{% endfilter %}
|
36
|
+
</div>
|
37
|
+
|
@@ -0,0 +1,32 @@
|
|
1
|
+
--HAML--
|
2
|
+
|
3
|
+
- macro foo() -
|
4
|
+
test
|
5
|
+
|
6
|
+
-- if foo
|
7
|
+
test
|
8
|
+
-- elseif bar -
|
9
|
+
test
|
10
|
+
|
11
|
+
-- if x -
|
12
|
+
test
|
13
|
+
-- endif -
|
14
|
+
|
15
|
+
--FILE--
|
16
|
+
<?php
|
17
|
+
$env = new MtHaml\Environment('twig', array('enable_escaper' => false));
|
18
|
+
echo $env->compileString($parts['HAML'], "$file.haml");
|
19
|
+
|
20
|
+
--EXPECT--
|
21
|
+
{% line 2 %}{% macro foo() -%}
|
22
|
+
test
|
23
|
+
{% endmacro %}
|
24
|
+
{%- if foo %}
|
25
|
+
test
|
26
|
+
{%- elseif bar -%}
|
27
|
+
test
|
28
|
+
{% endif %}
|
29
|
+
{%- if x -%}
|
30
|
+
test
|
31
|
+
{%- endif -%}
|
32
|
+
|