]> gitweb.factorcode.org Git - factor.git/commitdiff
peg.javascript.tokenizer: rename escape rules slightly.
authorJohn Benediktsson <mrjbq7@gmail.com>
Sun, 12 Jun 2016 13:52:23 +0000 (06:52 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Sun, 12 Jun 2016 13:52:23 +0000 (06:52 -0700)
extra/peg/javascript/tokenizer/tokenizer.factor

index 56afa42cad31b41f4a9024bb1d42e9cfb3ec0d37..a4d82a1580318b17771228e9b928efabe1195455 100644 (file)
@@ -48,7 +48,7 @@ Name              = !(Keyword) iName  => [[ ast-name boa ]]
 Number            =   Digits:ws '.' Digits:fs => [[ ws "." fs 3array "" concat-as string>number ast-number boa ]]
                     | Digits => [[ >string string>number ast-number boa ]]
 
-SingleEscapeChar  =   "b"  => [[ CHAR: \b ]]
+SingleEscape      =   "b"  => [[ CHAR: \b ]]
                     | "f"  => [[ CHAR: \f ]]
                     | "n"  => [[ CHAR: \n ]]
                     | "r"  => [[ CHAR: \r ]]
@@ -58,10 +58,10 @@ SingleEscapeChar  =   "b"  => [[ CHAR: \b ]]
                     | "\"" => [[ CHAR: "  ]]
                     | "\\" => [[ CHAR: \\ ]]
 HexDigit          = [0-9a-fA-F]
-HexEscapeChar     = "x" (HexDigit HexDigit):d => [[ d hex> ]]
-UnicodeEscapeChar = "u" (HexDigit HexDigit HexDigit HexDigit):d => [[ d hex> ]]
+HexEscape         = "x" (HexDigit HexDigit):d => [[ d hex> ]]
+UnicodeEscape     = "u" (HexDigit HexDigit HexDigit HexDigit):d => [[ d hex> ]]
                     | "u{" HexDigit+:d "}" => [[ d hex> ]]
-EscapeChar         = "\\" (SingleEscapeChar | HexEscapeChar | UnicodeEscapeChar):c => [[ c ]]
+EscapeChar         = "\\" (SingleEscape | HexEscape | UnicodeEscape):c => [[ c ]]
 StringChars1       = (EscapeChar | !('"""') .)* => [[ >string ]]
 StringChars2       = (EscapeChar | !('"') .)* => [[ >string ]]
 StringChars3       = (EscapeChar | !("'") .)* => [[ >string ]]