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
data/vendor/autoload.php
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2011 Jeremy Ashkenas, Alex Little
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person
|
4
|
+
obtaining a copy of this software and associated documentation
|
5
|
+
files (the "Software"), to deal in the Software without
|
6
|
+
restriction, including without limitation the rights to use,
|
7
|
+
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
+
copies of the Software, and to permit persons to whom the
|
9
|
+
Software is furnished to do so, subject to the following
|
10
|
+
conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be
|
13
|
+
included in all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
16
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
17
|
+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
18
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
19
|
+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
20
|
+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
21
|
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
22
|
+
OTHER DEALINGS IN THE SOFTWARE.
|
@@ -0,0 +1,96 @@
|
|
1
|
+
# CoffeeScript PHP
|
2
|
+
|
3
|
+
A port of the [CoffeeScript](http://jashkenas.github.com/coffee-script/)
|
4
|
+
compiler to PHP.
|
5
|
+
|
6
|
+
## Status
|
7
|
+
|
8
|
+
CoffeeScript version **1.3.1** has been fully ported over (see
|
9
|
+
[tags](http://github.com/alxlit/coffeescript-php/tags)). There are a couple
|
10
|
+
benign differences between the port's compiled code and the reference's (for
|
11
|
+
example [#11](https://github.com/alxlit/coffeescript-php/issues/11)), otherwise
|
12
|
+
they match 100%.
|
13
|
+
|
14
|
+
## Requirements
|
15
|
+
|
16
|
+
PHP 5.3+ (uses namespaces, anonymous functions).
|
17
|
+
|
18
|
+
## Install
|
19
|
+
|
20
|
+
It's recommended that you use [Composer](http://getcomposer.org) to install
|
21
|
+
and autoload CoffeeScript. Alternatively you can load it manually:
|
22
|
+
|
23
|
+
```php
|
24
|
+
<?php
|
25
|
+
|
26
|
+
require 'vendor/CoffeeScript/Init.php';
|
27
|
+
|
28
|
+
// Load manually
|
29
|
+
CoffeeScript\Init::load();
|
30
|
+
|
31
|
+
?>
|
32
|
+
```
|
33
|
+
|
34
|
+
## Usage
|
35
|
+
|
36
|
+
The API is really basic (single `compile($coffee, $options = NULL)` function).
|
37
|
+
I don't plan on expanding it further (keeping it simple). Here are the available
|
38
|
+
options:
|
39
|
+
|
40
|
+
* **filename** - The source filename, formatted into error messages
|
41
|
+
* **header** - Add a "Generated by..." header
|
42
|
+
* **rewrite** - Enable the rewriter (debugging)
|
43
|
+
* **tokens** - Reference to token stream (debugging)
|
44
|
+
* **trace** - File to write parser trace to (debugging)
|
45
|
+
|
46
|
+
```php
|
47
|
+
<?php
|
48
|
+
|
49
|
+
$file = 'path/to/source.coffee';
|
50
|
+
|
51
|
+
try
|
52
|
+
{
|
53
|
+
$coffee = file_get_contents($file);
|
54
|
+
|
55
|
+
// See available options above.
|
56
|
+
$js = CoffeeScript\Compiler::compile($coffee, array('filename' => $file));
|
57
|
+
}
|
58
|
+
catch (Exception $e)
|
59
|
+
{
|
60
|
+
echo $e->getMessage();
|
61
|
+
}
|
62
|
+
|
63
|
+
?>
|
64
|
+
```
|
65
|
+
|
66
|
+
## Development
|
67
|
+
|
68
|
+
To rebuild the parser run `php make.php`. Tests are run in the browser; simply
|
69
|
+
clone the repository somewhere Apache can see it and navigate to tests/.
|
70
|
+
|
71
|
+
## FAQ
|
72
|
+
|
73
|
+
#### What was the motivation for this project?
|
74
|
+
|
75
|
+
I was using PHP a lot at the time and wanted to use, learn more about, and
|
76
|
+
potentially contribute to the CoffeeScript project. I thought it'd be nice to
|
77
|
+
have a native version gave it a shot.
|
78
|
+
|
79
|
+
#### Why not modify the original compiler to emit PHP?
|
80
|
+
|
81
|
+
For a number of reasons... First, I don't know why you'd want something like
|
82
|
+
that. If you find PHP intolerable, just don't use it... Second, the original
|
83
|
+
compiler depends on Jison, which is written in JavaScript, so you'd have to do
|
84
|
+
something about that. Third, I think it'd be much more work to try and sort out
|
85
|
+
all the differences between JavaScript and PHP (object model, core classes
|
86
|
+
and libraries, etc).
|
87
|
+
|
88
|
+
#### What parser generator are you using?
|
89
|
+
|
90
|
+
Since there's no PHP port of Bison (which the reference compiler uses), we're
|
91
|
+
using a port of Lemon called [ParserGenerator](http://pear.php.net/package/PHP_ParserGenerator).
|
92
|
+
|
93
|
+
It's included locally since the PEAR package is unmaintained and seems to be
|
94
|
+
broken. In addition, some minor changes have been made to the parser template
|
95
|
+
(Lempar.php) and the actual generator.
|
96
|
+
|
@@ -0,0 +1,23 @@
|
|
1
|
+
{
|
2
|
+
"name": "coffeescript/coffeescript",
|
3
|
+
"type": "library",
|
4
|
+
"description": "A port of the CoffeeScript compiler to PHP.",
|
5
|
+
"keywords": ["coffee", "coffeescript", "js", "javascript"],
|
6
|
+
"homepage": "http://github.com/alxlit/coffeescript-php",
|
7
|
+
"license": "MIT",
|
8
|
+
"authors": [
|
9
|
+
{
|
10
|
+
"name": "Alex Little",
|
11
|
+
"email": "alxlit@gmail.com",
|
12
|
+
"homepage": "http://alxlit.name"
|
13
|
+
}
|
14
|
+
],
|
15
|
+
"require": {
|
16
|
+
"php": ">=5.3.0"
|
17
|
+
},
|
18
|
+
"autoload": {
|
19
|
+
"psr-0": {
|
20
|
+
"CoffeeScript": "src/"
|
21
|
+
}
|
22
|
+
}
|
23
|
+
}
|
@@ -0,0 +1,309 @@
|
|
1
|
+
%start_symbol root
|
2
|
+
%declare_class { class Parser }
|
3
|
+
|
4
|
+
%syntax_error {
|
5
|
+
throw new SyntaxError(
|
6
|
+
'unexpected '.$this->tokenName($yymajor).' in '.self::$FILE.':'
|
7
|
+
. (self::$LINE + 1).'.'
|
8
|
+
);
|
9
|
+
}
|
10
|
+
|
11
|
+
%right YY_POST_IF.
|
12
|
+
%right YY_IF YY_ELSE YY_FOR YY_WHILE YY_UNTIL YY_LOOP YY_SUPER YY_CLASS.
|
13
|
+
%right YY_FORIN YY_FOROF YY_BY YY_WHEN.
|
14
|
+
%right YY_EQUALS YY_COLON YY_COMPOUND_ASSIGN YY_RETURN YY_THROW YY_EXTENDS.
|
15
|
+
%nonassoc YY_INDENT YY_OUTDENT.
|
16
|
+
%left YY_LOGIC.
|
17
|
+
%left YY_COMPARE.
|
18
|
+
%left YY_RELATION.
|
19
|
+
%left YY_SHIFT.
|
20
|
+
%left YY_MATH.
|
21
|
+
%left YY_PLUS YY_MINUS.
|
22
|
+
%right YY_UNARY.
|
23
|
+
%left YY_EXISTENTIAL.
|
24
|
+
%nonassoc YY_INCREMENT YY_DECREMENT.
|
25
|
+
%left YY_CALL_START YY_CALL_END.
|
26
|
+
%left YY_ACCESSOR YY_EXISTENTIAL_ACCESSOR YY_PROTOTYPE.
|
27
|
+
|
28
|
+
root(A) ::= . { A = yy('Block'); }
|
29
|
+
root(A) ::= body(B) . { A = B; }
|
30
|
+
root(A) ::= block(B) YY_TERMINATOR . { A = B; }
|
31
|
+
|
32
|
+
body(A) ::= line(B) . { A = yy_Block::wrap(array(B)); }
|
33
|
+
body(A) ::= body(B) YY_TERMINATOR line(C) . { A = B->push(C); }
|
34
|
+
body(A) ::= body(B) YY_TERMINATOR . { A = B; }
|
35
|
+
|
36
|
+
line(A) ::= expression(B) . { A = B; }
|
37
|
+
line(A) ::= statement(B) . { A = B; }
|
38
|
+
|
39
|
+
statement(A) ::= return(B) . { A = B; }
|
40
|
+
statement(A) ::= comment(B) . { A = B; }
|
41
|
+
statement(A) ::= YY_STATEMENT(B) . { A = yy('Literal', B); }
|
42
|
+
|
43
|
+
expression(A) ::= value(B) . { A = B; }
|
44
|
+
expression(A) ::= invocation(B) . { A = B; }
|
45
|
+
expression(A) ::= code(B) . { A = B; }
|
46
|
+
expression(A) ::= operation(B) . { A = B; }
|
47
|
+
expression(A) ::= assign(B) . { A = B; }
|
48
|
+
expression(A) ::= if(B) . { A = B; }
|
49
|
+
expression(A) ::= try(B) . { A = B; }
|
50
|
+
expression(A) ::= while(B) . { A = B; }
|
51
|
+
expression(A) ::= for(B) . { A = B; }
|
52
|
+
expression(A) ::= switch(B) . { A = B; }
|
53
|
+
expression(A) ::= class(B) . { A = B; }
|
54
|
+
expression(A) ::= throw(B) . { A = B; }
|
55
|
+
|
56
|
+
block(A) ::= YY_INDENT YY_OUTDENT . { A = yy('Block'); }
|
57
|
+
block(A) ::= YY_INDENT body(B) YY_OUTDENT . { A = B; }
|
58
|
+
|
59
|
+
identifier(A) ::= YY_IDENTIFIER(B) . { A = yy('Literal', B); }
|
60
|
+
|
61
|
+
alphanumeric(A) ::= YY_NUMBER(B) . { A = yy('Literal', B); }
|
62
|
+
alphanumeric(A) ::= YY_STRING(B) . { A = yy('Literal', B); }
|
63
|
+
|
64
|
+
literal(A) ::= alphanumeric(B) . { A = B; }
|
65
|
+
literal(A) ::= YY_JS(B) . { A = yy('Literal', B); }
|
66
|
+
literal(A) ::= YY_REGEX(B) . { A = yy('Literal', B); }
|
67
|
+
literal(A) ::= YY_DEBUGGER(B) . { A = yy('Literal', B); }
|
68
|
+
|
69
|
+
literal(A) ::= YY_BOOL(B) . {
|
70
|
+
$val = yy('Literal', B);
|
71
|
+
$val->is_undefined = B === 'undefined';
|
72
|
+
A = $val;
|
73
|
+
}
|
74
|
+
|
75
|
+
assign(A) ::= assignable(B) YY_EQUALS expression(C) . { A = yy('Assign', B, C); }
|
76
|
+
assign(A) ::= assignable(B) YY_EQUALS YY_TERMINATOR expression(C) . { A = yy('Assign', B, C); }
|
77
|
+
assign(A) ::= assignable(B) YY_EQUALS YY_INDENT expression(C) YY_OUTDENT . { A = yy('Assign', B, C); }
|
78
|
+
|
79
|
+
assignObj(A) ::= objAssignable(B) . { A = yy('Value', B); }
|
80
|
+
assignObj(A) ::= objAssignable(B) YY_COLON expression(C) . { A = yy('Assign', yy('Value', B), C, 'object'); }
|
81
|
+
assignObj(A) ::= objAssignable(B) YY_COLON YY_INDENT expression(C) YY_OUTDENT . { A = yy('Assign', yy('Value', B), C, 'object'); }
|
82
|
+
assignObj(A) ::= comment(B) . { A = B; }
|
83
|
+
|
84
|
+
objAssignable(A) ::= identifier(B) . { A = B; }
|
85
|
+
objAssignable(A) ::= alphanumeric(B) . { A = B; }
|
86
|
+
objAssignable(A) ::= thisProperty(B) . { A = B; }
|
87
|
+
|
88
|
+
return(A) ::= YY_RETURN expression(B) . { A = yy('Return', B); }
|
89
|
+
return(A) ::= YY_RETURN . { A = yy('Return'); }
|
90
|
+
|
91
|
+
comment(A) ::= YY_HERECOMMENT(B) . { A = yy('Comment', B); }
|
92
|
+
|
93
|
+
code(A) ::= YY_PARAM_START paramList(B) YY_PARAM_END funcGlyph(C) block(D) . { A = yy('Code', B, D, C); }
|
94
|
+
code(A) ::= funcGlyph(B) block(C) . { A = yy('Code', array(), C, B); }
|
95
|
+
|
96
|
+
funcGlyph(A) ::= YY_FUNC . { A = 'func'; }
|
97
|
+
funcGlyph(A) ::= YY_BOUND_FUNC . { A = 'boundfunc'; }
|
98
|
+
|
99
|
+
optComma(A) ::= . { A = ''; }
|
100
|
+
optComma(A) ::= YY_COMMA(B) . { A = B; }
|
101
|
+
|
102
|
+
paramList(A) ::= . { A = array(); }
|
103
|
+
paramList(A) ::= param(B) . { A = array(B); }
|
104
|
+
paramList(A) ::= paramList(B) YY_COMMA param(C) . { A = array_merge(B, array(C)); }
|
105
|
+
|
106
|
+
param(A) ::= paramVar(B) . { A = yy('Param', B); }
|
107
|
+
param(A) ::= paramVar(B) YY_RANGE_EXCLUSIVE . { A = yy('Param', B, NULL, TRUE); }
|
108
|
+
param(A) ::= paramVar(B) YY_EQUALS expression(C) . { A = yy('Param', B, C); }
|
109
|
+
|
110
|
+
paramVar(A) ::= identifier(B) . { A = B; }
|
111
|
+
paramVar(A) ::= thisProperty(B) . { A = B; }
|
112
|
+
paramVar(A) ::= array(B) . { A = B; }
|
113
|
+
paramVar(A) ::= object(B) . { A = B; }
|
114
|
+
|
115
|
+
splat(A) ::= expression(B) YY_RANGE_EXCLUSIVE . { A = yy('Splat', B); }
|
116
|
+
|
117
|
+
simpleAssignable(A) ::= identifier(B) . { A = yy('Value', B); }
|
118
|
+
simpleAssignable(A) ::= value(B) accessor(C) . { A = B->add(C); }
|
119
|
+
simpleAssignable(A) ::= invocation(B) accessor(C) . { A = yy('Value', B, is_object(C) ? array(C) : (array) C); }
|
120
|
+
simpleAssignable(A) ::= thisProperty(B) . { A = B; }
|
121
|
+
|
122
|
+
assignable(A) ::= simpleAssignable(B) . { A = B; }
|
123
|
+
assignable(A) ::= array(B) . { A = yy('Value', B); }
|
124
|
+
assignable(A) ::= object(B) . { A = yy('Value', B); }
|
125
|
+
|
126
|
+
value(A) ::= assignable(B) . { A = B; }
|
127
|
+
value(A) ::= literal(B) . { A = yy('Value', B); }
|
128
|
+
value(A) ::= parenthetical(B) . { A = yy('Value', B); }
|
129
|
+
value(A) ::= range(B) . { A = yy('Value', B); }
|
130
|
+
value(A) ::= this(B) . { A = B; }
|
131
|
+
|
132
|
+
accessor(A) ::= YY_ACCESSOR identifier(B) . { A = yy('Access', B); }
|
133
|
+
accessor(A) ::= YY_EXISTENTIAL_ACCESSOR identifier(B) . { A = yy('Access', B, 'soak'); }
|
134
|
+
accessor(A) ::= YY_PROTOTYPE identifier(B) . { A = array( yy('Access', yy('Literal', 'prototype')), yy('Access', B) ); }
|
135
|
+
accessor(A) ::= YY_PROTOTYPE . { A = yy('Access', yy('Literal', 'prototype')); }
|
136
|
+
accessor(A) ::= index(B) . { A = B; }
|
137
|
+
|
138
|
+
index(A) ::= YY_INDEX_START indexValue(B) YY_INDEX_END . { A = B; }
|
139
|
+
index(A) ::= YY_INDEX_SOAK index(B) . { A = extend(B, array('soak' => TRUE)); }
|
140
|
+
|
141
|
+
indexValue(A) ::= expression(B) . { A = yy('Index', B); }
|
142
|
+
indexValue(A) ::= slice(B) . { A = yy('Slice', B); }
|
143
|
+
|
144
|
+
object(A) ::= YY_OBJECT_START assignList(B) optComma YY_OBJECT_END . {
|
145
|
+
$object_start = $this->yystack[$this->yyidx - 3]->minor;
|
146
|
+
$generated = isset($object_start->generated) ? $object_start->generated : FALSE;
|
147
|
+
|
148
|
+
A = yy('Obj', B, $generated);
|
149
|
+
}
|
150
|
+
|
151
|
+
assignList(A) ::= . { A = array(); }
|
152
|
+
assignList(A) ::= assignObj(B) . { A = array(B); }
|
153
|
+
assignList(A) ::= assignList(B) YY_COMMA assignObj(C) . { B[] = C; A = B; }
|
154
|
+
assignList(A) ::= assignList(B) optComma YY_TERMINATOR assignObj(C) . { B[] = C; A = B; }
|
155
|
+
assignList(A) ::= assignList(B) optComma YY_INDENT assignList(C) optComma YY_OUTDENT . { A = array_merge(B, C); }
|
156
|
+
|
157
|
+
class(A) ::= YY_CLASS . { A = yy('Class'); }
|
158
|
+
class(A) ::= YY_CLASS block(B) . { A = yy('Class', NULL, NULL, B); }
|
159
|
+
class(A) ::= YY_CLASS YY_EXTENDS expression(B) . { A = yy('Class', NULL, B); }
|
160
|
+
class(A) ::= YY_CLASS YY_EXTENDS expression(B) block(C) . { A = yy('Class', NULL, B, C); }
|
161
|
+
class(A) ::= YY_CLASS simpleAssignable(B) . { A = yy('Class', B); }
|
162
|
+
class(A) ::= YY_CLASS simpleAssignable(B) block(C) . { A = yy('Class', B, NULL, C); }
|
163
|
+
class(A) ::= YY_CLASS simpleAssignable(B) YY_EXTENDS expression(C) . { A = yy('Class', B, C); }
|
164
|
+
class(A) ::= YY_CLASS simpleAssignable(B) YY_EXTENDS expression(C) block(D) . { A = yy('Class', B, C, D); }
|
165
|
+
|
166
|
+
invocation(A) ::= value(B) optFuncExist(C) arguments(D) . { A = yy('Call', B, D, C); }
|
167
|
+
invocation(A) ::= invocation(B) optFuncExist(C) arguments(D) . { A = yy('Call', B, D, C); }
|
168
|
+
invocation(A) ::= YY_SUPER . { A = yy('Call', 'super', array(yy('Splat', yy('Literal', 'arguments')))); }
|
169
|
+
invocation(A) ::= YY_SUPER arguments(B) . { A = yy('Call', 'super', B); }
|
170
|
+
|
171
|
+
optFuncExist(A) ::= . { A = FALSE; }
|
172
|
+
optFuncExist(A) ::= YY_FUNC_EXIST . { A = TRUE; }
|
173
|
+
|
174
|
+
arguments(A) ::= YY_CALL_START YY_CALL_END . { A = array(); }
|
175
|
+
arguments(A) ::= YY_CALL_START argList(B) optComma YY_CALL_END . { A = B; }
|
176
|
+
|
177
|
+
this(A) ::= YY_THIS . { A = yy('Value', yy('Literal', 'this')); }
|
178
|
+
this(A) ::= YY_AT_SIGN . { A = yy('Value', yy('Literal', 'this')); }
|
179
|
+
|
180
|
+
thisProperty(A) ::= YY_AT_SIGN identifier(B) . { A = yy('Value', yy('Literal', 'this'), array(yy('Access', B)), 'this'); }
|
181
|
+
|
182
|
+
array(A) ::= YY_ARRAY_START YY_ARRAY_END . { A = yy('Arr', array()); }
|
183
|
+
array(A) ::= YY_ARRAY_START argList(B) optComma YY_ARRAY_END . { A = yy('Arr', B); }
|
184
|
+
|
185
|
+
rangeDots(A) ::= YY_RANGE_INCLUSIVE . { A = 'inclusive'; }
|
186
|
+
rangeDots(A) ::= YY_RANGE_EXCLUSIVE . { A = 'exclusive'; }
|
187
|
+
|
188
|
+
range(A) ::= YY_ARRAY_START expression(B) rangeDots(C) expression(D) YY_ARRAY_END . { A = yy('Range', B, D, C); }
|
189
|
+
|
190
|
+
slice(A) ::= expression(B) rangeDots(C) expression(D) . { A = yy('Range', B, D, C); }
|
191
|
+
slice(A) ::= expression(B) rangeDots(C) . { A = yy('Range', B, NULL, C); }
|
192
|
+
slice(A) ::= rangeDots(B) expression(C) . { A = yy('Range', NULL, C, B); }
|
193
|
+
slice(A) ::= rangeDots(B) . { A = yy('Range', NULL, NULL, B); }
|
194
|
+
|
195
|
+
argList(A) ::= arg(B) . { A = array(B); }
|
196
|
+
argList(A) ::= argList(B) YY_COMMA arg(C) . { A = array_merge(B, array(C)); }
|
197
|
+
argList(A) ::= argList(B) optComma YY_TERMINATOR arg(C) . { A = array_merge(B, array(C)); }
|
198
|
+
argList(A) ::= YY_INDENT argList(B) optComma YY_OUTDENT . { A = B; }
|
199
|
+
argList(A) ::= argList(B) optComma YY_INDENT argList(C) optComma YY_OUTDENT . { A = array_merge(B, C); }
|
200
|
+
|
201
|
+
arg(A) ::= expression(B) . { A = B; }
|
202
|
+
arg(A) ::= splat(B) . { A = B; }
|
203
|
+
|
204
|
+
simpleArgs(A) ::= expression(B) . { A = B; }
|
205
|
+
simpleArgs(A) ::= simpleArgs(B) YY_COMMA expression(C) . { A = array(B, C); }
|
206
|
+
|
207
|
+
try(A) ::= YY_TRY block(B) . { A = yy('Try', B); }
|
208
|
+
try(A) ::= YY_TRY block(B) catch(C) . { A = yy('Try', B, C[0], C[1]); }
|
209
|
+
try(A) ::= YY_TRY block(B) YY_FINALLY block(C) . { A = yy('Try', B, NULL, NULL, C); }
|
210
|
+
try(A) ::= YY_TRY block(B) catch(C) YY_FINALLY block(D) . { A = yy('Try', B, C[0], C[1], D); }
|
211
|
+
|
212
|
+
catch(A) ::= YY_CATCH identifier(B) block(C) . { A = array(B, C); }
|
213
|
+
|
214
|
+
throw(A) ::= YY_THROW expression(B) . { A = yy('Throw', B); }
|
215
|
+
|
216
|
+
parenthetical(A) ::= YY_PAREN_START body(B) YY_PAREN_END . { A = yy('Parens', B); }
|
217
|
+
parenthetical(A) ::= YY_PAREN_START YY_INDENT body(B) YY_OUTDENT YY_PAREN_END . { A = yy('Parens', B); }
|
218
|
+
|
219
|
+
whileSource(A) ::= YY_WHILE expression(B) . { A = yy('While', B); }
|
220
|
+
whileSource(A) ::= YY_WHILE expression(B) YY_WHEN expression(C) . { A = yy('While', B, array('guard' => C)); }
|
221
|
+
whileSource(A) ::= YY_UNTIL expression(B) . { A = yy('While', B, array('invert' => TRUE)); }
|
222
|
+
whileSource(A) ::= YY_UNTIL expression(B) YY_WHEN expression(C) . { A = yy('While', B, array('invert' => TRUE, 'guard' => C)); }
|
223
|
+
|
224
|
+
while(A) ::= whileSource(B) block(C) . { A = B->add_body(C); }
|
225
|
+
while(A) ::= statement(B) whileSource(C) . { A = C->add_body(yy_Block::wrap(array(B))); }
|
226
|
+
while(A) ::= expression(B) whileSource(C) . { A = C->add_body(yy_Block::wrap(array(B))); }
|
227
|
+
while(A) ::= loop(B) . { A = B; }
|
228
|
+
|
229
|
+
loop(A) ::= YY_LOOP block(B) . { A = yy('While', yy('Literal', 'true')); A->add_body(B); }
|
230
|
+
loop(A) ::= YY_LOOP expression(B) . { A = yy('While', yy('Literal', 'true')); A->add_body(yy_Block::wrap(B)); }
|
231
|
+
|
232
|
+
for(A) ::= statement(B) forBody(C) . { A = yy('For', B, C); }
|
233
|
+
for(A) ::= expression(B) forBody(C) . { A = yy('For', B, C); }
|
234
|
+
for(A) ::= forBody(B) block(C) . { A = yy('For', C, B); }
|
235
|
+
|
236
|
+
forBody(A) ::= YY_FOR range(B) . { A = array('source' => yy('Value', B)); }
|
237
|
+
forBody(A) ::= forStart(B) forSource(C) . { C['own'] = isset(B['own']) ? B['own'] : NULL; C['name'] = B[0]; C['index'] = isset(B[1]) ? B[1] : NULL; A = C; }
|
238
|
+
|
239
|
+
forStart(A) ::= YY_FOR forVariables(B) . { A = B; }
|
240
|
+
forStart(A) ::= YY_FOR YY_OWN forVariables(B) . { B['own'] = TRUE; A = B; }
|
241
|
+
|
242
|
+
forValue(A) ::= identifier(B) . { A = B; }
|
243
|
+
forValue(A) ::= array(B) . { A = yy('Value', B); }
|
244
|
+
forValue(A) ::= object(B) . { A = yy('Value', B); }
|
245
|
+
|
246
|
+
forVariables(A) ::= forValue(B) . { A = array(B); }
|
247
|
+
forVariables(A) ::= forValue(B) YY_COMMA forValue(C) . { A = array(B, C); }
|
248
|
+
|
249
|
+
forSource(A) ::= YY_FORIN expression(B) . { A = array('source' => B); }
|
250
|
+
forSource(A) ::= YY_FOROF expression(B) . { A = array('source' => B, 'object' => TRUE); }
|
251
|
+
forSource(A) ::= YY_FORIN expression(B) YY_WHEN expression(C) . { A = array('source' => B, 'guard' => C); }
|
252
|
+
forSource(A) ::= YY_FOROF expression(B) YY_WHEN expression(C) . { A = array('source' => B, 'guard' => C, 'object' => TRUE); }
|
253
|
+
forSource(A) ::= YY_FORIN expression(B) YY_BY expression(C) . { A = array('source' => B, 'step' => C); }
|
254
|
+
forSource(A) ::= YY_FORIN expression(B) YY_WHEN expression(C) YY_BY expression(D) . { A = array('source' => B, 'guard' => C, 'step' => D); }
|
255
|
+
forSource(A) ::= YY_FORIN expression(B) YY_BY expression(C) YY_WHEN expression(D) . { A = array('source' => B, 'step' => C, 'guard' => D); }
|
256
|
+
|
257
|
+
switch(A) ::= YY_SWITCH expression(B) YY_INDENT whens(C) YY_OUTDENT . { A = yy('Switch', B, C); }
|
258
|
+
switch(A) ::= YY_SWITCH expression(B) YY_INDENT whens(C) YY_ELSE block(D) YY_OUTDENT . { A = yy('Switch', B, C, D); }
|
259
|
+
switch(A) ::= YY_SWITCH YY_INDENT whens(B) YY_OUTDENT . { A = yy('Switch', NULL, B); }
|
260
|
+
switch(A) ::= YY_SWITCH YY_INDENT whens(B) YY_ELSE block(C) YY_OUTDENT . { A = yy('Switch', NULL, B, C); }
|
261
|
+
|
262
|
+
whens(A) ::= when(B) . { A = B; }
|
263
|
+
whens(A) ::= whens(B) when(C) . { A = array_merge(B, C); }
|
264
|
+
|
265
|
+
when(A) ::= YY_LEADING_WHEN simpleArgs(B) block(C) . { A = array(array(B, C)); }
|
266
|
+
when(A) ::= YY_LEADING_WHEN simpleArgs(B) block(C) YY_TERMINATOR . { A = array(array(B, C)); }
|
267
|
+
|
268
|
+
ifBlock(A) ::= YY_IF(B) expression(C) block(D) . { A = yy('If', C, D, array('type' => B)); }
|
269
|
+
ifBlock(A) ::= ifBlock(B) YY_ELSE YY_IF(C) expression(D) block(E) . { A = B->add_else(yy('If', D, E, array('type' => C))); }
|
270
|
+
|
271
|
+
if(A) ::= ifBlock(B) . { A = B; }
|
272
|
+
if(A) ::= ifBlock(B) YY_ELSE block(C) . { A = B->add_else(C); }
|
273
|
+
if(A) ::= statement(B) YY_POST_IF(C) expression(D) . { A = yy('If', D, yy_Block::wrap(array(B)), array('type' => C, 'statement' => TRUE)); }
|
274
|
+
if(A) ::= expression(B) YY_POST_IF(C) expression(D) . { A = yy('If', D, yy_Block::wrap(array(B)), array('type' => C, 'statement' => TRUE)); }
|
275
|
+
|
276
|
+
operation(A) ::= YY_UNARY(B) expression(C) . { A = yy('Op', B, C); }
|
277
|
+
operation(A) ::= YY_MINUS(B) expression(C) . { A = yy('Op', B, C); /* prec: 'UNARY'; */ }
|
278
|
+
operation(A) ::= YY_PLUS(B) expression(C) . { A = yy('Op', B, C); /* prec: 'UNARY'; */ }
|
279
|
+
|
280
|
+
operation(A) ::= YY_DECREMENT(B) simpleAssignable(C) . { A = yy('Op', B, C); }
|
281
|
+
operation(A) ::= YY_INCREMENT(B) simpleAssignable(C) . { A = yy('Op', B, C); }
|
282
|
+
operation(A) ::= simpleAssignable(B) YY_DECREMENT(C) . { A = yy('Op', C, B, NULL, TRUE); }
|
283
|
+
operation(A) ::= simpleAssignable(B) YY_INCREMENT(C) . { A = yy('Op', C, B, NULL, TRUE); }
|
284
|
+
|
285
|
+
operation(A) ::= expression(B) YY_EXISTENTIAL . { A = yy('Existence', B); }
|
286
|
+
|
287
|
+
operation(A) ::= expression(B) YY_PLUS(C) expression(D) . { A = yy('Op', C, B, D); }
|
288
|
+
operation(A) ::= expression(B) YY_MINUS(C) expression(D) . { A = yy('Op', C, B, D); }
|
289
|
+
operation(A) ::= expression(B) YY_MATH(C) expression(D) . { A = yy('Op', C, B, D); }
|
290
|
+
operation(A) ::= expression(B) YY_SHIFT(C) expression(D) . { A = yy('Op', C, B, D); }
|
291
|
+
operation(A) ::= expression(B) YY_COMPARE(C) expression(D) . { A = yy('Op', C, B, D); }
|
292
|
+
operation(A) ::= expression(B) YY_LOGIC(C) expression(D) . { A = yy('Op', C, B, D); }
|
293
|
+
|
294
|
+
operation(A) ::= expression(B) YY_RELATION(C) expression(D) . {
|
295
|
+
if (C{0} === '!') {
|
296
|
+
A = yy('Op', substr(C, 1), B, D);
|
297
|
+
A = A->invert();
|
298
|
+
}
|
299
|
+
else {
|
300
|
+
A = yy('Op', C, B, D);
|
301
|
+
}
|
302
|
+
}
|
303
|
+
|
304
|
+
operation(A) ::= simpleAssignable(B) YY_COMPOUND_ASSIGN(C) expression(D) . { A = yy('Assign', B, D, C); }
|
305
|
+
operation(A) ::= simpleAssignable(B) YY_COMPOUND_ASSIGN(C) YY_INDENT expression(D) YY_OUTDENT . { A = yy('Assign', B, D, C); }
|
306
|
+
operation(A) ::= simpleAssignable(B) YY_EXTENDS expression(C) . { A = yy('Extends', B, C); }
|
307
|
+
|
308
|
+
|
309
|
+
|