lawrancej / CompilerKit

Compiler construction library in C.
GNU Lesser General Public License v2.1
55 stars 33 forks source link

Modify the constructor for CompilerKitConcatenation #33

Closed lawrancej closed 12 years ago

lawrancej commented 12 years ago

If either the left or the right side of a concatenation happens to be the EmptyString, then don't bother to allocate or return a new concatenation. Instead, return the other side.

  1. Modify compilerkit_concatenation_new to return GObject *. Check if either the left or right are the EmptyString, and if so, return the other side instead.
  2. Write a test case in tests/concatenation-test.c that verifies that compilerkit_concatenation_new works as intended.
tannerd01 commented 12 years ago

working on it