mirror of https://github.com/Wilfred/difftastic/
148 lines
3.6 KiB
Plaintext
148 lines
3.6 KiB
Plaintext
================================================================================
|
|
Bit-string expression
|
|
================================================================================
|
|
|
|
<<code:int-size(8)-unit(2), reason:utf8>>
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
(source_file
|
|
(bit_string
|
|
(bit_string_segment
|
|
(identifier)
|
|
(bit_string_segment_options
|
|
(bit_string_segment_option)
|
|
(bit_string_segment_option
|
|
(integer))
|
|
(bit_string_segment_option
|
|
(integer))))
|
|
(bit_string_segment
|
|
(identifier)
|
|
(bit_string_segment_options
|
|
(bit_string_segment_option)))))
|
|
|
|
================================================================================
|
|
Boolean Negation
|
|
================================================================================
|
|
|
|
!False
|
|
True && !False
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
(source_file
|
|
(boolean_negation
|
|
(record
|
|
(constructor_name)))
|
|
(binary_expression
|
|
(record
|
|
(constructor_name))
|
|
(boolean_negation
|
|
(record
|
|
(constructor_name)))))
|
|
|
|
================================================================================
|
|
Integer Negation
|
|
================================================================================
|
|
|
|
{-x}
|
|
{-{5*30}}
|
|
{-my_fun()}
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
(source_file
|
|
(block
|
|
(integer_negation
|
|
(identifier)))
|
|
(block
|
|
(integer_negation
|
|
(block
|
|
(binary_expression
|
|
(integer)
|
|
(integer)))))
|
|
(block
|
|
(integer_negation
|
|
(function_call
|
|
(identifier)
|
|
(arguments)))))
|
|
|
|
================================================================================
|
|
Concatenation
|
|
================================================================================
|
|
|
|
let concat = "a" <> "b"
|
|
|
|
case "12345" {
|
|
"0" <> rest -> rest
|
|
"12" <> "34" <> "5" -> "match"
|
|
_ -> ""
|
|
}
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
(source_file
|
|
(let
|
|
(identifier)
|
|
(binary_expression
|
|
(string
|
|
(quoted_content))
|
|
(string
|
|
(quoted_content))))
|
|
(case
|
|
(case_subjects
|
|
(string
|
|
(quoted_content)))
|
|
(case_clauses
|
|
(case_clause
|
|
(case_clause_patterns
|
|
(case_clause_pattern
|
|
(binary_expression
|
|
(string
|
|
(quoted_content))
|
|
(identifier))))
|
|
(identifier))
|
|
(case_clause
|
|
(case_clause_patterns
|
|
(case_clause_pattern
|
|
(binary_expression
|
|
(binary_expression
|
|
(string
|
|
(quoted_content))
|
|
(string
|
|
(quoted_content)))
|
|
(string
|
|
(quoted_content)))))
|
|
(string
|
|
(quoted_content)))
|
|
(case_clause
|
|
(case_clause_patterns
|
|
(case_clause_pattern
|
|
(discard)))
|
|
(string)))))
|
|
|
|
================================================================================
|
|
Todo and panic 'as' with string expressions
|
|
================================================================================
|
|
|
|
todo as { "Hello, " <> "world!" }
|
|
panic as { "Hello, " <> "world!" }
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
(source_file
|
|
(todo
|
|
(block
|
|
(binary_expression
|
|
(string
|
|
(quoted_content))
|
|
(string
|
|
(quoted_content)))))
|
|
(panic
|
|
(block
|
|
(binary_expression
|
|
(string
|
|
(quoted_content))
|
|
(string
|
|
(quoted_content))))))
|