Browse Source

Examples: Added correct type-info to the create_ast example

gm/2021-09-23T00Z/github.com--lark-parser-lark/v0.12.0
Erez Sh 3 years ago
parent
commit
53b58e7137
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      examples/advanced/create_ast.py

+ 3
- 1
examples/advanced/create_ast.py View File

@@ -15,6 +15,7 @@ from typing import List
from dataclasses import dataclass from dataclasses import dataclass


from lark import Lark, ast_utils, Transformer, v_args from lark import Lark, ast_utils, Transformer, v_args
from lark.tree import Meta


this_module = sys.modules[__name__] this_module = sys.modules[__name__]


@@ -32,7 +33,8 @@ class _Statement(_Ast):


@dataclass @dataclass
class Value(_Ast, ast_utils.WithMeta): class Value(_Ast, ast_utils.WithMeta):
meta: object
"Uses WithMeta to include line-number metadata in the meta attribute"
meta: Meta
value: object value: object


@dataclass @dataclass


Loading…
Cancel
Save