-
Notifications
You must be signed in to change notification settings - Fork 1
Conversation
Thoughts:
For the |
I was planning on doing the separation between interface and local
variables today, so can we hold off on this pr for now? As Dave said, the
tests will make more sense that way.
…On Nov 11, 2017 1:39 PM, "Dave Pagurek" ***@***.***> wrote:
- we should separate the
So I think for this we need to do our actual separation of Variable and
Interface. You'll see in your test you've got in as a qualifier on the
struct member, which we don't actually want. Instead, the whole struct
would have the qualifier, since the struct is the type.
—
You are receiving this because your review was requested.
Reply to this email directly, view it on GitHub
<calder-gl/calder#25 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AHmdmf6mgLhOxZe9rWwpJ4oSFTDS4Wysks5s1ensgaJpZM4QalZw>
.
|
Hey @abhimadan, I've almost completed the separation, and I was going to update this PR with it when I was finished. |
Great!
…On Nov 11, 2017 2:35 PM, "Andrew McBurney" ***@***.***> wrote:
Hey @abhimadan <https://github.com/abhimadan>, I've almost completed the
separation, and I was going to update this PR with it when I was finished.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<calder-gl/calder#25 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AHmdmaykYVcYCkNfZAuh1e6UQn2oAq1Hks5s1fb4gaJpZM4QalZw>
.
|
constructor(qualifier: Qualifier, variable: Variable) { | ||
this.qualifier = qualifier; | ||
this.name = variable.name; | ||
this.kind = variable.kind; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just store the variable and read these off the variable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't want to expose the variable as part of the public interface (even if readonly
). Also, I didn't want to breach the law of demeter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can change it if we want, but it would propagate to a lot of changes in the current code which utilizes the old Variable
class. I was trying to go for "least amount of changes to other code" while creating this new class.
src/struct.ts
Outdated
/** | ||
* struct type-name { | ||
* members | ||
* } struct-name; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct me if I'm wrong but the struct-name
at the end makes an instance of the struct, when we really just want the type. e.g.
// define the struct
struct s {
int x;
};
// now make an instance
s some_instance;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, my bad - good catch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and also change the comment :)
src/interface.ts
Outdated
import Type from './type'; | ||
import Variable from './variable'; | ||
|
||
export default class Interface implements Hashable { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we rename this class InterfaceVariable
? Interface
is a really generic name.
Issue
#3
Usage
Adds a
SyntaxNode
for structs with the following usage: