| @@ 1606-1608 (lines=3) @@ | ||
| 1603 | ||
| 1604 | // turn list of length 1 into value type |
|
| 1605 | protected function flattenList($value) { |
|
| 1606 | if ($value[0] == "list" && count($value[2]) == 1) { |
|
| 1607 | return $this->flattenList($value[2][0]); |
|
| 1608 | } |
|
| 1609 | return $value; |
|
| 1610 | } |
|
| 1611 | ||
| @@ 2955-2959 (lines=5) @@ | ||
| 2952 | ||
| 2953 | protected function stripDefault(&$value) { |
|
| 2954 | $def = end($value[2]); |
|
| 2955 | if ($def[0] == "keyword" && $def[1] == "!default") { |
|
| 2956 | array_pop($value[2]); |
|
| 2957 | $value = $this->flattenList($value); |
|
| 2958 | return true; |
|
| 2959 | } |
|
| 2960 | ||
| 2961 | if ($def[0] == "list") { |
|
| 2962 | return $this->stripDefault($value[2][count($value[2]) - 1]); |
|
| @@ 4018-4020 (lines=3) @@ | ||
| 4015 | ||
| 4016 | // turn list of length 1 into value type |
|
| 4017 | protected function flattenList($value) { |
|
| 4018 | if ($value[0] == "list" && count($value[2]) == 1) { |
|
| 4019 | return $this->flattenList($value[2][0]); |
|
| 4020 | } |
|
| 4021 | return $value; |
|
| 4022 | } |
|
| 4023 | } |
|