SwensenSoftware / unquote

Write F# unit test assertions as quoted expressions, get step-by-step failure messages for free
http://www.swensensoftware.com/unquote
Apache License 2.0
287 stars 25 forks source link

Decompiler Feature Request: support custom prefix and infix operators #1

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
For example, given 

let (=~) input pattern = System.Text.RegularExpressions.Regex.IsMatch(input, 
pattern)

the quotation

<@ "hello world" =~ "worlds" @>

decompiles to

RegexUtils.op_EqualsTwiddle "hello world" "worlds"

Original issue reported on code.google.com by stephen....@gmail.com on 15 Feb 2011 at 1:19

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Should take a look at fsharp compilers PrettyNaming.fs, specifically the 
function DecompileOpName, which we may be able to copy for this purpose (and 
some other stuff too, like recognizing / decompiling active patterns correctly 
as in issue 11).

Original comment by stephen....@gmail.com on 10 Sep 2011 at 2:30

GoogleCodeExporter commented 9 years ago
Don't forget to consider open vs. non-open module qualification, e.g. 

"hello world" =~ "worlds" 

vs. 

RegexUtils.(=~) "hello world" "worlds" 

in the above example (despite the fact that we have limited capability to 
detect open modules.

Original comment by stephen....@gmail.com on 17 Apr 2012 at 4:13

GoogleCodeExporter commented 9 years ago
Note the following from the spec: 
http://research.microsoft.com/en-us/um/cambridge/projects/fsharp/manual/spec.htm
l#_Toc270597399

"In the preceding table, leading . characters are ignored when determining 
precedence for infix operators. For example,  .* has the same precedence as *. 
This rule ensures that operators such as .*, which is frequently used for 
pointwise-operation on matrices, have the expected precedence."

Original comment by stephen....@gmail.com on 29 Apr 2012 at 5:49

GoogleCodeExporter commented 9 years ago

Original comment by stephen....@gmail.com on 30 Apr 2012 at 12:04

GoogleCodeExporter commented 9 years ago

Original comment by stephen....@gmail.com on 30 Apr 2012 at 12:05

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r547.

Original comment by stephen....@gmail.com on 17 May 2012 at 5:11

GoogleCodeExporter commented 9 years ago

Original comment by stephen....@gmail.com on 20 May 2012 at 4:23