Skip to content

Added support for '.' as alternative class member specifier#901

Merged
thefallentree merged 3 commits intofluffos:masterfrom
jalbright015:master
Jul 20, 2022
Merged

Added support for '.' as alternative class member specifier#901
thefallentree merged 3 commits intofluffos:masterfrom
jalbright015:master

Conversation

@jalbright015
Copy link
Copy Markdown
Contributor

Added support for using '.' as a supported class member specifier.

Example:

class.c

class SuperClass {
  int foo;
  int bar;
}

class SuperClass super;

void test()
{
  int *i = ({ 1, 3 });
  
  super = new(class SuperClass);
  super = assemble_class(i);
  
  super.foo = 9;
  
  return super.foo;
}
> eval return "/open/class.c"->test()
Result = 9

@thefallentree
Copy link
Copy Markdown
Member

Thanks, I think this is okay and make code easier to write.

but we need corresponding test files, and doc changes. Can you add a few test cases in testsuite/single/tests/compiler , maybe call it class.c

@thefallentree thefallentree merged commit 7ff8942 into fluffos:master Jul 20, 2022
Amirani-al pushed a commit to Amirani-al/fluffos that referenced this pull request May 30, 2023
)

* Added support for '.' as class member specifier

* Added newline at end of file

* Initial commit - test cases for classes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants