lark icon indicating copy to clipboard operation
lark copied to clipboard

Lark is a parsing toolkit for Python, built with a focus on ergonomics, performance and modularity.

Results 194 lark issues
Sort by recently updated
recently updated
newest added

Suppose, we have a grammar: ``` start: value ?value: object | array | string | SIGNED_NUMBER -> number | "true" -> true | "false" -> false | "null" -> null...

question

This PR addresses two significant compatibility issues when using lark-cython: # 1. Fix Token handling for lark-cython In the standard lark implementation, `Token` inherits from `str`, allowing string methods to...

**Describe the bug** When the input text contains [full-width characters](https://en.wikipedia.org/wiki/Halfwidth_and_Fullwidth_Forms_(Unicode_block)#Block), the error location indicator (^) will point at the wrong character because it uses half-width spaces (U+20) only but it...

Lark currently only supports the flags `imslux`, however Python supports two additional ones, which perhaps some people will find useful. While users can still use inline flags, it might be...

enhancement

I tried using the calculator example with `use_bytes=True` but it wouldn't parse a NUMBER: ``` ValueError: could not convert string to float: Token('NUMBER', b'1') ``` I had to modify https://github.com/lark-parser/lark/blob/f68e3534f45ccfb481b68ca89ae387383a951e38/examples/calc.py#L46...

bug

Fixes https://github.com/lark-parser/lark/issues/1472

**Describe the Bug** In Python, the following syntax is valid: ```python [(i, j) for i in range(3) if i > 0 for j in range(5) if j % 2 ==...

This can be used to replace tokens in a `Tree` that satisfy a specified rule.

``` python from lark import Lark, Transformer from typing import Dict, List, Any, Optional # 定义华为配置文件的语法规则 GRAMMAR = """ // 主规则:配置文件由多个命令组成 start: command* // 命令可以是简单命令或块命令 command: simple_command | interface_command |...

question

Hello Lark developers! I've tried using this library in a personal project, and really liked it, thank you for it! ## The problem ...except one thing, which was grammar composition....