Commit Graph

2 Commits

Author SHA1 Message Date
Zoltan Somogyi
b64f0fbedc Add a "mercury_term_" prefix to lexer.m/parser.m.
library/mercury_term_lexer.m:
library/mercury_term_parser.m:
    As above.

NEWS:
    Announce the change.

browser/interactive_query.m:
compiler/analysis.file.m:
compiler/fact_table.m:
compiler/make.module_dep_file.m:
compiler/parse_module.m:
compiler/parse_tree_out_term.m:
compiler/recompilation.used_file.m:
library/MODULES_DOC:
library/char.m:
library/integer.m:
library/io.m:
library/library.m:
library/ops.m:
library/term.m:
library/term_io.m:
mdbcomp/trace_counts.m:
tests/hard_coded/impl_def_lex.m:
tests/hard_coded/impl_def_lex_string.m:
tests/hard_coded/lco_pack_args_3.m:
tests/hard_coded/lexer_bigint.m:
tests/hard_coded/lexer_ints.m:
tests/hard_coded/lexer_zero.m:
tests/hard_coded/parse_number_from_string.m:
tests/valid_seq/nested_module_bug.m:
    Conform to the change.
2021-12-31 02:38:07 +11:00
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