grammars-v4
grammars-v4 copied to clipboard
Updated PHP Grammar Documentation about Python Runtimes
Added a section in the README.md of the PHP Grammar so that users can address the issue that is reported in #2730
I've followed the suggestion by @kaby76 in the discussion of #2730 and added a script to transform the Grammar
Please also remove the "php" line from the skip-python3.txt file. The file tells the build script to "skip" doing the build for the "php/" grammar. When the line is removed, the build will attempt to run regression tests on the grammar.
Ok done.
Almost there.
- The directory php/Python/ should be renamed php/Python3/. There really isn't a "Python" target, but either "Python2" or "Python3". The build script checks for the directory corresponding to the target, then copies the code to the directory containing the .g4 files.
- There are two syntax errors in PhpLexer.py. To correct, update transformGrammar.py with the a few lines to change "true" to "True". Context is added because there is a grammar option with "true" that shouldn't be changed.
$ diff dkazantzas/php/Python/transformGrammar.py dkazantzas2/php/Python/
30,33d29
< if '_scriptTag = true;' in x:
< x = x.replace('_scriptTag = true;', '_scriptTag = True;')
< if '_styleTag = true;' in x:
< x = x.replace('_styleTag = true;', '_styleTag = True;')
- The PhpParserBase.py file looks like it contains an error.
$ diff dkazantzas/php/Python/PhpLexerBase.py dkazantzas2/php/Python/
121c121
< self._channel = self.SKIP
---
> self.channel(SkipChannel)
Made those changes too. I really appreciate your help in this.
@teverett This PR is okay--good changes. The build failed with the usual "Connection closed before full header was received" in Dart only. Not sure what to do about these Dart download failures. I'll check around.
@kaby76 thanks. Let's fix the Dart issue before it gets pulled.
@kaby76 thanks. Let's fix the Dart issue before it gets pulled.
@teverett
I created a Github Issue for this https://github.com/antlr/grammars-v4/issues/2743
As I explained there, we've been getting a "Connection closed before full header was received" on Window and Macos. I think it's because the network connection for the Github Actions servers or (more likely) the Dart servers are boxes of unreliable junk. It could be both.
To work around this problem I will submit a separate PR to retry the "dart pub get" until the return code is zero or some could like 10x's.
Could you invoke the action for this PR again in order to test the non-determinism of the machines?
@kaby76 yup!
@teverett Thanks. It happened again. I'll check it out locally on my machines to see what I can do.
@teverett I created a PR to wrap the "dart pub get" in a loop to repeat on error. It doesn't hurt the build, may help in these dart connection drops, but who knows? Once merged, maybe this PR can be rebased and checked?
@dkazantzas Please fast forward your repo so it can be rebuilt.
@kaby76 Done
@dkazantzas That looks good. @teverett Build? Let's see if this works.
The Dart build works on Macos, Windows, and Ubuntu. Now it's the Go target. I'll enter a Github Issue for that.
@dkazantzas Please fast forward your repo so it can be rebuilt with the latest fixes for Go builds. Thanks.
@kaby76 I've synced my repo, it should now be ok
@teverett This is ready to rebuild. Could you set a build going? I think we should no longer have Dart and Go build errors, but let's just see. Thanks.
@kaby76 done, thanks for the reminder.
@teverett Works perfectly.
@dkazantzas @kaby76 thanks