-
Notifications
You must be signed in to change notification settings - Fork 3.4k
[TypeScript] Fix types in template (missing null-union) #4147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Josua Frank <josua.frank@daimlertruck.com>
@parrt blessed |
antlr4 has some issues with typescript typings, which should be fixed in 4.12.1: antlr/antlr4#4147 antlr/antlr4#4149
antlr4 has some issues with typescript typings, which should be fixed in 4.12.1: antlr/antlr4#4147 antlr/antlr4#4149
Signed-off-by: Josua Frank <josua.frank@daimlertruck.com> Co-authored-by: Josua Frank <josua.frank@daimlertruck.com> Signed-off-by: Jim.Idle <jimi@idle.ws>
A lot of good TypeScript and JavaScript runtime improvements for 4.12.1. Might there be a release soon? |
I hope so, waiting for a release too :) |
Also encountering this issue causing type checking to fail, hoping for 4.12.1 🙏 |
@jimidle @ericvergnaud are at a good spot for release? |
I have lots of stuff I am working on, on and off for performance and
memory, but it’s experimental really and there is plenty in go for a new
release.
I will work on documentation today and see if there is anything I want to
send to dev. I’ll send GitHub actions for the new go release repo too.
Then I am ready when you are.
…On Wed, May 17, 2023 at 05:56 Terence Parr ***@***.***> wrote:
@jimidle <https://github.com/jimidle> @ericvergnaud
<https://github.com/ericvergnaud> are at a good spot for release?
—
Reply to this email directly, view it on GitHub
<#4147 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAJ7TMBFHTYHUAQZTMC6XX3XGPZ2RANCNFSM6AAAAAAVKVWPGE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Ok. maybe I can try I release this weekend? It would be nice to freshen the internal Google copy as well. |
Working on it right now and will have my go stuff ready by end of day
Taipei time.
You release mechanism will need to copy the main branch of:
github.com/antlr/antlr4/runtime/Go/antlr/v4
to the main branch of
github.com/antlr-go/antlr
So, the top level of the repo.
Then the v4.x.y. tag should be issued against it. THe main development
source can be now be tagged exactly as you need it to be.
The go.mod for the runtime takes care of this being v4 and now the go get
command will resolve tags and so on correctly.
You may bring in the go runtime from the main branch of either repo of
course, depending how screwed up is Google's monorepo and the fact that
they don't use modules (they must jump through a lot of hoops to get that
to work, as modules are more or less required these days).
Jim
…On Wed, May 17, 2023 at 9:18 AM Terence Parr ***@***.***> wrote:
Ok. maybe I can try I release this weekend? It would be nice to freshen
the internal Google copy as well.
—
Reply to this email directly, view it on GitHub
<#4147 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAJ7TMFSRDGM7PAFNAGYKG3XGQRPXANCNFSM6AAAAAAVKVWPGE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@parrt all green here, I just submitted 2 minor PRs for you to merge. Nothing else pending on my side. |
ok, is this something we can document in the release .md file? |
Ter,
The release of v4.13.0 is now live in the new release only repo and works
like a bought one.
The main .md file does already draw attention to the new repo, but of
course feel free to add to that if you don't think it is prominent enough.
My own projects are now using the new repo and pass all their tests. More
importantly, the tags work as they should and our users will now see real
tag numbers in their go.mod files:
module github.com/jimidle/mvparse
go 1.19
require (
github.com/antlr4-go/antlr/v4 v4.13.0
github.com/dominikbraun/graph v0.21.0
github.com/pyroscope-io/client v0.7.0
)
require (
github.com/pyroscope-io/godeltaprof v0.1.0 // indirect
golang.org/x/exp v0.0.0-20230515195305-f3d0a9c9a5cc // indirect
)
So, when you make the release this weekend, there is nothing extra for you
to do over what you already do.
The go release notes tell you what to do to upgrade the go code within
Google to use the new repo - it is pretty trivial. Please look out for the
one change where you might need more than the import change. It is subtle
but trivial in that you may need to change the parser and lexer variable
definitions as they don't return an interface any more.
Most people won't even notice, but if they declared the type instead of
just using auto typing, then you will need to change the declaration to be
a * pointer. There are new interfaces into the runtime, but the runtime
interfaces are exactly the same. I doubt that you will even see this, but
regen the grammars and compile. If you get an error, then it is just this:
If your code looks like this:
var lexer = parser.NewMySqlLexer(nil)
var p = parser.NewMySqlParser(nil)
Or this:
lexer := parser.NewMySqlLexer(nil)
p := parser.NewMySqlParser(nil)
Then no changes need to be made. However, if you predeclared the parser and
lexer variables with their type, such as like this:
var lexer parser.MySqlLexer
var p parser.MySqlParser
// ...
lexer = parser.NewMySqlLexer(nil)
p = parser.NewMySqlParser(nil)
You will need to change your variable declarations to pointers (note the
introduction of the * below.
var lexer *parser.MySqlLexer
var p *parser.MySqlParser
// ...
lexer = parser.NewMySqlLexer(nil)
p = parser.NewMySqlParser(nil)
And that's it.
I will look out for your release announcement. This should be a nice
release for the go folk!
Jim
…On Fri, May 19, 2023 at 11:05 AM Terence Parr ***@***.***> wrote:
You release mechanism will need to copy the main branch of:
ok, is this something we can document in the release .md file?
—
Reply to this email directly, view it on GitHub
<#4147 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAJ7TMC7Z2DKBVOJEEMPOLLXG3PQFANCNFSM6AAAAAAVKVWPGE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Is there a way to pull this into a project? Can that be documented? |
It is documented.
https://github.com/antlr/antlr4/blob/master/doc/go-target.md
…On Mon, May 22, 2023 at 1:13 AM Matthew Dean ***@***.***> wrote:
@jimidle <https://github.com/jimidle>
The release of v4.13.0 is now live in the new release only repo
Is there a way to pull this into a project? Can that be documented?
—
Reply to this email directly, view it on GitHub
<#4147 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAJ7TMEQP47BNWTVXIVW4TLXHJELHANCNFSM6AAAAAAVKVWPGE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Also, of course:
https://pkg.go.dev/github.com/antlr4-go/antlr/v4
…On Mon, May 22, 2023 at 1:13 AM Matthew Dean ***@***.***> wrote:
@jimidle <https://github.com/jimidle>
The release of v4.13.0 is now live in the new release only repo
Is there a way to pull this into a project? Can that be documented?
—
Reply to this email directly, view it on GitHub
<#4147 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAJ7TMEQP47BNWTVXIVW4TLXHJELHANCNFSM6AAAAAAVKVWPGE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Hello,
the arrays
literalNames
andsymbolicNames
do not only contain strings, but also null. Therefore we should reflect that in the TypeScript type to prevent build errors in strict mode.Thank you for your great work on the TypeScript target, loving it :)
Kind regards
Sharknoon