chore(frontends/lean,library): fix character pretty printer

This commit is contained in:
Leonardo de Moura 2017-05-02 13:17:22 -07:00
parent a0a8103804
commit 73b4e42485
6 changed files with 24 additions and 24 deletions

View file

@ -85,7 +85,7 @@ else if char.to_nat c <= 31 then "\\x" ++ char_to_hex c
else [c]
instance : has_to_string char :=
⟨λ c, "#\"" ++ char.quote_core c ++ "\""⟩
⟨λ c, "'" ++ char.quote_core c ++ "'"⟩
def string.quote_aux : string → string
| [] := ""

View file

@ -49,9 +49,9 @@ static void display_char_literal_core(std::ostream & out, char c, bool in_string
}
static void display_char_literal(std::ostream & out, char c) {
out << "#\"";
out << "'";
display_char_literal_core(out, c, false);
out << "\"";
out << "'";
}
static void display_string_literal(std::ostream & out, std::string const & s) {

View file

@ -1,7 +1,7 @@
#"a" : char
#"a"
#"\n"
#"\\"
'a' : char
'a'
'\n'
'\\'
aaa\

View file

@ -4,7 +4,7 @@
def s1 : set :=
{1, 2 + 3, 3, 4}
def s2 : set char :=
{#"a", #"b", #"c"}
{'a', 'b', 'c'}
def s3 : set string :=
{"hello", "world"}
{a ∈ s1 | a > 1} : set

View file

@ -1,3 +1,3 @@
#"A"
#"B"
#"C"
'A'
'B'
'C'

View file

@ -1,15 +1,15 @@
{val := 2, is_lt := of_as_true trivial} : fin 5
{val := 1, is_lt := of_as_true trivial} : fin 3
#"a" : char
to_string #"a" : string
"#\"a\""
#"a"
#"\x01"
#"\x01"
#"\x14"
#"\x01" : char
#"\x14" : char
#"\x0f" : char
#"\x10" : char
#"\x0f"
#"\x10"
'a' : char
to_string 'a' : string
"'a'"
'a'
'\x01'
'\x01'
'\x14'
'\x01' : char
'\x14' : char
'\x0f' : char
'\x10' : char
'\x0f'
'\x10'