| 92 | |
| 93 | @memoize |
| 94 | def meta(self) -> Optional[MetaTuple]: |
| 95 | # meta: "@" NAME NEWLINE | "@" NAME NAME NEWLINE | "@" NAME STRING NEWLINE |
| 96 | mark = self._mark() |
| 97 | if ( |
| 98 | (literal := self.expect("@")) |
| 99 | and |
| 100 | (name := self.name()) |
| 101 | and |
| 102 | (_newline := self.expect('NEWLINE')) |
| 103 | ): |
| 104 | return ( name . string , None ) |
| 105 | self._reset(mark) |
| 106 | if ( |
| 107 | (literal := self.expect("@")) |
| 108 | and |
| 109 | (a := self.name()) |
| 110 | and |
| 111 | (b := self.name()) |
| 112 | and |
| 113 | (_newline := self.expect('NEWLINE')) |
| 114 | ): |
| 115 | return ( a . string , b . string ) |
| 116 | self._reset(mark) |
| 117 | if ( |
| 118 | (literal := self.expect("@")) |
| 119 | and |
| 120 | (name := self.name()) |
| 121 | and |
| 122 | (string := self.string()) |
| 123 | and |
| 124 | (_newline := self.expect('NEWLINE')) |
| 125 | ): |
| 126 | return ( name . string , literal_eval ( string . string ) ) |
| 127 | self._reset(mark) |
| 128 | return None |
| 129 | |
| 130 | @memoize |
| 131 | def rules(self) -> Optional[RuleList]: |