Skip to content

Conversation

@andimarek
Copy link
Member

No description provided.

@andimarek andimarek changed the title Spike: Add a zipper to mutate Ast Spike: Add a zipper to mutate Ast (WIP) Aug 1, 2018
this.children.putAll(Assert.assertNotNull(children));
}

public <T extends Node> List<T> getList(String key) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getChildrenWithName or just getChildren is a better namer I think. You know its a List from the return type

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still stand by this comment

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will change

@andimarek andimarek added the Not to be merged spikes or other stuff that should never or not yet to be merged label Oct 1, 2018

//TODO: Implement really in each Node
@Override
public ChildrenContainer getNamedChildren() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make it abstract and they will have to!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, it was just temp

@Override
public T withNewChildren(ChildrenContainer newChildren) {
return null;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

again make it abstract eventually to enforce this precondition

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, it was just temp

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is actually in Node

throw new IllegalStateException("children " + key + " is not a single value");
}
return result.size() > 0 ? (T) result.get(0) : null;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getChildOrNull might ber a better name

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, will change

// // but at which index in the directives list
// }
// }
// }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this when you are done

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

@andimarek
Copy link
Member Author

Work will continue here: #1335

@andimarek andimarek closed this Dec 1, 2018
@andimarek andimarek deleted the zipper branch January 14, 2019 04:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Not to be merged spikes or other stuff that should never or not yet to be merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants