You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While trying operator overloading in Rust, I see some unexepected behaviour of Geany. For a structure called ComplexNumber, the implementation of Add and Mul require separate implementation blocks. I expected that Add and Mul would be listed together with print and magnitude. If I try operator overloading in a similar way in C++, the member functions get nicely grouped below the name of the structure, even if they are defined in separate blocks. See the picture and the attached Rust example.
use std::ops::{Add,Mul};#[derive(Debug,Copy,Clone)]pubstructComplexNumber{r:f64,j:f64}implAddforComplexNumber{typeOutput = ComplexNumber;fnadd(self,rhs:ComplexNumber) -> ComplexNumber{ComplexNumber{r:self.r+rhs.r,j:self.j+rhs.j}}}implMulforComplexNumber{typeOutput = ComplexNumber;fnmul(self,rhs:ComplexNumber) -> ComplexNumber{ComplexNumber{r:self.r*rhs.r-self.j*rhs.j,j:self.r*rhs.j+self.j*rhs.r}}}implComplexNumber{fnprint(&self){print!("{}+{}i ",self.r,self.j);}fnmagnitude(&self) -> f64{(self.r.powi(2)+self.j.powi(2)).sqrt()}}fnmain(){let a = ComplexNumber{r:1.0,j:0.0};let b = ComplexNumber{r:0.0,j:1.0};let c = a + b;let d = a * b;let e = c + d;
c.print();
d.print();
e.print();print!("{} ", e.magnitude());}
The text was updated successfully, but these errors were encountered:
I'm trying to solve geany#728, but before that I needed to understand the C-parser. Unfortunately the debugging option failed. I tried the following:
CFLAGS='-DDEBUG_C' ./autogen.sh
And therefore I needed to modify c.c
Hope this is sufficiently clear to accept the change.
The parsers are taken from the Uctags project, so the first thing to check is if the latest version of Uctags itself has the problem.
If it does then that project is where to fix it. When the problem is fixed in Uctags then swapping the parser included with Geany for the latest from Uctags is the fix for Geany. Thats not a job for the fainthearted though.
Hello,
While trying operator overloading in Rust, I see some unexepected behaviour of Geany. For a structure called ComplexNumber, the implementation of Add and Mul require separate implementation blocks. I expected that Add and Mul would be listed together with print and magnitude. If I try operator overloading in a similar way in C++, the member functions get nicely grouped below the name of the structure, even if they are defined in separate blocks. See the picture and the attached Rust example.
The text was updated successfully, but these errors were encountered: