Skip to content

Commit

Permalink
Java: wrap each field in own block to isolate the scope of temporary …
Browse files Browse the repository at this point in the history
…variables
  • Loading branch information
Mingun committed Oct 24, 2023
1 parent d370048 commit f4e1adb
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,14 @@ class JavaCompiler(typeProvider: ClassTypeProvider, config: RuntimeConfig)
out.puts( " */")
}

override def attrParse(attr: AttrLikeSpec, id: Identifier, defEndian: Option[Endianness]): Unit = {
out.puts(s"{// ${idToStr(id)}")
out.inc
super.attrParse(attr, id, defEndian)
out.dec
out.puts("}")
}

override def attrParseHybrid(leProc: () => Unit, beProc: () => Unit): Unit = {
out.puts("if (_is_le) {")
out.inc
Expand Down

0 comments on commit f4e1adb

Please sign in to comment.