fix: nimcheck improvements for generics, JS operators, Python 3.10+ syntax
- Add tolerantMode for generic Nim code with < > brackets - Fix JS ?. and ?? operator tokenization - Add Python 3.10 match/case keywords, underscore prefix support - Fix f-string parsing operator precedence bug - Fix duplicate foundClosing assignments in JS/PHP tokenizers - Treat unknown flavors as info instead of error - Add comprehensive test coverage for all fixes
This commit is contained in:
Vendored
+3
@@ -1,2 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
echo "Hello, world!"
|
||||
if [[ "$a" = "$b" ]]; then
|
||||
echo "a equals b"
|
||||
fi
|
||||
|
||||
Vendored
+2
@@ -1,3 +1,5 @@
|
||||
function greet(name) {
|
||||
return `Hello, ${name}!`;
|
||||
}
|
||||
|
||||
const x = obj?.prop ?? 'default';
|
||||
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
## Nim code with generics - should validate cleanly (no false "Unclosed '<'")
|
||||
proc jarray[T](node: T): T =
|
||||
result = node
|
||||
|
||||
proc pair[A, B](a: A, b: B): (A, B) =
|
||||
(a, b)
|
||||
|
||||
proc findIf[T](items: seq[T], pred: proc(x: T): bool): Option[T] =
|
||||
for item in items:
|
||||
if pred(item):
|
||||
return some(item)
|
||||
|
||||
proc compare[T](a, b: T): bool =
|
||||
a < b and b > a
|
||||
Vendored
+9
@@ -1,2 +1,11 @@
|
||||
def hello(name: str) -> str:
|
||||
return f"Hello, {name}!"
|
||||
|
||||
def process(value):
|
||||
match value:
|
||||
case 1:
|
||||
return 'one'
|
||||
case _:
|
||||
return 'other'
|
||||
|
||||
_private_var = 42
|
||||
Reference in New Issue
Block a user