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,292 @@
|
|
1
|
+
<?php
|
2
|
+
|
3
|
+
namespace CoffeeScript;
|
4
|
+
|
5
|
+
class yy_Op extends yy_Base
|
6
|
+
{
|
7
|
+
static $CONVERSIONS = array(
|
8
|
+
'==' => '===',
|
9
|
+
'!=' => '!==',
|
10
|
+
'of' => 'in'
|
11
|
+
);
|
12
|
+
|
13
|
+
static $INVERSIONS = array(
|
14
|
+
'!==' => '===',
|
15
|
+
'===' => '!=='
|
16
|
+
);
|
17
|
+
|
18
|
+
public $children = array('first', 'second');
|
19
|
+
|
20
|
+
public $operator = NULL;
|
21
|
+
|
22
|
+
public $invert = TRUE;
|
23
|
+
|
24
|
+
function constructor($op, $first, $second = NULL, $flip = NULL)
|
25
|
+
{
|
26
|
+
if ($op === 'in')
|
27
|
+
{
|
28
|
+
return yy('In', $first, $second);
|
29
|
+
}
|
30
|
+
|
31
|
+
if ($op === 'do')
|
32
|
+
{
|
33
|
+
return $this->generate_do($first);
|
34
|
+
}
|
35
|
+
|
36
|
+
if ($op === 'new')
|
37
|
+
{
|
38
|
+
if ($first instanceof yy_Call && ! (isset($first->do) && $first->do) && ! (isset($first->is_new) && $first->is_new))
|
39
|
+
{
|
40
|
+
return $first->new_instance();
|
41
|
+
}
|
42
|
+
|
43
|
+
if ($first instanceof yy_Code && $first->bound || (isset($first->do) && $first->do))
|
44
|
+
{
|
45
|
+
$first = yy('Parens', $first);
|
46
|
+
}
|
47
|
+
}
|
48
|
+
|
49
|
+
$this->operator = isset(self::$CONVERSIONS[$op]) ? self::$CONVERSIONS[$op] : $op;
|
50
|
+
$this->first = $first;
|
51
|
+
$this->second = $second;
|
52
|
+
$this->flip = !! $flip;
|
53
|
+
|
54
|
+
return $this;
|
55
|
+
}
|
56
|
+
|
57
|
+
function compile_chain($options)
|
58
|
+
{
|
59
|
+
$tmp = $this->first->second->cache($options);
|
60
|
+
|
61
|
+
$this->first->second = $tmp[0];
|
62
|
+
$shared = $tmp[1];
|
63
|
+
|
64
|
+
$fst = $this->first->compile($options, LEVEL_OP);
|
65
|
+
|
66
|
+
$code = "{$fst} ".($this->invert ? '&&' : '||').' '.$shared->compile($options).' '
|
67
|
+
.$this->operator.' '.$this->second->compile($options, LEVEL_OP);
|
68
|
+
|
69
|
+
return "({$code})";
|
70
|
+
}
|
71
|
+
|
72
|
+
function compile_existence($options)
|
73
|
+
{
|
74
|
+
if ($this->first->is_complex() && $options['level'] > LEVEL_TOP)
|
75
|
+
{
|
76
|
+
$ref = yy('Literal', $options['scope']->free_variable('ref'));
|
77
|
+
$fst = yy('Parens', yy('Assign', $ref, $this->first));
|
78
|
+
}
|
79
|
+
else
|
80
|
+
{
|
81
|
+
$fst = $this->first;
|
82
|
+
$ref = $fst;
|
83
|
+
}
|
84
|
+
|
85
|
+
$tmp = yy('If', yy('Existence', $fst), $ref, array('type' => 'if'));
|
86
|
+
$tmp->add_else($this->second);
|
87
|
+
|
88
|
+
return $tmp->compile($options);
|
89
|
+
}
|
90
|
+
|
91
|
+
function compile_node($options, $level = NULL)
|
92
|
+
{
|
93
|
+
$is_chain = $this->is_chainable() && $this->first->is_chainable();
|
94
|
+
|
95
|
+
if ( ! $is_chain)
|
96
|
+
{
|
97
|
+
$this->first->front = $this->front;
|
98
|
+
}
|
99
|
+
|
100
|
+
$tmp = $this->first->unwrap_all();
|
101
|
+
$tmp = isset($tmp->value) ? $tmp->value : NULL;
|
102
|
+
|
103
|
+
if ($this->operator === 'delete' && $options['scope']->check($tmp))
|
104
|
+
{
|
105
|
+
throw new SyntaxError('delete operand may not be argument or var');
|
106
|
+
}
|
107
|
+
|
108
|
+
if (in_array($this->operator, array('--', '++')) && in_array($tmp, Lexer::$STRICT_PROSCRIBED))
|
109
|
+
{
|
110
|
+
throw new SyntaxError('prefix increment/decrement may not have eval or arguments operand');
|
111
|
+
}
|
112
|
+
|
113
|
+
if ($this->is_unary())
|
114
|
+
{
|
115
|
+
return $this->compile_unary($options);
|
116
|
+
}
|
117
|
+
|
118
|
+
if ($is_chain)
|
119
|
+
{
|
120
|
+
return $this->compile_chain($options);
|
121
|
+
}
|
122
|
+
|
123
|
+
if ($this->operator === '?')
|
124
|
+
{
|
125
|
+
return $this->compile_existence($options);
|
126
|
+
}
|
127
|
+
|
128
|
+
$this->first->front = $this->front;
|
129
|
+
|
130
|
+
$code = $this->first->compile($options, LEVEL_OP).' '.$this->operator.' '
|
131
|
+
.$this->second->compile($options, LEVEL_OP);
|
132
|
+
|
133
|
+
return $options['level'] <= LEVEL_OP ? $code : "({$code})";
|
134
|
+
}
|
135
|
+
|
136
|
+
function compile_unary($options)
|
137
|
+
{
|
138
|
+
if ($options['level'] >= LEVEL_ACCESS)
|
139
|
+
{
|
140
|
+
return yy('Parens', $this)->compile($options);
|
141
|
+
}
|
142
|
+
|
143
|
+
$parts = array($op = $this->operator);
|
144
|
+
$plus_minus = in_array($op, array('+', '-'), TRUE);
|
145
|
+
|
146
|
+
if (in_array($op, array('new', 'typeof', 'delete'), TRUE) ||
|
147
|
+
$plus_minus &&
|
148
|
+
$this->first instanceof yy_Op && $this->first->operator === $op)
|
149
|
+
{
|
150
|
+
$parts[] = ' ';
|
151
|
+
}
|
152
|
+
|
153
|
+
if (($plus_minus && $this->first instanceof yy_Op) || ($op === 'new' && $this->first->is_statement($options)))
|
154
|
+
{
|
155
|
+
$this->first = yy('Parens', $this->first);
|
156
|
+
}
|
157
|
+
|
158
|
+
$parts[] = $this->first->compile($options, LEVEL_OP);
|
159
|
+
|
160
|
+
if ($this->flip)
|
161
|
+
{
|
162
|
+
$parts = array_reverse($parts);
|
163
|
+
}
|
164
|
+
|
165
|
+
return implode('', $parts);
|
166
|
+
}
|
167
|
+
|
168
|
+
function is_chainable()
|
169
|
+
{
|
170
|
+
return in_array($this->operator, array('<', '>', '>=', '<=', '===', '!=='), TRUE);
|
171
|
+
}
|
172
|
+
|
173
|
+
function is_complex()
|
174
|
+
{
|
175
|
+
return ! ($this->is_unary() && in_array($this->operator, array('+', '-'))) || $this->first->is_complex();
|
176
|
+
}
|
177
|
+
|
178
|
+
function invert()
|
179
|
+
{
|
180
|
+
if ($this->is_chainable() && $this->first->is_chainable())
|
181
|
+
{
|
182
|
+
$all_invertable = TRUE;
|
183
|
+
$curr = $this;
|
184
|
+
|
185
|
+
while ($curr && (isset($curr->operator) && $curr->operator))
|
186
|
+
{
|
187
|
+
if ($all_invertable)
|
188
|
+
{
|
189
|
+
$all_invertable = isset(self::$INVERSIONS[$curr->operator]);
|
190
|
+
}
|
191
|
+
|
192
|
+
$curr = $curr->first;
|
193
|
+
}
|
194
|
+
|
195
|
+
if ( ! $all_invertable)
|
196
|
+
{
|
197
|
+
return yy('Parens', $this)->invert();
|
198
|
+
}
|
199
|
+
|
200
|
+
$curr = $this;
|
201
|
+
|
202
|
+
while ($curr && (isset($curr->operator) && $curr->operator))
|
203
|
+
{
|
204
|
+
$curr->invert = ! $curr->invert;
|
205
|
+
$curr->operator = self::$INVERSIONS[$curr->operator];
|
206
|
+
$curr = $curr->first;
|
207
|
+
}
|
208
|
+
|
209
|
+
return $this;
|
210
|
+
}
|
211
|
+
else if (isset(self::$INVERSIONS[$this->operator]) && ($op = self::$INVERSIONS[$this->operator]))
|
212
|
+
{
|
213
|
+
$this->operator = $op;
|
214
|
+
|
215
|
+
if ($this->first->unwrap() instanceof yy_Op)
|
216
|
+
{
|
217
|
+
$this->first->invert();
|
218
|
+
}
|
219
|
+
|
220
|
+
return $this;
|
221
|
+
}
|
222
|
+
else if ($this->second)
|
223
|
+
{
|
224
|
+
return yy('Parens', $this)->invert();
|
225
|
+
}
|
226
|
+
else if ($this->operator === '!' && (($fst = $this->first->unwrap()) instanceof yy_Op) &&
|
227
|
+
in_array($fst->operator, array('!', 'in', 'instanceof'), TRUE))
|
228
|
+
{
|
229
|
+
return $fst;
|
230
|
+
}
|
231
|
+
else
|
232
|
+
{
|
233
|
+
return yy('Op', '!', $this);
|
234
|
+
}
|
235
|
+
}
|
236
|
+
|
237
|
+
function generate_do($exp)
|
238
|
+
{
|
239
|
+
$passed_params = array();
|
240
|
+
$func = $exp;
|
241
|
+
|
242
|
+
if ($exp instanceof yy_Assign && ($ref = $exp->value->unwrap()) instanceof yy_Code)
|
243
|
+
{
|
244
|
+
$func = $ref;
|
245
|
+
}
|
246
|
+
|
247
|
+
foreach ((isset($func->params) && $func->params ? $func->params : array()) as $param)
|
248
|
+
{
|
249
|
+
if (isset($param->value) && $param->value)
|
250
|
+
{
|
251
|
+
$passed_params[] = $param->value;
|
252
|
+
unset($param->value);
|
253
|
+
}
|
254
|
+
else
|
255
|
+
{
|
256
|
+
$passed_params[] = $param;
|
257
|
+
}
|
258
|
+
}
|
259
|
+
|
260
|
+
$call = yy('Call', $exp, $passed_params);
|
261
|
+
$call->do = TRUE;
|
262
|
+
|
263
|
+
return $call;
|
264
|
+
}
|
265
|
+
|
266
|
+
function is_simple_number()
|
267
|
+
{
|
268
|
+
return FALSE;
|
269
|
+
}
|
270
|
+
|
271
|
+
function is_unary()
|
272
|
+
{
|
273
|
+
return ! (isset($this->second) && $this->second);
|
274
|
+
}
|
275
|
+
|
276
|
+
function unfold_soak($options = NULL)
|
277
|
+
{
|
278
|
+
if (in_array($this->operator, array('++', '--', 'delete'), TRUE))
|
279
|
+
{
|
280
|
+
return unfold_soak($options, $this, 'first');
|
281
|
+
}
|
282
|
+
|
283
|
+
return NULL;
|
284
|
+
}
|
285
|
+
|
286
|
+
function to_string($idt = '', $name = __CLASS__)
|
287
|
+
{
|
288
|
+
return parent::to_string($idt, $name.' '.$this->operator);
|
289
|
+
}
|
290
|
+
}
|
291
|
+
|
292
|
+
?>
|
@@ -0,0 +1,119 @@
|
|
1
|
+
<?php
|
2
|
+
|
3
|
+
namespace CoffeeScript;
|
4
|
+
|
5
|
+
class yy_Param extends yy_Base
|
6
|
+
{
|
7
|
+
public $children = array('name', 'value');
|
8
|
+
|
9
|
+
function constructor($name, $value = NULL, $splat = NULL)
|
10
|
+
{
|
11
|
+
$this->name = $name;
|
12
|
+
$this->value = $value;
|
13
|
+
$this->splat = $splat;
|
14
|
+
|
15
|
+
$name = $this->name->unwrap_all();
|
16
|
+
$name = isset($name->value) ? $name->value : NULL;
|
17
|
+
|
18
|
+
if (in_array($name, Lexer::$STRICT_PROSCRIBED))
|
19
|
+
{
|
20
|
+
throw new SyntaxError("parameter name \"$name\" is not allowed");
|
21
|
+
}
|
22
|
+
|
23
|
+
return $this;
|
24
|
+
}
|
25
|
+
|
26
|
+
function as_reference($options)
|
27
|
+
{
|
28
|
+
if (isset($this->reference) && $this->reference)
|
29
|
+
{
|
30
|
+
return $this->reference;
|
31
|
+
}
|
32
|
+
|
33
|
+
$node = $this->name;
|
34
|
+
|
35
|
+
if (isset($node->this) && $node->this)
|
36
|
+
{
|
37
|
+
$node = $node->properties[0]->name;
|
38
|
+
|
39
|
+
if (isset($this->value->reserved) && $this->value->reserved)
|
40
|
+
{
|
41
|
+
$node = yy('Literal', $options['scope']->free_variable($node->value));
|
42
|
+
}
|
43
|
+
}
|
44
|
+
else if ($node->is_complex())
|
45
|
+
{
|
46
|
+
$node = yy('Literal', $options['scope']->free_variable('arg'));
|
47
|
+
}
|
48
|
+
|
49
|
+
$node = yy('Value', $node);
|
50
|
+
|
51
|
+
if ($this->splat)
|
52
|
+
{
|
53
|
+
$node = yy('Splat', $node);
|
54
|
+
}
|
55
|
+
|
56
|
+
return ($this->reference = $node);
|
57
|
+
}
|
58
|
+
|
59
|
+
function compile($options, $level = NULL)
|
60
|
+
{
|
61
|
+
return $this->name->compile($options, LEVEL_LIST);
|
62
|
+
}
|
63
|
+
|
64
|
+
function is_complex()
|
65
|
+
{
|
66
|
+
return $this->name->is_complex();
|
67
|
+
}
|
68
|
+
|
69
|
+
function names($name = NULL)
|
70
|
+
{
|
71
|
+
if ($name === NULL)
|
72
|
+
{
|
73
|
+
$name = $this->name;
|
74
|
+
}
|
75
|
+
|
76
|
+
$at_param = function($obj)
|
77
|
+
{
|
78
|
+
$value = $obj->properties[0]->name;
|
79
|
+
|
80
|
+
return isset($value->reserved) && $value->reserved ? array() : array($value);
|
81
|
+
};
|
82
|
+
|
83
|
+
if ($name instanceof yy_Literal)
|
84
|
+
{
|
85
|
+
return array($name->value);
|
86
|
+
}
|
87
|
+
|
88
|
+
if ($name instanceof yy_Value)
|
89
|
+
{
|
90
|
+
return $at_param($name);
|
91
|
+
}
|
92
|
+
|
93
|
+
$names = array();
|
94
|
+
|
95
|
+
foreach ($name->objects as $obj)
|
96
|
+
{
|
97
|
+
if ($obj instanceof yy_Assign)
|
98
|
+
{
|
99
|
+
$names[] = $obj->variable->base->value;
|
100
|
+
}
|
101
|
+
else if ($obj->is_array() || $obj->is_object())
|
102
|
+
{
|
103
|
+
$names = array_merge($names, (array) $this->names($obj->base));
|
104
|
+
}
|
105
|
+
else if (isset($obj->this) && $obj->this)
|
106
|
+
{
|
107
|
+
$names = array_merge($names, (array) $at_param($obj));
|
108
|
+
}
|
109
|
+
else
|
110
|
+
{
|
111
|
+
$names[] = $obj->base->value;
|
112
|
+
}
|
113
|
+
}
|
114
|
+
|
115
|
+
return $names;
|
116
|
+
}
|
117
|
+
}
|
118
|
+
|
119
|
+
?>
|
@@ -0,0 +1,45 @@
|
|
1
|
+
<?php
|
2
|
+
|
3
|
+
namespace CoffeeScript;
|
4
|
+
|
5
|
+
class yy_Parens extends yy_Base
|
6
|
+
{
|
7
|
+
public $children = array('body');
|
8
|
+
|
9
|
+
function constructor($body)
|
10
|
+
{
|
11
|
+
$this->body = $body;
|
12
|
+
|
13
|
+
return $this;
|
14
|
+
}
|
15
|
+
|
16
|
+
function compile_node($options = array())
|
17
|
+
{
|
18
|
+
$expr = $this->body->unwrap();
|
19
|
+
|
20
|
+
if ($expr instanceof yy_Value && $expr->is_atomic())
|
21
|
+
{
|
22
|
+
$expr->front = $this->front;
|
23
|
+
return $expr->compile($options);
|
24
|
+
}
|
25
|
+
|
26
|
+
$code = $expr->compile($options, LEVEL_PAREN);
|
27
|
+
|
28
|
+
$bare = $options['level'] < LEVEL_OP && ($expr instanceof yy_Op || $expr instanceof yy_Call ||
|
29
|
+
($expr instanceof yy_For && $expr->returns));
|
30
|
+
|
31
|
+
return $bare ? $code : "({$code})";
|
32
|
+
}
|
33
|
+
|
34
|
+
function is_complex()
|
35
|
+
{
|
36
|
+
return $this->body->is_complex();
|
37
|
+
}
|
38
|
+
|
39
|
+
function unwrap()
|
40
|
+
{
|
41
|
+
return $this->body;
|
42
|
+
}
|
43
|
+
}
|
44
|
+
|
45
|
+
?>
|