@flarum/cli 2.0.0-beta.9 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +161 -49
- package/bin/run +2 -1
- package/bin/splitsh-lite-darwin +0 -0
- package/bin/splitsh-lite-linux +0 -0
- package/boilerplate/skeleton/extension/.gitattributes +16 -14
- package/boilerplate/skeleton/extension/.github/workflows/backend.yml +2 -6
- package/boilerplate/skeleton/extension/.github/workflows/frontend.yml +4 -6
- package/boilerplate/skeleton/extension/LICENSE.md +1 -1
- package/boilerplate/skeleton/extension/README.md +1 -1
- package/boilerplate/skeleton/extension/composer.json +6 -4
- package/boilerplate/skeleton/extension/extend.php +2 -2
- package/boilerplate/skeleton/extension/js/admin.ts +2 -0
- package/boilerplate/skeleton/extension/js/forum.ts +2 -0
- package/boilerplate/skeleton/extension/js/package.json +5 -1
- package/boilerplate/skeleton/extension/js/src/admin/index.ts +5 -0
- package/boilerplate/skeleton/extension/js/src/common/index.ts +5 -0
- package/boilerplate/skeleton/extension/js/src/forum/index.ts +5 -0
- package/boilerplate/skeleton/extension/js/tsconfig.json +10 -2
- package/boilerplate/skeleton/extension/locale/en.yml +1 -1
- package/boilerplate/skeleton/extension/tests/phpunit.integration.xml +1 -0
- package/lib/base-command.d.ts +3 -1
- package/lib/base-command.js +44 -31
- package/lib/boilersmith/io.d.ts +28 -8
- package/lib/boilersmith/io.js +4 -2
- package/lib/boilersmith/paths.d.ts +2 -2
- package/lib/boilersmith/paths.js +7 -7
- package/lib/boilersmith/scaffolding/audit-step-factory.js +11 -11
- package/lib/boilersmith/scaffolding/infra-step-factory.js +2 -2
- package/lib/boilersmith/scaffolding/init-step-factory.js +5 -5
- package/lib/boilersmith/scaffolding/module.d.ts +28 -8
- package/lib/boilersmith/scaffolding/module.js +59 -17
- package/lib/boilersmith/scaffolding/scaffolder.d.ts +4 -1
- package/lib/boilersmith/scaffolding/scaffolder.js +32 -32
- package/lib/boilersmith/scaffolding/template-param.d.ts +1 -1
- package/lib/boilersmith/scaffolding/template-param.js +2 -2
- package/lib/boilersmith/step-manager.d.ts +0 -1
- package/lib/boilersmith/step-manager.js +10 -20
- package/lib/boilersmith/steps/stub-base.js +3 -3
- package/lib/boilersmith/utils/clone-and-fill.js +1 -1
- package/lib/boilersmith/utils/commit-async.d.ts +2 -0
- package/lib/boilersmith/utils/commit-async.js +15 -0
- package/lib/boilersmith/utils/read-tpl.js +2 -2
- package/lib/commands/audit/infra.d.ts +1 -1
- package/lib/commands/audit/infra.js +30 -8
- package/lib/commands/flarum/change.d.ts +16 -0
- package/lib/commands/flarum/change.js +103 -0
- package/lib/commands/flarum/info.d.ts +5 -0
- package/lib/commands/flarum/info.js +17 -0
- package/lib/commands/infra.d.ts +2 -2
- package/lib/commands/infra.js +18 -12
- package/lib/commands/init.d.ts +1 -1
- package/lib/commands/init.js +4 -2
- package/lib/commands/make/backend/api-controller.js +1 -2
- package/lib/commands/make/backend/api-serializer-attributes.js +1 -2
- package/lib/commands/make/backend/command.js +1 -2
- package/lib/commands/make/backend/event-listener.js +1 -2
- package/lib/commands/make/backend/handler.js +2 -5
- package/lib/commands/make/backend/integration-test.js +2 -4
- package/lib/commands/make/backend/migration.js +1 -2
- package/lib/commands/make/backend/model.js +1 -2
- package/lib/commands/make/backend/policy.js +1 -2
- package/lib/commands/make/backend/route.js +1 -2
- package/lib/commands/make/backend/service-provider.js +1 -2
- package/lib/commands/make/frontend/model.js +2 -5
- package/lib/commands/monorepo/create.d.ts +15 -0
- package/lib/commands/monorepo/create.js +20 -0
- package/lib/commands/monorepo/split.d.ts +15 -0
- package/lib/commands/monorepo/split.js +19 -0
- package/lib/commands/update/js-imports.js +1 -2
- package/lib/help.js +1 -1
- package/lib/providers/php-provider.js +2 -2
- package/lib/steps/gen-ext-scaffolder.d.ts +2 -2
- package/lib/steps/gen-ext-scaffolder.js +185 -51
- package/lib/steps/js/base.js +2 -4
- package/lib/steps/js/model.js +4 -4
- package/lib/steps/misc/composer.js +2 -2
- package/lib/steps/misc/git.d.ts +1 -1
- package/lib/steps/misc/git.js +2 -2
- package/lib/steps/misc/npm.d.ts +11 -0
- package/lib/steps/misc/npm.js +19 -0
- package/lib/steps/misc/yarn.js +2 -2
- package/lib/steps/monorepo/create.d.ts +17 -0
- package/lib/steps/monorepo/create.js +186 -0
- package/lib/steps/monorepo/split.d.ts +14 -0
- package/lib/steps/monorepo/split.js +99 -0
- package/lib/steps/stubs/backend/api-controller.d.ts +1 -1
- package/lib/steps/stubs/backend/api-controller.js +3 -0
- package/lib/steps/stubs/backend/api-serializer.d.ts +1 -1
- package/lib/steps/stubs/backend/api-serializer.js +3 -0
- package/lib/steps/stubs/backend/command.d.ts +0 -5
- package/lib/steps/stubs/backend/command.js +1 -0
- package/lib/steps/stubs/backend/event-listener.d.ts +1 -1
- package/lib/steps/stubs/backend/event-listener.js +2 -0
- package/lib/steps/stubs/backend/handler-command.d.ts +1 -1
- package/lib/steps/stubs/backend/handler-command.js +1 -0
- package/lib/steps/stubs/backend/handler.d.ts +1 -1
- package/lib/steps/stubs/backend/handler.js +4 -0
- package/lib/steps/stubs/backend/integration-test.d.ts +1 -1
- package/lib/steps/stubs/backend/integration-test.js +2 -0
- package/lib/steps/stubs/backend/job.d.ts +1 -1
- package/lib/steps/stubs/backend/job.js +1 -0
- package/lib/steps/stubs/backend/migration.js +6 -3
- package/lib/steps/stubs/backend/model.d.ts +1 -1
- package/lib/steps/stubs/backend/model.js +1 -0
- package/lib/steps/stubs/backend/policy.d.ts +1 -1
- package/lib/steps/stubs/backend/policy.js +2 -0
- package/lib/steps/stubs/backend/repository.d.ts +1 -1
- package/lib/steps/stubs/backend/repository.js +2 -0
- package/lib/steps/stubs/backend/service-provider.d.ts +1 -1
- package/lib/steps/stubs/backend/service-provider.js +1 -0
- package/lib/steps/stubs/backend/validator.d.ts +1 -1
- package/lib/steps/stubs/backend/validator.js +1 -0
- package/lib/steps/stubs/flarum-base.js +1 -1
- package/lib/steps/stubs/frontend/component.d.ts +0 -5
- package/lib/steps/stubs/frontend/component.js +1 -0
- package/lib/steps/stubs/frontend/modal.d.ts +0 -5
- package/lib/steps/stubs/frontend/modal.js +1 -0
- package/lib/steps/stubs/frontend/model.d.ts +0 -5
- package/lib/steps/stubs/frontend/model.js +1 -0
- package/lib/steps/stubs/js-base.js +8 -5
- package/lib/steps/stubs/php-base.js +10 -8
- package/lib/steps/update/js-imports.js +8 -2
- package/lib/utils/composer.d.ts +1 -0
- package/lib/utils/migration.js +3 -1
- package/lib/utils/monorepo.d.ts +24 -0
- package/lib/utils/monorepo.js +24 -0
- package/lib/utils/validation.d.ts +2 -0
- package/lib/utils/validation.js +6 -0
- package/oclif.manifest.json +1 -1
- package/package.json +12 -5
- package/php-subsystem/composer.json +9 -9
- package/php-subsystem/composer.lock +64 -71
- package/php-subsystem/vendor/composer/installed.json +54 -61
- package/php-subsystem/vendor/nikic/php-parser/README.md +55 -59
- package/php-subsystem/vendor/nikic/php-parser/composer.json +39 -39
- package/php-subsystem/vendor/nikic/php-parser/grammar/README.md +17 -20
|
@@ -1,65 +1,58 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
2
|
+
"packages": [
|
|
3
|
+
{
|
|
4
|
+
"name": "nikic/php-parser",
|
|
5
|
+
"version": "v4.10.5",
|
|
6
|
+
"version_normalized": "4.10.5.0",
|
|
7
|
+
"source": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/nikic/PHP-Parser.git",
|
|
10
|
+
"reference": "4432ba399e47c66624bc73c8c0f811e5c109576f"
|
|
11
|
+
},
|
|
12
|
+
"dist": {
|
|
13
|
+
"type": "zip",
|
|
14
|
+
"url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/4432ba399e47c66624bc73c8c0f811e5c109576f",
|
|
15
|
+
"reference": "4432ba399e47c66624bc73c8c0f811e5c109576f",
|
|
16
|
+
"shasum": ""
|
|
17
|
+
},
|
|
18
|
+
"require": {
|
|
19
|
+
"ext-tokenizer": "*",
|
|
20
|
+
"php": ">=7.0"
|
|
21
|
+
},
|
|
22
|
+
"require-dev": {
|
|
23
|
+
"ircmaxell/php-yacc": "^0.0.7",
|
|
24
|
+
"phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0"
|
|
25
|
+
},
|
|
26
|
+
"time": "2021-05-03T19:11:20+00:00",
|
|
27
|
+
"bin": ["bin/php-parse"],
|
|
28
|
+
"type": "library",
|
|
29
|
+
"extra": {
|
|
30
|
+
"branch-alias": {
|
|
31
|
+
"dev-master": "4.9-dev"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"installation-source": "dist",
|
|
35
|
+
"autoload": {
|
|
36
|
+
"psr-4": {
|
|
37
|
+
"PhpParser\\": "lib/PhpParser"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"notification-url": "https://packagist.org/downloads/",
|
|
41
|
+
"license": ["BSD-3-Clause"],
|
|
42
|
+
"authors": [
|
|
3
43
|
{
|
|
4
|
-
|
|
5
|
-
"version": "v4.10.5",
|
|
6
|
-
"version_normalized": "4.10.5.0",
|
|
7
|
-
"source": {
|
|
8
|
-
"type": "git",
|
|
9
|
-
"url": "https://github.com/nikic/PHP-Parser.git",
|
|
10
|
-
"reference": "4432ba399e47c66624bc73c8c0f811e5c109576f"
|
|
11
|
-
},
|
|
12
|
-
"dist": {
|
|
13
|
-
"type": "zip",
|
|
14
|
-
"url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/4432ba399e47c66624bc73c8c0f811e5c109576f",
|
|
15
|
-
"reference": "4432ba399e47c66624bc73c8c0f811e5c109576f",
|
|
16
|
-
"shasum": ""
|
|
17
|
-
},
|
|
18
|
-
"require": {
|
|
19
|
-
"ext-tokenizer": "*",
|
|
20
|
-
"php": ">=7.0"
|
|
21
|
-
},
|
|
22
|
-
"require-dev": {
|
|
23
|
-
"ircmaxell/php-yacc": "^0.0.7",
|
|
24
|
-
"phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0"
|
|
25
|
-
},
|
|
26
|
-
"time": "2021-05-03T19:11:20+00:00",
|
|
27
|
-
"bin": [
|
|
28
|
-
"bin/php-parse"
|
|
29
|
-
],
|
|
30
|
-
"type": "library",
|
|
31
|
-
"extra": {
|
|
32
|
-
"branch-alias": {
|
|
33
|
-
"dev-master": "4.9-dev"
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
"installation-source": "dist",
|
|
37
|
-
"autoload": {
|
|
38
|
-
"psr-4": {
|
|
39
|
-
"PhpParser\\": "lib/PhpParser"
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
"notification-url": "https://packagist.org/downloads/",
|
|
43
|
-
"license": [
|
|
44
|
-
"BSD-3-Clause"
|
|
45
|
-
],
|
|
46
|
-
"authors": [
|
|
47
|
-
{
|
|
48
|
-
"name": "Nikita Popov"
|
|
49
|
-
}
|
|
50
|
-
],
|
|
51
|
-
"description": "A PHP parser written in PHP",
|
|
52
|
-
"keywords": [
|
|
53
|
-
"parser",
|
|
54
|
-
"php"
|
|
55
|
-
],
|
|
56
|
-
"support": {
|
|
57
|
-
"issues": "https://github.com/nikic/PHP-Parser/issues",
|
|
58
|
-
"source": "https://github.com/nikic/PHP-Parser/tree/v4.10.5"
|
|
59
|
-
},
|
|
60
|
-
"install-path": "../nikic/php-parser"
|
|
44
|
+
"name": "Nikita Popov"
|
|
61
45
|
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
46
|
+
],
|
|
47
|
+
"description": "A PHP parser written in PHP",
|
|
48
|
+
"keywords": ["parser", "php"],
|
|
49
|
+
"support": {
|
|
50
|
+
"issues": "https://github.com/nikic/PHP-Parser/issues",
|
|
51
|
+
"source": "https://github.com/nikic/PHP-Parser/tree/v4.10.5"
|
|
52
|
+
},
|
|
53
|
+
"install-path": "../nikic/php-parser"
|
|
54
|
+
}
|
|
55
|
+
],
|
|
56
|
+
"dev": true,
|
|
57
|
+
"dev-package-names": []
|
|
65
58
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
PHP Parser
|
|
2
|
-
==========
|
|
1
|
+
# PHP Parser
|
|
3
2
|
|
|
4
3
|
[](https://coveralls.io/github/nikic/PHP-Parser?branch=master)
|
|
5
4
|
|
|
@@ -10,25 +9,23 @@ manipulation.
|
|
|
10
9
|
|
|
11
10
|
[Documentation for version 3.x][doc_3_x] (unsupported; for running on PHP >= 5.5; for parsing PHP 5.2 to PHP 7.2).
|
|
12
11
|
|
|
13
|
-
Features
|
|
14
|
-
--------
|
|
12
|
+
## Features
|
|
15
13
|
|
|
16
14
|
The main features provided by this library are:
|
|
17
15
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
Quick Start
|
|
31
|
-
-----------
|
|
16
|
+
- Parsing PHP 5, PHP 7, and PHP 8 code into an abstract syntax tree (AST).
|
|
17
|
+
- Invalid code can be parsed into a partial AST.
|
|
18
|
+
- The AST contains accurate location information.
|
|
19
|
+
- Dumping the AST in human-readable form.
|
|
20
|
+
- Converting an AST back to PHP code.
|
|
21
|
+
- Experimental: Formatting can be preserved for partially changed ASTs.
|
|
22
|
+
- Infrastructure to traverse and modify ASTs.
|
|
23
|
+
- Resolution of namespaced names.
|
|
24
|
+
- Evaluation of constant expressions.
|
|
25
|
+
- Builders to simplify AST construction for code generation.
|
|
26
|
+
- Converting an AST into JSON and back.
|
|
27
|
+
|
|
28
|
+
## Quick Start
|
|
32
29
|
|
|
33
30
|
Install the library using [composer](https://getcomposer.org):
|
|
34
31
|
|
|
@@ -178,48 +175,47 @@ function test($foo)
|
|
|
178
175
|
|
|
179
176
|
For a more comprehensive introduction, see the documentation.
|
|
180
177
|
|
|
181
|
-
Documentation
|
|
182
|
-
-------------
|
|
178
|
+
## Documentation
|
|
183
179
|
|
|
184
|
-
|
|
185
|
-
|
|
180
|
+
1. [Introduction](doc/0_Introduction.markdown)
|
|
181
|
+
2. [Usage of basic components](doc/2_Usage_of_basic_components.markdown)
|
|
186
182
|
|
|
187
183
|
Component documentation:
|
|
188
184
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
185
|
+
- [Walking the AST](doc/component/Walking_the_AST.markdown)
|
|
186
|
+
- Node visitors
|
|
187
|
+
- Modifying the AST from a visitor
|
|
188
|
+
- Short-circuiting traversals
|
|
189
|
+
- Interleaved visitors
|
|
190
|
+
- Simple node finding API
|
|
191
|
+
- Parent and sibling references
|
|
192
|
+
- [Name resolution](doc/component/Name_resolution.markdown)
|
|
193
|
+
- Name resolver options
|
|
194
|
+
- Name resolution context
|
|
195
|
+
- [Pretty printing](doc/component/Pretty_printing.markdown)
|
|
196
|
+
- Converting AST back to PHP code
|
|
197
|
+
- Customizing formatting
|
|
198
|
+
- Formatting-preserving code transformations
|
|
199
|
+
- [AST builders](doc/component/AST_builders.markdown)
|
|
200
|
+
- Fluent builders for AST nodes
|
|
201
|
+
- [Lexer](doc/component/Lexer.markdown)
|
|
202
|
+
- Lexer options
|
|
203
|
+
- Token and file positions for nodes
|
|
204
|
+
- Custom attributes
|
|
205
|
+
- [Error handling](doc/component/Error_handling.markdown)
|
|
206
|
+
- Column information for errors
|
|
207
|
+
- Error recovery (parsing of syntactically incorrect code)
|
|
208
|
+
- [Constant expression evaluation](doc/component/Constant_expression_evaluation.markdown)
|
|
209
|
+
- Evaluating constant/property/etc initializers
|
|
210
|
+
- Handling errors and unsupported expressions
|
|
211
|
+
- [JSON representation](doc/component/JSON_representation.markdown)
|
|
212
|
+
- JSON encoding and decoding of ASTs
|
|
213
|
+
- [Performance](doc/component/Performance.markdown)
|
|
214
|
+
- Disabling XDebug
|
|
215
|
+
- Reusing objects
|
|
216
|
+
- Garbage collection impact
|
|
217
|
+
- [Frequently asked questions](doc/component/FAQ.markdown)
|
|
218
|
+
- Parent and sibling references
|
|
219
|
+
|
|
220
|
+
[doc_3_x]: https://github.com/nikic/PHP-Parser/tree/3.x/doc
|
|
221
|
+
[doc_master]: https://github.com/nikic/PHP-Parser/tree/master/doc
|
|
@@ -1,41 +1,41 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
2
|
+
"name": "nikic/php-parser",
|
|
3
|
+
"type": "library",
|
|
4
|
+
"description": "A PHP parser written in PHP",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"php",
|
|
7
|
+
"parser"
|
|
8
|
+
],
|
|
9
|
+
"license": "BSD-3-Clause",
|
|
10
|
+
"authors": [
|
|
11
|
+
{
|
|
12
|
+
"name": "Nikita Popov"
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
"require": {
|
|
16
|
+
"php": ">=7.0",
|
|
17
|
+
"ext-tokenizer": "*"
|
|
18
|
+
},
|
|
19
|
+
"require-dev": {
|
|
20
|
+
"phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0",
|
|
21
|
+
"ircmaxell/php-yacc": "^0.0.7"
|
|
22
|
+
},
|
|
23
|
+
"extra": {
|
|
24
|
+
"branch-alias": {
|
|
25
|
+
"dev-master": "4.9-dev"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"autoload": {
|
|
29
|
+
"psr-4": {
|
|
30
|
+
"PhpParser\\": "lib/PhpParser"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"autoload-dev": {
|
|
34
|
+
"psr-4": {
|
|
35
|
+
"PhpParser\\": "test/PhpParser/"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"bin": [
|
|
39
|
+
"bin/php-parse"
|
|
40
|
+
]
|
|
41
41
|
}
|
|
@@ -1,30 +1,27 @@
|
|
|
1
|
-
What do all those files mean?
|
|
2
|
-
=============================
|
|
1
|
+
# What do all those files mean?
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
- `php5.y`: PHP 5 grammar written in a pseudo language
|
|
4
|
+
- `php7.y`: PHP 7 grammar written in a pseudo language
|
|
5
|
+
- `tokens.y`: Tokens definition shared between PHP 5 and PHP 7 grammars
|
|
6
|
+
- `parser.template`: A `kmyacc` parser prototype file for PHP
|
|
7
|
+
- `tokens.template`: A `kmyacc` prototype file for the `Tokens` class
|
|
8
|
+
- `rebuildParsers.php`: Preprocesses the grammar and builds the parser using `kmyacc`
|
|
10
9
|
|
|
11
|
-
.phpy pseudo language
|
|
12
|
-
=====================
|
|
10
|
+
# .phpy pseudo language
|
|
13
11
|
|
|
14
12
|
The `.y` file is a normal grammar in `kmyacc` (`yacc`) style, with some transformations
|
|
15
13
|
applied to it:
|
|
16
14
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
- Nodes are created using the syntax `Name[..., ...]`. This is transformed into
|
|
16
|
+
`new Name(..., ..., attributes())`
|
|
17
|
+
- Some function-like constructs are resolved (see `rebuildParsers.php` for a list)
|
|
20
18
|
|
|
21
|
-
Building the parser
|
|
22
|
-
===================
|
|
19
|
+
# Building the parser
|
|
23
20
|
|
|
24
21
|
Run `php grammar/rebuildParsers.php` to rebuild the parsers. Additional options:
|
|
25
22
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
23
|
+
- The `KMYACC` environment variable can be used to specify an alternative `kmyacc` binary.
|
|
24
|
+
By default the `phpyacc` dev dependency will be used. To use the original `kmyacc`, you
|
|
25
|
+
need to compile [moriyoshi's fork](https://github.com/moriyoshi/kmyacc-forked).
|
|
26
|
+
- The `--debug` option enables emission of debug symbols and creates the `y.output` file.
|
|
27
|
+
- The `--keep-tmp-grammar` option preserves the preprocessed grammar file.
|