Documentation for octal_ints
authorJose Luis Tallon <jltallon@adv-solutions.net>
Mon, 28 Dec 2015 18:58:27 +0000 (19:58 +0100)
committerJose Luis Tallon <jltallon@adv-solutions.net>
Wed, 30 Dec 2015 18:15:37 +0000 (19:15 +0100)
doc/libconfig.texi
lib/scanner.l

index eec8c9d..914793c 100644 (file)
@@ -399,7 +399,8 @@ application:
     pi = 3.141592654;
     bigint = 9223372036854775807L;
     columns = [ "Last Name", "First Name", "MI" ];
-    bitmask = 0x1FC3;
+    bitmask = 0x1FC3;  // hex
+    umask = 0027;      // octal. Range limited to that of "int"
   @};
 @};
 @end smallexample
@@ -505,7 +506,8 @@ more decimal digits (@samp{0} - @samp{9}), with an optional leading
 sign character (@samp{+} or @samp{-}); or as a hexadecimal value
 consisting of the characters @samp{0x} followed by a series of one or
 more hexadecimal digits (@samp{0} - @samp{9}, @samp{A} - @samp{F},
-@samp{a} - @samp{f}).
+@samp{a} - @samp{f}). Additionally, octal notation integers (that is,
+those having a leading zero with non-zero value) are also allowed.
 
 @node 64-bit Integer Values, Floating Point Values, Integer Values, Configuration Files
 @comment  node-name,  next,  previous,  up
index f0f8d51..51939f2 100644 (file)
@@ -244,7 +244,7 @@ include_dir_open  ^[ \t]*@include_dir[ \t]+\"
                     }
                     errno = errsave;
                     if( '0'==*yytext && '\0'!=*(yytext+1) )
-                    {  // it's octal... so INT we go
+                    {  /* it's octal... so INT we go */
                       yylval->ival=(int)(llval);
                       return(TOK_INTEGER);
                     }