Commit Graph

23 Commits

Author SHA1 Message Date
Lulu13022002
6eeac161d5
rename test files: .yml -> .yaml 2024-04-12 17:28:51 +02:00
Lulu13022002
fa0808ba10
fix and generate entity type 2024-04-11 22:57:16 +02:00
Lulu13022002
5a05ceabee
improve source parsing to be more accurate
The previous way had several flaw and was not really future proof. This
new system is based on an iterative string reader similar to how brigadier parse
arguments which simplify a lot of things tracking the cursor internally.

The comments and javadoc are now properly skipped to prevent commented line to be counted as an import.

The first scope detection to stop the parser once all imports have been processed
now detect the first '{' char uncommented. Previously it only worked for api
gen and was really restrictive since it detected the following pattern: <class type> <class name>
as a workaround.
The annotations are also skipped to prevent curly bracket that could be in
it to be counted too (this include the arguments as well).

Type name extended on multi line are also supported and checked at
runtime as defined in the JLS:
https://docs.oracle.com/javase/specs/jls/se17/html/jls-3.html#jls-3.8
For fully qualified name, each part separated by a dot are checked. Keyword
are also checked to prevent @interface to be considered as a regular annotation
when it's more a class definition. Whitespace and comments in between type name are
stripped to collect the right import in the end. Annotation between the package
name and the class name are not supported but is not needed for
import and annotation since they are forbidden by the compiler.

Multi line stuff is handled using a list of tasks to process in the right order
for the imports or annotations with two types of task: repeat and basic.

This new system is now used in the marker comment detection and in the old generated
code test.

There's also a lot of tests to make sure no regression happen in the future
that can be enabled by inluding the tag 'parser' (disabled in CI runner by default).
Additionnaly marker stub are not anymore allowed by default while parsing import,
annotation and metadata stuff but can be reenabled with the system property
'paper.generator.rewriter.searchMarkerInMetadata' for experimental/testing
purpose.

Short type name resolution (based on the collected imports) has been redone to
supports static star import and inner class type referenced either implicitly or via import.
2024-04-11 20:22:30 +02:00
Lulu13022002
3f766b67a7
remove unused imports 2024-04-11 20:22:30 +02:00
Lulu13022002
61140d9a29
remove old generators and CraftTropicalFish.CraftPattern 2024-04-11 20:22:29 +02:00
Lulu13022002
a77a6cbcce
potion data and stats bridge 2024-04-11 20:22:29 +02:00
Lulu13022002
0ec5ca062b
consolidate key format for mob goal keys 2024-04-11 20:22:29 +02:00
Lulu13022002
e3f1579ace
CraftBlockEntityState mapping 2024-04-11 20:22:29 +02:00
Lulu13022002
3fc81acf07
CraftBlockData mapping 2024-04-11 20:22:29 +02:00
Lulu13022002
90c92b9030
generate a few memory keys 2024-04-11 20:22:29 +02:00
Lulu13022002
5a49d4744e
handle group of properties, add missing methods/api
Fix wrong blockdata used in material
Mark the bundle item as experimental in that enum
2024-04-11 20:22:28 +02:00
Lulu13022002
fc4e774588
block state mapping 2024-04-11 20:21:43 +02:00
Lulu13022002
225a896a75
misc stuff detected by test 2024-04-11 20:21:42 +02:00
Lulu13022002
3329cf8d1d
deprecated api (material and stats) 2024-04-11 20:19:03 +02:00
Lulu13022002
d2139ee44a
more material stuff 2024-04-11 20:19:03 +02:00
Lulu13022002
cbaefb88f1
some material switch case 2024-04-11 20:19:03 +02:00
Lulu13022002
0ab4a7bac1
composite rewriter 2024-04-11 20:19:03 +02:00
Lulu13022002
cf148ffa94
more types 2024-04-11 20:19:02 +02:00
Lulu13022002
8b1223fc0e
map cursor, painting, banner pattern and scoreboard display slot 2024-04-11 20:19:02 +02:00
Lulu13022002
fc8ad8d46a
tag and map colors 2024-04-11 20:19:02 +02:00
Lulu13022002
8ce8d807d1
collect imports to avoid unneeded fqn type 2024-04-11 20:19:02 +02:00
Lulu13022002
a691110a6a
expand to more types 2024-04-11 20:19:01 +02:00
Lulu13022002
9431d85bbb
switch to partial generation 2024-04-11 20:19:01 +02:00