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/coffeescript/coffeescript/vendor/ParserGenerator/PHP/ParserGenerator/PropagationLink.php
ADDED
@@ -0,0 +1,126 @@
|
|
1
|
+
<?php
|
2
|
+
/**
|
3
|
+
* PHP_ParserGenerator, a php 5 parser generator.
|
4
|
+
*
|
5
|
+
* This is a direct port of the Lemon parser generator, found at
|
6
|
+
* {@link http://www.hwaci.com/sw/lemon/}
|
7
|
+
*
|
8
|
+
* PHP version 5
|
9
|
+
*
|
10
|
+
* LICENSE:
|
11
|
+
*
|
12
|
+
* Copyright (c) 2006, Gregory Beaver <cellog@php.net>
|
13
|
+
* All rights reserved.
|
14
|
+
*
|
15
|
+
* Redistribution and use in source and binary forms, with or without
|
16
|
+
* modification, are permitted provided that the following conditions
|
17
|
+
* are met:
|
18
|
+
*
|
19
|
+
* * Redistributions of source code must retain the above copyright
|
20
|
+
* notice, this list of conditions and the following disclaimer.
|
21
|
+
* * Redistributions in binary form must reproduce the above copyright
|
22
|
+
* notice, this list of conditions and the following disclaimer in
|
23
|
+
* the documentation and/or other materials provided with the distribution.
|
24
|
+
* * Neither the name of the PHP_ParserGenerator nor the names of its
|
25
|
+
* contributors may be used to endorse or promote products derived
|
26
|
+
* from this software without specific prior written permission.
|
27
|
+
*
|
28
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
29
|
+
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
30
|
+
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
31
|
+
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
32
|
+
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
33
|
+
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
34
|
+
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
35
|
+
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
36
|
+
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
37
|
+
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
38
|
+
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
39
|
+
*
|
40
|
+
* @category PHP
|
41
|
+
* @package PHP_ParserGenerator
|
42
|
+
* @author Gregory Beaver <cellog@php.net>
|
43
|
+
* @copyright 2006 Gregory Beaver
|
44
|
+
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
|
45
|
+
* @version CVS: $Id: PropagationLink.php 302382 2010-08-17 06:08:09Z jespino $
|
46
|
+
* @link http://pear.php.net/package/PHP_ParserGenerator
|
47
|
+
* @since File available since Release 0.1.0
|
48
|
+
*/
|
49
|
+
/**
|
50
|
+
* A followset propagation link indicates that the contents of one
|
51
|
+
* configuration followset should be propagated to another whenever
|
52
|
+
* the first changes.
|
53
|
+
*
|
54
|
+
* @category PHP
|
55
|
+
* @package PHP_ParserGenerator
|
56
|
+
* @author Gregory Beaver <cellog@php.net>
|
57
|
+
* @copyright 2006 Gregory Beaver
|
58
|
+
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
|
59
|
+
* @version Release: @package_version@
|
60
|
+
* @link http://pear.php.net/package/PHP_ParserGenerator
|
61
|
+
* @since Class available since Release 0.1.0
|
62
|
+
*/
|
63
|
+
|
64
|
+
class PHP_ParserGenerator_PropagationLink
|
65
|
+
{
|
66
|
+
/**
|
67
|
+
* The configuration that defines this propagation link
|
68
|
+
*
|
69
|
+
* @var PHP_ParserGenerator_Config
|
70
|
+
*/
|
71
|
+
public $cfp;
|
72
|
+
/**
|
73
|
+
* The next propagation link
|
74
|
+
*
|
75
|
+
* @var PHP_ParserGenerator_PropagationLink|0
|
76
|
+
*/
|
77
|
+
public $next = 0;
|
78
|
+
|
79
|
+
/**
|
80
|
+
* Add a propagation link to the current list
|
81
|
+
*
|
82
|
+
* This prepends the configuration passed in to the first parameter
|
83
|
+
* which is either 0 or a PHP_ParserGenerator_PropagationLink defining
|
84
|
+
* an existing list.
|
85
|
+
*
|
86
|
+
* @param PHP_ParserGenerator_PropagationLink|null
|
87
|
+
* @param PHP_ParserGenerator_Config
|
88
|
+
*/
|
89
|
+
static function Plink_add(&$plpp, PHP_ParserGenerator_Config $cfp)
|
90
|
+
{
|
91
|
+
$new = new PHP_ParserGenerator_PropagationLink;
|
92
|
+
$new->next = $plpp;
|
93
|
+
$plpp = $new;
|
94
|
+
$new->cfp = $cfp;
|
95
|
+
}
|
96
|
+
|
97
|
+
/**
|
98
|
+
* Transfer every propagation link on the list "from" to the list "to"
|
99
|
+
*/
|
100
|
+
static function Plink_copy(PHP_ParserGenerator_PropagationLink &$to, PHP_ParserGenerator_PropagationLink $from)
|
101
|
+
{
|
102
|
+
while ($from) {
|
103
|
+
$nextpl = $from->next;
|
104
|
+
$from->next = $to;
|
105
|
+
$to = $from;
|
106
|
+
$from = $nextpl;
|
107
|
+
}
|
108
|
+
}
|
109
|
+
|
110
|
+
/**
|
111
|
+
* Delete every propagation link on the list
|
112
|
+
*
|
113
|
+
* @param PHP_ParserGenerator_PropagationLink|0
|
114
|
+
*
|
115
|
+
* @return void
|
116
|
+
*/
|
117
|
+
static function Plink_delete($plp)
|
118
|
+
{
|
119
|
+
while ($plp) {
|
120
|
+
$nextpl = $plp->next;
|
121
|
+
$plp->next = 0;
|
122
|
+
$plp = $nextpl;
|
123
|
+
}
|
124
|
+
}
|
125
|
+
}
|
126
|
+
|
@@ -0,0 +1,144 @@
|
|
1
|
+
<?php
|
2
|
+
/**
|
3
|
+
* PHP_ParserGenerator, a php 5 parser generator.
|
4
|
+
*
|
5
|
+
* This is a direct port of the Lemon parser generator, found at
|
6
|
+
* {@link http://www.hwaci.com/sw/lemon/}
|
7
|
+
*
|
8
|
+
* PHP version 5
|
9
|
+
*
|
10
|
+
* LICENSE:
|
11
|
+
*
|
12
|
+
* Copyright (c) 2006, Gregory Beaver <cellog@php.net>
|
13
|
+
* All rights reserved.
|
14
|
+
*
|
15
|
+
* Redistribution and use in source and binary forms, with or without
|
16
|
+
* modification, are permitted provided that the following conditions
|
17
|
+
* are met:
|
18
|
+
*
|
19
|
+
* * Redistributions of source code must retain the above copyright
|
20
|
+
* notice, this list of conditions and the following disclaimer.
|
21
|
+
* * Redistributions in binary form must reproduce the above copyright
|
22
|
+
* notice, this list of conditions and the following disclaimer in
|
23
|
+
* the documentation and/or other materials provided with the distribution.
|
24
|
+
* * Neither the name of the PHP_ParserGenerator nor the names of its
|
25
|
+
* contributors may be used to endorse or promote products derived
|
26
|
+
* from this software without specific prior written permission.
|
27
|
+
*
|
28
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
29
|
+
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
30
|
+
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
31
|
+
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
32
|
+
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
33
|
+
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
34
|
+
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
35
|
+
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
36
|
+
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
37
|
+
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
38
|
+
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
39
|
+
*
|
40
|
+
* @category PHP
|
41
|
+
* @package PHP_ParserGenerator
|
42
|
+
* @author Gregory Beaver <cellog@php.net>
|
43
|
+
* @copyright 2006 Gregory Beaver
|
44
|
+
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
|
45
|
+
* @version CVS: $Id: Rule.php 302382 2010-08-17 06:08:09Z jespino $
|
46
|
+
* @link http://pear.php.net/package/PHP_ParserGenerator
|
47
|
+
* @since File available since Release 0.1.0
|
48
|
+
*/
|
49
|
+
/**
|
50
|
+
* Each production rule in the grammar is stored in this class
|
51
|
+
*
|
52
|
+
* @category PHP
|
53
|
+
* @package PHP_ParserGenerator
|
54
|
+
* @author Gregory Beaver <cellog@php.net>
|
55
|
+
* @copyright 2006 Gregory Beaver
|
56
|
+
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
|
57
|
+
* @version Release: @package_version@
|
58
|
+
* @link http://pear.php.net/package/PHP_ParserGenerator
|
59
|
+
* @since Class available since Release 0.1.0
|
60
|
+
*/
|
61
|
+
class PHP_ParserGenerator_Rule
|
62
|
+
{
|
63
|
+
/**
|
64
|
+
* Left-hand side of the rule
|
65
|
+
* @var array an array of {@link PHP_ParserGenerator_Symbol} objects
|
66
|
+
*/
|
67
|
+
public $lhs;
|
68
|
+
/**
|
69
|
+
* Alias for the LHS (NULL if none)
|
70
|
+
*
|
71
|
+
* @var array
|
72
|
+
*/
|
73
|
+
public $lhsalias = array();
|
74
|
+
/**
|
75
|
+
* Line number for the rule
|
76
|
+
* @var int
|
77
|
+
*/
|
78
|
+
public $ruleline;
|
79
|
+
/**
|
80
|
+
* Number of right-hand side symbols
|
81
|
+
*/
|
82
|
+
public $nrhs;
|
83
|
+
/**
|
84
|
+
* The right-hand side symbols
|
85
|
+
* @var array an array of {@link PHP_ParserGenerator_Symbol} objects
|
86
|
+
*/
|
87
|
+
public $rhs;
|
88
|
+
/**
|
89
|
+
* Aliases for each right-hand side symbol, or null if no alis.
|
90
|
+
*
|
91
|
+
* In this rule:
|
92
|
+
* <pre>
|
93
|
+
* foo ::= BAR(A) baz(B).
|
94
|
+
* </pre>
|
95
|
+
*
|
96
|
+
* The right-hand side aliases are A for BAR, and B for baz.
|
97
|
+
* @var array aliases are indexed by the right-hand side symbol index.
|
98
|
+
*/
|
99
|
+
public $rhsalias = array();
|
100
|
+
/**
|
101
|
+
* Line number at which code begins
|
102
|
+
* @var int
|
103
|
+
*/
|
104
|
+
public $line;
|
105
|
+
/**
|
106
|
+
* The code executed when this rule is reduced
|
107
|
+
*
|
108
|
+
* <pre>
|
109
|
+
* foo(R) ::= BAR(A) baz(B). {R = A + B;}
|
110
|
+
* </pre>
|
111
|
+
*
|
112
|
+
* In the rule above, the code is "R = A + B;"
|
113
|
+
* @var string|0
|
114
|
+
*/
|
115
|
+
public $code;
|
116
|
+
/**
|
117
|
+
* Precedence symbol for this rule
|
118
|
+
* @var PHP_ParserGenerator_Symbol
|
119
|
+
*/
|
120
|
+
public $precsym;
|
121
|
+
/**
|
122
|
+
* An index number for this rule
|
123
|
+
*
|
124
|
+
* Used in both naming of reduce functions and determining which rule code
|
125
|
+
* to use for reduce actions
|
126
|
+
* @var int
|
127
|
+
*/
|
128
|
+
public $index;
|
129
|
+
/**
|
130
|
+
* True if this rule is ever reduced
|
131
|
+
* @var boolean
|
132
|
+
*/
|
133
|
+
public $canReduce;
|
134
|
+
/**
|
135
|
+
* Next rule with the same left-hand side
|
136
|
+
* @var PHP_ParserGenerator_Rule|0
|
137
|
+
*/
|
138
|
+
public $nextlhs;
|
139
|
+
/**
|
140
|
+
* Next rule in the global list
|
141
|
+
* @var PHP_ParserGenerator_Rule|0
|
142
|
+
*/
|
143
|
+
public $next;
|
144
|
+
}
|
@@ -0,0 +1,283 @@
|
|
1
|
+
<?php
|
2
|
+
/**
|
3
|
+
* PHP_ParserGenerator, a php 5 parser generator.
|
4
|
+
*
|
5
|
+
* This is a direct port of the Lemon parser generator, found at
|
6
|
+
* {@link http://www.hwaci.com/sw/lemon/}
|
7
|
+
*
|
8
|
+
* PHP version 5
|
9
|
+
*
|
10
|
+
* LICENSE:
|
11
|
+
*
|
12
|
+
* Copyright (c) 2006, Gregory Beaver <cellog@php.net>
|
13
|
+
* All rights reserved.
|
14
|
+
*
|
15
|
+
* Redistribution and use in source and binary forms, with or without
|
16
|
+
* modification, are permitted provided that the following conditions
|
17
|
+
* are met:
|
18
|
+
*
|
19
|
+
* * Redistributions of source code must retain the above copyright
|
20
|
+
* notice, this list of conditions and the following disclaimer.
|
21
|
+
* * Redistributions in binary form must reproduce the above copyright
|
22
|
+
* notice, this list of conditions and the following disclaimer in
|
23
|
+
* the documentation and/or other materials provided with the distribution.
|
24
|
+
* * Neither the name of the PHP_ParserGenerator nor the names of its
|
25
|
+
* contributors may be used to endorse or promote products derived
|
26
|
+
* from this software without specific prior written permission.
|
27
|
+
*
|
28
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
29
|
+
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
30
|
+
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
31
|
+
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
32
|
+
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
33
|
+
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
34
|
+
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
35
|
+
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
36
|
+
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
37
|
+
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
38
|
+
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
39
|
+
*
|
40
|
+
* @category PHP
|
41
|
+
* @package PHP_ParserGenerator
|
42
|
+
* @author Gregory Beaver <cellog@php.net>
|
43
|
+
* @copyright 2006 Gregory Beaver
|
44
|
+
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
|
45
|
+
* @version CVS: $Id: State.php 302382 2010-08-17 06:08:09Z jespino $
|
46
|
+
* @link http://pear.php.net/package/PHP_ParserGenerator
|
47
|
+
* @since File available since Release 0.1.0
|
48
|
+
*/
|
49
|
+
|
50
|
+
/**
|
51
|
+
* The structure used to represent a state in the associative array
|
52
|
+
* for a PHP_ParserGenerator_Config.
|
53
|
+
*
|
54
|
+
* @category PHP
|
55
|
+
* @package PHP_ParserGenerator
|
56
|
+
* @author Gregory Beaver <cellog@php.net>
|
57
|
+
* @copyright 2006 Gregory Beaver
|
58
|
+
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
|
59
|
+
* @version Release: @package_version@
|
60
|
+
* @link http://pear.php.net/package/PHP_ParserGenerator
|
61
|
+
* @since Class available since Release 0.1.0
|
62
|
+
*/
|
63
|
+
class PHP_ParserGenerator_StateNode
|
64
|
+
{
|
65
|
+
public $key;
|
66
|
+
public $data;
|
67
|
+
public $from = 0;
|
68
|
+
public $next = 0;
|
69
|
+
}
|
70
|
+
|
71
|
+
/**
|
72
|
+
* Each state of the generated parser's finite state machine
|
73
|
+
* is encoded as an instance of this class
|
74
|
+
*
|
75
|
+
* @package PHP_ParserGenerator
|
76
|
+
* @author Gregory Beaver <cellog@php.net>
|
77
|
+
* @copyright 2006 Gregory Beaver
|
78
|
+
* @license http://www.php.net/license/3_01.txt PHP License 3.01
|
79
|
+
* @version Release: @package_version@
|
80
|
+
* @link http://pear.php.net/package/PHP_ParserGenerator
|
81
|
+
* @since Class available since Release 0.1.0
|
82
|
+
*/
|
83
|
+
class PHP_ParserGenerator_State
|
84
|
+
{
|
85
|
+
/**
|
86
|
+
* The basis configurations for this state
|
87
|
+
* @var PHP_ParserGenerator_Config
|
88
|
+
*/
|
89
|
+
public $bp;
|
90
|
+
/**
|
91
|
+
* All configurations in this state
|
92
|
+
* @var PHP_ParserGenerator_Config
|
93
|
+
*/
|
94
|
+
public $cfp;
|
95
|
+
/**
|
96
|
+
* Sequential number for this state
|
97
|
+
*
|
98
|
+
* @var int
|
99
|
+
*/
|
100
|
+
public $statenum;
|
101
|
+
/**
|
102
|
+
* Linked list of actions for this state.
|
103
|
+
* @var PHP_ParserGenerator_Action
|
104
|
+
*/
|
105
|
+
public $ap;
|
106
|
+
/**
|
107
|
+
* Number of terminal (token) actions
|
108
|
+
*
|
109
|
+
* @var int
|
110
|
+
*/
|
111
|
+
public $nTknAct,
|
112
|
+
/**
|
113
|
+
* Number of non-terminal actions
|
114
|
+
*
|
115
|
+
* @var int
|
116
|
+
*/
|
117
|
+
$nNtAct;
|
118
|
+
/**
|
119
|
+
* The offset into the $yy_action table for terminal tokens.
|
120
|
+
*
|
121
|
+
* @var int
|
122
|
+
*/
|
123
|
+
public $iTknOfst,
|
124
|
+
/**
|
125
|
+
* The offset into the $yy_action table for non-terminals.
|
126
|
+
*
|
127
|
+
* @var int
|
128
|
+
*/
|
129
|
+
$iNtOfst;
|
130
|
+
/**
|
131
|
+
* Default action
|
132
|
+
*
|
133
|
+
* @var int
|
134
|
+
*/
|
135
|
+
public $iDflt;
|
136
|
+
/**
|
137
|
+
* Associative array of PHP_ParserGenerator_State objects
|
138
|
+
*
|
139
|
+
* @var array
|
140
|
+
*/
|
141
|
+
public static $x3a = array();
|
142
|
+
/**
|
143
|
+
* Array of PHP_ParserGenerator_State objects
|
144
|
+
*
|
145
|
+
* @var array
|
146
|
+
*/
|
147
|
+
public static $states = array();
|
148
|
+
|
149
|
+
/**
|
150
|
+
* Compare two states for sorting purposes. The smaller state is the
|
151
|
+
* one with the most non-terminal actions. If they have the same number
|
152
|
+
* of non-terminal actions, then the smaller is the one with the most
|
153
|
+
* token actions.
|
154
|
+
*/
|
155
|
+
static function stateResortCompare($a, $b)
|
156
|
+
{
|
157
|
+
$n = $b->nNtAct - $a->nNtAct;
|
158
|
+
if ($n === 0) {
|
159
|
+
$n = $b->nTknAct - $a->nTknAct;
|
160
|
+
}
|
161
|
+
return $n;
|
162
|
+
}
|
163
|
+
|
164
|
+
/**
|
165
|
+
* Compare two states based on their configurations
|
166
|
+
*
|
167
|
+
* @param PHP_ParserGenerator_Config|0 $a
|
168
|
+
* @param PHP_ParserGenerator_Config|0 $b
|
169
|
+
* @return int
|
170
|
+
*/
|
171
|
+
static function statecmp($a, $b)
|
172
|
+
{
|
173
|
+
for ($rc = 0; $rc == 0 && $a && $b; $a = $a->bp, $b = $b->bp) {
|
174
|
+
$rc = $a->rp->index - $b->rp->index;
|
175
|
+
if ($rc === 0) {
|
176
|
+
$rc = $a->dot - $b->dot;
|
177
|
+
}
|
178
|
+
}
|
179
|
+
if ($rc == 0) {
|
180
|
+
if ($a) {
|
181
|
+
$rc = 1;
|
182
|
+
}
|
183
|
+
if ($b) {
|
184
|
+
$rc = -1;
|
185
|
+
}
|
186
|
+
}
|
187
|
+
return $rc;
|
188
|
+
}
|
189
|
+
|
190
|
+
/**
|
191
|
+
* Hash a state based on its configuration
|
192
|
+
*
|
193
|
+
* @return int
|
194
|
+
*/
|
195
|
+
private static function statehash(PHP_ParserGenerator_Config $a)
|
196
|
+
{
|
197
|
+
$h = 0;
|
198
|
+
while ($a) {
|
199
|
+
$h = $h * 571 + $a->rp->index * 37 + $a->dot;
|
200
|
+
$a = $a->bp;
|
201
|
+
}
|
202
|
+
return (int) $h;
|
203
|
+
}
|
204
|
+
|
205
|
+
/**
|
206
|
+
* Return a pointer to data assigned to the given key. Return NULL
|
207
|
+
* if no such key.
|
208
|
+
* @param PHP_ParserGenerator_Config
|
209
|
+
* @return null|PHP_ParserGenerator_State
|
210
|
+
*/
|
211
|
+
static function State_find(PHP_ParserGenerator_Config $key)
|
212
|
+
{
|
213
|
+
if (!count(self::$x3a)) {
|
214
|
+
return 0;
|
215
|
+
}
|
216
|
+
$h = self::statehash($key);
|
217
|
+
if (!isset(self::$x3a[$h])) {
|
218
|
+
return 0;
|
219
|
+
}
|
220
|
+
$np = self::$x3a[$h];
|
221
|
+
while ($np) {
|
222
|
+
if (self::statecmp($np->key, $key) == 0) {
|
223
|
+
break;
|
224
|
+
}
|
225
|
+
$np = $np->next;
|
226
|
+
}
|
227
|
+
return $np ? $np->data : 0;
|
228
|
+
}
|
229
|
+
|
230
|
+
/**
|
231
|
+
* Insert a new record into the array. Return TRUE if successful.
|
232
|
+
* Prior data with the same key is NOT overwritten
|
233
|
+
*
|
234
|
+
* @param PHP_ParserGenerator_State $state
|
235
|
+
* @param PHP_ParserGenerator_Config $key
|
236
|
+
* @return unknown
|
237
|
+
*/
|
238
|
+
static function State_insert(PHP_ParserGenerator_State $state, PHP_ParserGenerator_Config $key)
|
239
|
+
{
|
240
|
+
$h = self::statehash($key);
|
241
|
+
if (isset(self::$x3a[$h])) {
|
242
|
+
$np = self::$x3a[$h];
|
243
|
+
} else {
|
244
|
+
$np = 0;
|
245
|
+
}
|
246
|
+
while ($np) {
|
247
|
+
if (self::statecmp($np->key, $key) == 0) {
|
248
|
+
/* An existing entry with the same key is found. */
|
249
|
+
/* Fail because overwrite is not allows. */
|
250
|
+
return 0;
|
251
|
+
}
|
252
|
+
$np = $np->next;
|
253
|
+
}
|
254
|
+
/* Insert the new data */
|
255
|
+
$np = new PHP_ParserGenerator_StateNode;
|
256
|
+
$np->key = $key;
|
257
|
+
$np->data = $state;
|
258
|
+
self::$states[] = $np;
|
259
|
+
// the original lemon code sets the from link always to itself
|
260
|
+
// setting up a faulty double-linked list
|
261
|
+
// however, the from links are never used, so I suspect a copy/paste
|
262
|
+
// error from a standard algorithm that was never caught
|
263
|
+
if (isset(self::$x3a[$h])) {
|
264
|
+
self::$x3a[$h]->from = $np; // lemon has $np->next here
|
265
|
+
} else {
|
266
|
+
self::$x3a[$h] = 0; // dummy to avoid notice
|
267
|
+
}
|
268
|
+
$np->next = self::$x3a[$h];
|
269
|
+
self::$x3a[$h] = $np;
|
270
|
+
$np->from = self::$x3a[$h];
|
271
|
+
return 1;
|
272
|
+
}
|
273
|
+
|
274
|
+
/**
|
275
|
+
* Get an array indexed by state number
|
276
|
+
*
|
277
|
+
* @return array
|
278
|
+
*/
|
279
|
+
static function State_arrayof()
|
280
|
+
{
|
281
|
+
return self::$states;
|
282
|
+
}
|
283
|
+
}
|