com php-langspec: Fix markdown and grammar tool: spec/00-specification-for-php.md tools/grammar.php

From: Date: Sun, 17 Sep 2017 13:41:02 +0000
Subject: com php-langspec: Fix markdown and grammar tool: spec/00-specification-for-php.md tools/grammar.php
Groups: php.standards.cvs 
Request: Send a blank email to standards--cvs+get-382@lists.php.net to get a copy of this message
Commit: 993ab3eb81f3529ae0ad5b534a2396405306fe00 Author: ekinhbayar <ekin@coproductivity.com> Sat, 6 May 2017 18:32:56 +0300 Committer: Nikita Popov <nikic@php.net> Sun, 17 Sep 2017 15:41:02 +0200 Parents: befef5a037689d587b159933c21f334c39151170 Branches: master Link: http://git.php.net/?p=php-langspec.git;a=commitdiff;h=993ab3eb81f3529ae0ad5b534a2396405306fe00 Log: Fix markdown and grammar tool Changed paths: M spec/00-specification-for-php.md M tools/grammar.php Diff: diff --git a/spec/00-specification-for-php.md b/spec/00-specification-for-php.md index a40f29d..d2d2f4c 100644 --- a/spec/00-specification-for-php.md +++ b/spec/00-specification-for-php.md @@ -1,7 +1,7 @@ <!-- This file is autogenerated, do not edit it manually --> <!-- Run tools/toc.php instead --> -#Specification for PHP +# Specification for PHP Facebook has dedicated all copyright to this specification to the public domain worldwide under the CC0 Public Domain Dedication located at <http://creativecommons.org/publicdomain/zero/1.0/>. This specification diff --git a/tools/grammar.php b/tools/grammar.php index 289aea4..a749450 100644 --- a/tools/grammar.php +++ b/tools/grammar.php @@ -48,22 +48,22 @@ $dir = __DIR__ . '/../spec/'; $grammarFile = $dir . '19-grammar.md'; $output = <<<'END' -#Grammar +# Grammar -##General +## General The grammar notation is described in [Grammars section](09-lexical-structure.md#grammars). -##Lexical Grammar +## Lexical Grammar END; $lexical = file_get_contents($dir . '09-lexical-structure.md'); -$lexical = strstr($lexical, '##Lexical analysis'); +$lexical = strstr($lexical, '## Lexical analysis'); $output .= extract_grammar($lexical, $names); -$output .= "\n\n##Syntactic Grammar"; +$output .= "\n\n## Syntactic Grammar"; $skipFiles = ['05-types.md', '09-lexical-structure.md', '19-grammar.md']; foreach (spec_files($skipFiles) as $fileName => $path) { @@ -74,7 +74,7 @@ foreach (spec_files($skipFiles) as $fileName => $path) { } $heading = extract_heading($code); - $output .= "\n\n###$heading\n\n" . $grammar; + $output .= "\n\n### $heading\n\n" . $grammar; } $output .= "\n";

« previous php.standards.cvs (#382) next »