summaryrefslogtreecommitdiff
path: root/complex.c
diff options
context:
space:
mode:
Diffstat (limited to 'complex.c')
-rw-r--r--complex.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/complex.c b/complex.c
index edbe2965f0..5445b490ec 100644
--- a/complex.c
+++ b/complex.c
@@ -483,6 +483,24 @@ f_complex_new2(VALUE klass, VALUE x, VALUE y)
*
* Complex(1, 2) #=> (1+2i)
* Complex('1+2i') #=> (1+2i)
+ *
+ * Syntax of string form:
+ *
+ * complex = real part | [ sign ] , imaginary part
+ * | real part , sign , imaginary part
+ * | rational , "@" , rational ;
+ * real part = rational ;
+ * imaginary part = imaginary unit | unsigned rational , imaginary unit ;
+ * rational = [ sign ] , unsigned rational ;
+ * unsigned rational = numerator | numerator , "/" , denominator ;
+ * numerator = integer part | fractional part | integer part , fractional part ;
+ * denominator = digits ;
+ * integer part = digits ;
+ * fractional part = "." , digits , [ ( "e" | "E" ) , [ sign ] , digits ] ;
+ * imaginary unit = "i" | "I" | "j" | "J" ;
+ * sign = "-" | "+" ;
+ * digits = digit , [ { digit | "_" , digit } ] ;
+ * digit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" ;
*/
static VALUE
nucomp_f_complex(int argc, VALUE *argv, VALUE klass)