Comments (3)
Does jflex work if you edit the generated code with your suggested improvement?
from j2objc.
Yes, the scanner generated by jflex appears to work with that fix (it also works with a plain break
as there is only 1 loop).
It works with the example too:
+ (void)mainWithNSStringArray:(IOSObjectArray *)args {
int counter = 0;
label: {
while (counter++ < 10) {
if (counter >= 5) {
goto label_end;
}
}
}
label_end:
[((JavaIoPrintStream *) nil_chk([JavaLangSystem out])) printlnWithNSString:[NSString stringWithFormat:@"Counter: %d", counter]];
}
There is probably also a similar issue with labeled continue statements.
from j2objc.
Fix is in public source. Here's the output from your example:
+ (void)mainWithNSStringArray:(IOSObjectArray *)args {
jint counter = 0;
{
while (counter++ < 10) {
if (counter >= 5) {
goto break_label;
}
}
}
break_label: ;
[((JavaIoPrintStream *) nil_chk(JavaLangSystem_get_out_())) printlnWithNSString:JreStrcat("$I", @"Counter: ", counter)];
}
More importantly, the same count is printed in Java and Objective-C.
from j2objc.
Related Issues (20)
- Unable to build J2ObjC with Java 1.8 HOT 2
- Add info about which signing keys will be used for published artifacts. HOT 1
- Is this convert JAVA 11 code? HOT 3
- a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes] HOT 7
- Facing permission denide issue while converting java code to objective C HOT 1
- The 'build_subset_frameworks.sh' script fails
- CI Workflow Runs are failing HOT 1
- Cannot use JRE.xcframework with Xcode 15 Release Candidate due to code signing issue HOT 13
- JRE_Core.xcframework is missing headers HOT 2
- make dist fails make: *** [jre_emul_jars_dist] Error 2 HOT 9
- Headers information is missing from the XCFrameworks' "Info.plist" files HOT 6
- Encountering "multiple commands produce 'module.modulemap'" error when linking a target with any two of the J2ObjC XCFrameworks HOT 1
- When can you update the new version? HOT 3
- JAVA code is configured with JVM, how do I configure JVM into J2OBJC? HOT 1
- My
- Myself
- Files with same name HOT 3
- Size of JRE.xcframework exceeds 75MB limit of appstoreconnect HOT 2
- bitwise error ( sudo make dist command ). JDK 15 osx Sonoma 14.1.2
- The contents of JRE.xcframework (static vs dynamic lib)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from j2objc.