Comments (2)
This requires a fundamental decision: The condition in an if
is currently parsed as exprInLine
, i.e., it ends at the end of the line or anything that cannot be parsed as part of the expression. (i=0) -1
can be parsed as an infix operation (i=0)-1
, follwed by an empty then part.
The choice is to stick with this behavior or to switch to space-separation like actual arguments. With space separation, if (i=0) -1 else 1
would be parsed as expected, but
if a = b
say "a equals b"
would no longer work and need to be written as either
if (a = b)
say "a equals b"
or
if a=b
say "a equals b"
from fuzion.
For now, the decision is to use space separation only for call arguments, not to separate the condition from the code block in an if. So to make this work as expected, you have to write
j := if (i=0) then -1 else 1
j := if (i=0) (-1) else 1
j := if (i=0) {-1} else 1
j := if i=0 then -1 else 1
j := if i=0 (-1) else 1
j := if i=0 {-1} else 1
from fuzion.
Related Issues (20)
- Precondition ignored in inherits call
- Do we need both `resultTypeIfPresent(res, gen)` and `resultTypeRaw(res, gen)`?
- contract failure, FUIR.constClazz creates new clazz after AIR
- unhandled dynamic target in two tests on macOS
- require-condition in `calledFeature` in small example HOT 1
- Type lookup confusion between outer and inherited type
- JVM: VerifyError in `set_exit_code`
- no targets for access
- Small example shows mismatch in type parameters for auto-generated type feature
- extension feature not found
- visibility when redefining feature
- no targets for access of ((Effect_Call (outcome void)).call).#^Effect_Call.call within (Effect_Call (outcome void)).call
- java.lang.Error: require-condition1 failed: dev.flang.fuir.analysis.AbstractInterpreter:pop
- Inference for anonymous feature HOT 1
- Space separation of arguments does not work if lambda argument ends in a semicolon
- require-condition2 while resolving type of match subject
- Better solution suggestion in case a call has wrong number of arguments
- `tests/reg_issue2214` `scenario3` using `Sequence` instead of `Stream` is missing
- A function return its own instance boxed as a `Any` results in a `NullPointerException`
- EmptyStackException, implicit unit result that is tagged to become a choice type
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 fuzion.