Skip to content

Collect all errors from all passes, rename and document some of them#313

Open
Mingun wants to merge 9 commits intokaitai-io:masterfrom
Mingun:passes
Open

Collect all errors from all passes, rename and document some of them#313
Mingun wants to merge 9 commits intokaitai-io:masterfrom
Mingun:passes

Conversation

@Mingun
Copy link
Copy Markdown
Contributor

@Mingun Mingun commented Oct 5, 2024

Some fields in data model filled by the compilation passes which is not obvious at all. To make this clear, I document properties which is filled by passes, document that passes and rename one of them. In the end, now all passes implements PrepocessStep and handled uniformly. Error in one value instance no more prevents from reporting errors in other value instances or reporting warnings and type problems

The new name gives more information about what the pass does
…umentation of related ClassSpec and EnumSpec properties
The new name gives more information about what the pass does
Currently the pass DeriveValueInstanceTypes throws error if type of instance
cannot be calculated, but this will change in next commit. That means that
accessing `dataType` of the ValueInstanceSpec will throw an error. If such
error is thrown we just cannot analyze that instance and can just ignore it

(review this commit in whitespace changes ignored mode)
…d by `TypeValidator`

If just return CompilationProblems from this pass, we will report some errors twice,
because `TypeValidator` also reports errors from the `TypeDetector`
@Mingun
Copy link
Copy Markdown
Contributor Author

Mingun commented Dec 24, 2025

That PR adds new test failure (in comparison to 83dde4b), but I'm unsure, why:

[info] - encoding_str_missing *** FAILED ***
[info]   [encoding_str_missing.ksy: /seq/0:
[info]   	error: string type, but no encoding found
[info]   ]
[info]     did not equal
[info]   [encoding_str_missing.ksy: /seq/0:
[info]   	error: string type, but no encoding found
[info]
[info]   encoding_str_missing.ksy: /seq/1:
[info]   	error: string type, but no encoding found
[info]
[info]   encoding_str_missing.ksy: /instances/baz:
[info]   	error: string type, but no encoding found
[info]   ] (SimpleMatchers.scala:34)

For some unknown reason only the first encoding error is detected in

# encoding_str_missing.ksy: /seq/0:
# 	error: string type, but no encoding found
#
# encoding_str_missing.ksy: /seq/1:
# 	error: string type, but no encoding found
#
# encoding_str_missing.ksy: /instances/baz:
# 	error: string type, but no encoding found
#
meta:
  id: encoding_str_missing
seq:
  - id: foo
    type: strz
  - id: bar
    type: strz
instances:
  baz:
    pos: 1
    type: strz

@generalmimon
Copy link
Copy Markdown
Member

@Mingun:

That PR adds new test failure, but I'm unsure, why

See

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants