mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-08 00:28:49 +00:00
Return "" for rune < 0 in strconv.
This commit is contained in:
+10
-10
@@ -7,8 +7,8 @@ Parses a boolean value from the input string
|
||||
|
||||
**Inputs**
|
||||
- s: The input string
|
||||
- true: "1", "t", "T", "true", "TRUE", "True"
|
||||
- false: "0", "f", "F", "false", "FALSE", "False"
|
||||
- true: "1", "t", "T", "true", "TRUE", "True"
|
||||
- false: "0", "f", "F", "false", "FALSE", "False"
|
||||
- n: An optional pointer to an int to store the length of the parsed substring (default: nil)
|
||||
|
||||
**Returns**
|
||||
@@ -203,7 +203,7 @@ Parses an unsigned 64-bit integer value from the input string without a prefix,
|
||||
**Inputs**
|
||||
- str: The input string to parse
|
||||
- base: The base of the number system to use for parsing
|
||||
- Must be between 1 and 16 (inclusive)
|
||||
- Must be between 1 and 16 (inclusive)
|
||||
- n: An optional pointer to an int to store the length of the parsed substring (default: nil)
|
||||
|
||||
Example:
|
||||
@@ -264,8 +264,8 @@ Parses an unsigned 64-bit integer value from the input string, using the specifi
|
||||
**Inputs**
|
||||
- str: The input string to parse
|
||||
- base: The base of the number system to use for parsing (default: 0)
|
||||
- If base is 0, it will be inferred based on the prefix in the input string (e.g. '0x' for hexadecimal)
|
||||
- If base is not 0, it will be used for parsing regardless of any prefix in the input string
|
||||
- If base is 0, it will be inferred based on the prefix in the input string (e.g. '0x' for hexadecimal)
|
||||
- If base is not 0, it will be used for parsing regardless of any prefix in the input string
|
||||
- n: An optional pointer to an int to store the length of the parsed substring (default: nil)
|
||||
|
||||
Example:
|
||||
@@ -339,8 +339,8 @@ Parses a signed integer value from the input string, using the specified base or
|
||||
**Inputs**
|
||||
- s: The input string to parse
|
||||
- base: The base of the number system to use for parsing (default: 0)
|
||||
- If base is 0, it will be inferred based on the prefix in the input string (e.g. '0x' for hexadecimal)
|
||||
- If base is not 0, it will be used for parsing regardless of any prefix in the input string
|
||||
- If base is 0, it will be inferred based on the prefix in the input string (e.g. '0x' for hexadecimal)
|
||||
- If base is not 0, it will be used for parsing regardless of any prefix in the input string
|
||||
|
||||
Example:
|
||||
|
||||
@@ -382,8 +382,8 @@ Parses an unsigned integer value from the input string, using the specified base
|
||||
**Inputs**
|
||||
- s: The input string to parse
|
||||
- base: The base of the number system to use for parsing (default: 0, inferred)
|
||||
- If base is 0, it will be inferred based on the prefix in the input string (e.g. '0x' for hexadecimal)
|
||||
- If base is not 0, it will be used for parsing regardless of any prefix in the input string
|
||||
- If base is 0, it will be inferred based on the prefix in the input string (e.g. '0x' for hexadecimal)
|
||||
- If base is not 0, it will be used for parsing regardless of any prefix in the input string
|
||||
|
||||
Example:
|
||||
|
||||
@@ -1729,7 +1729,7 @@ quote_rune :: proc(buf: []byte, r: rune) -> string {
|
||||
}
|
||||
}
|
||||
|
||||
if buf == nil {
|
||||
if buf == nil || r < 0 {
|
||||
return ""
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user