CORBA-IDLtree

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

      * In sub skip_input fix handling of preprocessor directives
        where the "#" is not placed in column 1 but is preceded by
        whitespace.
      * Fix sub scoped_name in case of chained module reopenings.

2.04    2020/06/20
        * In sub Parse_File_i case $file case $emucpp open $in
          with encoding(UTF-8) to ensure that IDL files are parsed
          as utf8.
        * New sub discard_bom discards a possible Unicode or UTF-8
          BOM (Byte Order Mark) at the start of the given line.
          In sub get_items add optional argument $firstline.
          If $firstline is given and true then discard_bom will be
          called on the first line read from file.
          In sub Parse_File_i outer while-loop add local
          $firstline for call to sub get_items.
        * New sub has_default_branch checks whether the given union
          subordinates contain a DEFAULT branch.  This fixes a bug
          related to checking that a union has an enum type as its
          switch and does not have a default branch.
          A false warning was generated in case the default branch

lib/CORBA/IDLtree.pm  view on Meta::CPAN

#                       longer needed due to use of Encode::Guess (see above).
#                   * In sub skip_input fix handling of preprocessor directives
#                     where the "#" is not placed in column 1 but is preceded by
#                     whitespace.
#                   * Fix sub scoped_name in case of chained module reopenings.
#
# 2.04  2020/06/20  * In sub Parse_File_i case $file case $emucpp open $in
#                     with encoding(UTF-8) to ensure that IDL files are parsed
#                     as utf8.
#                   * New sub discard_bom discards a possible Unicode or UTF-8
#                     BOM (Byte Order Mark) at the start of the given line.
#                     In sub get_items add optional argument $firstline.
#                     If $firstline is given and true then discard_bom will be
#                     called on the first line read from file.
#                     In sub Parse_File_i outer while-loop add local
#                     $firstline for call to sub get_items.
#                   * New sub has_default_branch checks whether the given union
#                     subordinates contain a DEFAULT branch.  This fixes a bug
#                     related to checking that a union has an enum type as its
#                     switch and does not have a default branch.
#                     A false warning was generated in case the default branch

lib/CORBA/IDLtree.pm  view on Meta::CPAN

            $directive eq 'ifndef') {
            $count++;
        } elsif ($directive eq 'endif') {
            $count--;
        }
        # For #elif, the count remains the same.
    }
    error "skip_input: fell off end of file";
}

# If the given line begins with the Unicode or UTF-8 BOM (Byte Order Mark) then
# discard the BOM in the returned line.
sub discard_bom {
    my $line = shift;
    if (length($line) > 2) {
        # Check for UTF-8 BOM (Byte Order Mark) 0xEF,0xBB,0xBF
        my $ord0 = ord(substr($line, 0, 1));
        if ($ord0 == 0xFEFF) {
            $line = substr($line, 1);         # Unicode
        } elsif ($ord0 == 0xEF) {
            my $ord1 = ord(substr($line, 1, 1));
            my $ord2 = ord(substr($line, 2, 1));
            if ($ord1 == 0xBB && $ord2 == 0xBF) {
                $line = substr($line, 3);     # UTF-8
            }
        }



( run in 0.433 second using v1.01-cache-2.11-cpan-e9daa2b36ef )