-
Notifications
You must be signed in to change notification settings - Fork 106
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
Please add support for Typescript 4.4.x #528
Comments
Managed to recompile the .jar file for the generation tool (in folder 'tool'). Then put the file |
I'm having the same trouble and your workaround is unfortunately only a workaround. This issue/ticket needs to be reopened to solve this problem here in this repository. |
Another solution would be to just unzip the .jar-file |
Here is an example on how to automate this: nidomiro/relation-tuple-parser@8209a1b |
are your problems resolved? |
@chengchengpei I'm using ts 4.8.2 at the commit posted above. It compiles, but only with the patches. |
@chengchengpei thank you for your help. However, I have no idea how to apply such a patch... there's a first time for everything. Could you give me pointers here? |
I got some errors when using antlr4ts in my project. Here is the post: https://stackoverflow.com/questions/74870072/typeerror-class-extends-value-undefined-is-not-a-constructor-or-null-when-using I need help. Any comments welcomed. thanks :) |
I upgraded to Angular 16 and got some more errors. Noticed that a few more Also wrote a small shell-script to help repackaging without recompiling the whole stuff. Make sure to unpack the original .jar-file somewhere. Then put the script and the attachment (TypeScript.stg) in the same folder. So you get the following folder structure:
# This will create a new JAR-file that can be used to create new G4-dependant files using the antlr4ts-cli
# - Edit the file ./TypeScript.stg (in this folder)
# - save the file
# - run this script
# The script will copy the .stg-file to the right folder in the folder structure that originated from the original
# JAR-file (antlr4-typescript-4.9.0-SNAPSHOT-complete.jar) that was unpacked here.
# then a new JAR-file is created and put in the right folder: the node_modules folder that was created when installing
# the antlr4ts-cli (https://github.com/tunnelvisionlabs/antlr4ts/tree/master) :
# node_modules/antlr4ts-cli/target/antlr4-typescript-4.9.0-SNAPSHOT-complete.jar
PROJECT_ROOT="/mnt/ssd/Develop/crisisgame/scenariomanager-v16"
ANTLR4TS_FOLDER=${PROJECT_ROOT}/__Resources/Antlr4ts-cli
JAR_FILE_UNPACKED_FOLDER=${ANTLR4TS_FOLDER}/antlr4-typescript-4.9.0-SNAPSHOT-complete
TEMPLATE_FILENAME_DESTINATION_JAR_FILE=${JAR_FILE_UNPACKED_FOLDER}/org/antlr/v4/tool/templates/codegen/TypeScript
cd $ANTLR4TS_FOLDER
cp TypeScript.stg $TEMPLATE_FILENAME_DESTINATION_JAR_FILE
# Repackage the file. this must be done using the current folder otherwise the class-files will have an absolute path in them
cd $JAR_FILE_UNPACKED_FOLDER
jar cvfm $ANTLR4TS_FOLDER/typescript.jar ./META-INF/MANIFEST.MF .
# Copy to source location and rename to right filename
cd $ANTLR4TS_FOLDER
cp typescript.jar ${PROJECT_ROOT}/node_modules/antlr4ts-cli/target/antlr4-typescript-4.9.0-SNAPSHOT-complete.jar
|
I also get something like this:
I have strict |
Still seeing the same thing on TypeScript 4.9.5 :( |
I really am benefiting from your great work. However, now that I am migrating to Angular 13 the language used is TypeScript version 4.4.4. When running the your antlr4ts tool to generate the files and visitors, the //@OverRide is not enough anymore and generates error TS4114. For instance: This member must have an 'override' modifier because it overrides a member in the base class 'ParserRuleContext'.
In the mean time I am looking at how to turn off this error in my project, but really: these are useful errors ...
Edit: cloned the repo and found the .stg file (tool/resources/org/antlr/v4/tool/templates/codegen/TypeScript/TypeScript.stg). I think all that needs to be done is improve this file.
Edit: managed to edit the file (see attachment) and recompile the whole thing (
./tool
folder usingnpm -i
). So for now I am out of trouble. Maybe for future searchers this might help.Thank you
TypeScript.stg.txt
!
The text was updated successfully, but these errors were encountered: