Commit Graph

3 Commits

Author SHA1 Message Date
Julien Fischer
fdb91d5aba Extend the lexer to recognise additional integer literals.
Extend the lexer to recognise uint literals, optional signedness suffixes on
ints and the literals for all of the proposed fixed size integer types.

Fix XXX UINTs in the library and compiler.

library/lexer.m:
    Uncomment the other alternatives in the integer_size/0 type.

    Handle signedness and size suffixes in integer literals.

library/parser.m
library/term.m:
    Conform to the above changes.

library/stream.string_writer.m:
    Fix an XXX UINT: make write handle uints properly.

library/term_io.m:
     Fix an XXX UINT: output integer signedness and size suffixes for
     integers when appropriate.

compiler/superhomogeneous.m:
     Print an error message if we encounter a fixed size integer literal
     as the rest of the compiler does not yet support them.

compiler/hlds_out_util.m:
compiler/parse_tree_out_info.m:
     Output the 'u' suffix on uint values.

test/hard_coded/lexer_zero.{m,inp,exp*}:
     Extend this test to cover zeros of varying signedness and size.

     Prefix each line of the output with the input line number of the
     token -- this makes it easier to relate the output back to the
     input.

tests/hard_coded/Mmakefile:
     Add the new test case.

tests/hard_coded/lexer_ints.{m,inp,exp}:
     Test the lexer on non-zero integer literals.
2017-04-26 10:00:45 +10:00
Julien Fischer
a56c4f5708 Merge integer tokens in lexer.
library/lexer.m:
     Merge the 'integer' and 'big_integer' tokens and extend them to include
     signedness and size information.  This conforms to recent changes to
     the rest of the system and is another step towards supporting additional
     types of integer literal.

library/parser.m:
mdbcomp/trace_counts.m:
     Conform to the above change.

tests/hard_coded/impl_def_lex.exp:
tests/hard_coded/impl_def_lex_string.exp:
tests/hard_coded/lexer_bigint.exp:
tests/hard_coded/lexer_zero.exp*:
tests/hard_coded/parse_number_from_string.exp*:
     Update these expected outputs.
2017-04-26 10:00:45 +10:00
Julien Fischer
1af897ba3a Fix more test failures in the C# and Java grades.
tests/hard_coded/Mmakefile:
     Filter the Java and C# stack traces from the output of the no_fully_strict
     test case.

tests/hard_coded/lexer_zero.exp3:
tests/hard_coded/write_reg1.exp5:
     Alternative expected outputs due to difference in how floats are
     printed.
2016-02-19 12:48:34 +11:00