github.com/cockroachdb/cockroach@v20.2.0-alpha.1+incompatible/pkg/sql/opt/optgen/lang/testdata/scanner (about)

     1  #
     2  # Simple identifiers, strings, numbers, comments
     3  #
     4  scan
     5  foo define f123 "hello world" 1 0045 foo _ _123foo# comment ()[]
     6  ----
     7  (IDENT foo)
     8  (WHITESPACE  )
     9  (IDENT define)
    10  (WHITESPACE  )
    11  (IDENT f123)
    12  (WHITESPACE  )
    13  (STRING "hello world")
    14  (WHITESPACE  )
    15  (NUMBER 1)
    16  (WHITESPACE  )
    17  (NUMBER 0045)
    18  (WHITESPACE  )
    19  (IDENT foo)
    20  (WHITESPACE  )
    21  (IDENT _)
    22  (WHITESPACE  )
    23  (IDENT _123foo)
    24  (COMMENT # comment ()[])
    25  
    26  #
    27  # Symbols
    28  #
    29  scan
    30  ()[]{}$:*==>&,^|.. ...
    31  ----
    32  (LPAREN ()
    33  (RPAREN ))
    34  (LBRACKET [)
    35  (RBRACKET ])
    36  (LBRACE {)
    37  (RBRACE })
    38  (DOLLAR $)
    39  (COLON :)
    40  (ASTERISK *)
    41  (EQUALS =)
    42  (ARROW =>)
    43  (AMPERSAND &)
    44  (COMMA ,)
    45  (CARET ^)
    46  (PIPE |)
    47  (ILLEGAL .)
    48  (ELLIPSES ...)
    49  
    50  #
    51  # Unterminated string
    52  #
    53  scan
    54  "hello world
    55  ----
    56  (ILLEGAL "hello world)
    57  
    58  #
    59  # Comment on its own line.
    60  #
    61  scan
    62  #comment
    63  ----
    64  (COMMENT #comment)
    65  
    66  #
    67  # Failure scanning string
    68  #
    69  scan fail=5
    70  "hello
    71  ----
    72  (ILLEGAL "hel)
    73  (ERROR io: read/write on closed pipe)
    74  
    75  #
    76  # Failure scanning comment
    77  #
    78  scan fail=6
    79  # hello
    80  ----
    81  (COMMENT # hel)
    82  (ERROR io: read/write on closed pipe)
    83  
    84  #
    85  # Failure scanning ellipses
    86  #
    87  scan fail=3
    88  ...
    89  ----
    90  (ILLEGAL .)
    91  (ERROR io: read/write on closed pipe)
    92  
    93  #
    94  # Failure scanning whitespace
    95  #
    96  scan fail=5
    97  hel     lo
    98  ----
    99  (IDENT hel)
   100  (WHITESPACE  )
   101  (ERROR io: read/write on closed pipe)