Skip to content

Commit 24f6f3e

Browse files
author
d3x0r
committed
Add number rule solo template
1 parent a4abe0e commit 24f6f3e

File tree

3 files changed

+36
-12
lines changed

3 files changed

+36
-12
lines changed

NumberRule.GIF

30.8 KB
Loading

Val.GIF

-39.6 KB
Loading

jsox.ebnf

+36-12
Original file line numberDiff line numberDiff line change
@@ -20,30 +20,54 @@ Val = "(Value)" (|"whitespace") ( ("(Comment)" ( ( "/" "/" { "character not \n
2020
( "(reference)" "r" "e" "f" "[" ( (|"whitespace")( "ident" | "int" ) (|"whitespace") { ("," (|"whitespace")( "ident" | "int" )(|"whitespace")) }) "]" ) |
2121
( "(typed-array)" "ident" "[" ( Value ) { "," Value } "]" ) |
2222
( "(typed-string)" "ident" String ) |
23-
("(Number/Date/BigInt)"
24-
( |"-") ( "NaN" | "Infinity" |
25-
( ( "-" | "+" ) { "-" | "+" } | ("0-9") ) "(Number) /*Begin Number Collection*/"
23+
( |"-") ( "NaN" | "Infinity" |
24+
( ( "-" | "+" ) { "-" | "+" } | ("0-9") ) "/*Number Parser Bgin*/"
2625
( "/* underscore '_' between any following sequence's symbols */" | ( "(BigInt)" { "0-9" } "n" ) |
27-
( "(int)"( "0" (
26+
"(Number)"( "(int)"( "0" (
2827
( ( "x" | "X" ) ("0-9" | "A-F" | "a-f") { "0-9" | "A-F" | "a-f" } ) |
2928
( ( "o" | "O" ) "0-7" { "0-7" } ) |
3029
( ( "b" | "B" ) "0-1" { "0-1" ) |
3130
( "0-7" {"0-7"})
3231
)
3332
)
34-
| "(float)" ( "0-9" | " . only one decimal allowed" ) { "0-9" | ". only one decimal allowed"} ( "(int) if no . " | ( ( "e" | "E" ) ( "0-9" | "+" "0-9" | "-" "0-9" ) { "0-9" } ) )
35-
) ( |"NOT THESE:" ( "0-9"| "-"| ":"| "+"| "A-F"| "a-f" ) ) ( "," | "}" | "]" | "whitespace /* outside of array or object */" )
36-
| "(Date)" ( (("0-9" | ":" | "T" | "-" | "+"){ "0-9" | ":" | "T" | "-" | "+" }) ( ("+"|"-") "0-9" "0-9" ":" "0-9" "0-9" | "Z" ) )
37-
38-
))) |
33+
| "(float)" ( "0-9" | "." ) { "0-9" | "."} ( "(int) if no . "
34+
| ( ( "e" | "E" ) ( "0-9" | "+" "0-9" | "-" "0-9" ) { "0-9" } ) )
35+
) ( |"NOT THESE:" ( "0-9"| "-"| ":"| "+" | "A-F"| "a-f" ) ) "/*number terminator*/" ( "," | "}" | "]" | "whitespace /* outside of array or object */" )
36+
| "(Date)" ( ( ("0-9" | ":" | "T" | "-" | "+")
37+
{ "0-9" | ":" | "T" | "-" | "+" })
38+
( ( |"NOT THESE:" ( "0-9"| "-"| ":"| "+" | "Z"| "T" ) ) "/*date terminator*/" ( "," | "}" | "]" | "whitespace /* outside of array or object */" )
39+
| ( |"+"|"-") "0-9" "0-9" ":" "0-9" "0-9"
40+
| "Z" ) )
41+
)) |
3942
("(String)" ( ( "(Legal Escapes)" ( "b" | "n" | "r" | "f" | "t" | ("'" | '"' | "`")
4043
| ( "u" ( "{" {"0-9" | "A-F" | "a-f"} "}" | "4 hex digits" ) )
4144
| ( "x" ("0-9" | "A-F" | "a-f") ("0-9" | "A-F" | "a-f") )
4245
| ( "0-2" "0-7" "0-7" )
4346
)
4447
)|
45-
( '"' (( 'character not " or \ ' ) | ( '\' '"' ) | ("\" "\" ) | ( "\" "Legal Escapes" ) ) { ( 'character not " or \ ' ) | ( '\' '"' ) | ("\" "\" ) | ( "\" "Legal Escapes" ) } '"' ) |
48+
( '"' (( 'character not " or \ ' ) | ( '\' '"' ) | ("\" "\" ) | ( "\" "Legal Escapes" ) ) { ( 'character not " or \ ' ) | ( '\' '"' ) | ("\" "\" ) | ( "\" "Legal Escapes" ) } '"' ) |
4649
( "'" ( "character not ' or \" | ( "\" "'" ) | ("\" "\" ) | ( "\" "Legal Escapes" ) ) { "character not ' or \" | ( "\" "'" ) | ("\" "\" ) | ( "\" "Legal Escapes" ) } "'" ) |
47-
( "`" ( "character not ` or \" | ( "\" '`' ) | ("\" "\" ) | ( "\" "Legal Escapes" ) ) { "character not ` or \" | ( "\" '`' ) | ("\" "\" ) | ( "\" "Legal Escapes" ) } "`" ) )
50+
( "`" ( "character not ` or \" | ( "\" '`' ) | ("\" "\" ) | ( "\" "Legal Escapes" ) ) { "character not ` or \" | ( "\" '`' ) | ("\" "\" ) | ( "\" "Legal Escapes" ) } "`" ) )
4851
)|
49-
true | false | null | undefined )) (|"whitespace").
52+
true | false | null | undefined ) (|"whitespace").
53+
54+
NumberRule = ("(Number/Date/BigInt)"
55+
( |"-") ( "NaN" | "Infinity" |
56+
( ( "-" | "+" ) { "-" | "+" } | ("0-9") ) "/*Number Parser Bgin*/"
57+
( "/* underscore '_' between any following sequence's symbols */" | ( "(BigInt)" { "0-9" } "n" ) |
58+
"(Number)"( "(int)"( "0" (
59+
( ( "x" | "X" ) ("0-9" | "A-F" | "a-f") { "0-9" | "A-F" | "a-f" } ) |
60+
( ( "o" | "O" ) "0-7" { "0-7" } ) |
61+
( ( "b" | "B" ) "0-1" { "0-1" ) |
62+
( "0-7" {"0-7"})
63+
)
64+
)
65+
| "(float)" ( "0-9" | "." ) { "0-9" | "."} ( "(int) if no . "
66+
| ( ( "e" | "E" ) ( "0-9" | "+" "0-9" | "-" "0-9" ) { "0-9" } ) )
67+
) ( |"NOT THESE:" ( "0-9"| "-"| ":"| "+" | "A-F"| "a-f" ) ) "/*number terminator*/" ( "," | "}" | "]" | "whitespace /* outside of array or object */" )
68+
| "(Date)" ( ( ("0-9" | ":" | "T" | "-" | "+")
69+
{ "0-9" | ":" | "T" | "-" | "+" })
70+
( ( |"NOT THESE:" ( "0-9"| "-"| ":"| "+" | "Z"| "T" ) ) "/*date terminator*/" ( "," | "}" | "]" | "whitespace /* outside of array or object */" )
71+
| ( |"+"|"-") "0-9" "0-9" ":" "0-9" "0-9"
72+
| "Z" ) )
73+
))).

0 commit comments

Comments
 (0)