Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import sbtcrossproject.CrossPlugin.autoImport.{crossProject, CrossType}

val useScalaVersion = "2.13.14"
val releaseVersion = "1.1.1"
val releaseVersion = "1.1.2"

val sharedSettings = Seq(
scalaVersion := useScalaVersion,
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

{
"name": "tigerpython-parser",
"version": "1.1.1",
"version": "1.1.2",
"description": "Enhanced error recognition in Python ",
"main": "release/tigerpython-parser.mjs",
"types": "tpParser/js/types/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion release/tigerpython-parser.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion release/tigerpython-parser.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -52453,7 +52453,7 @@ $p.nv = (function() {
throw new $c_s_MatchError(xs$2);
}
}
return $f_sc_IterableOnceOps__mkString__T__T__T__T($x_10.aB($m_sc_ArrayOps$().sN(ys, 0, this.H6)), "", ", ", "");
return $f_sc_IterableOnceOps__mkString__T__T__T__T($x_10.aB($m_sc_ArrayOps$().sN(ys, 0, (((-1) + this.H6) | 0))), "", ", ", "");
} else {
var $x_20 = $m_s_Predef$();
var xs$3 = this.sd;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class PythonFunction(val name: String,

override def getParamsString: String =
if (isMethod && params.nonEmpty)
params.drop(1).map(_.name).take(paramCount).mkString(", ")
params.drop(1).map(_.name).take(paramCount - 1).mkString(", ")
else
params.map(_.name).take(paramCount).mkString(", ")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class PythonFunction(val name: String,

override def getParamsString: String =
if (isMethod && params.nonEmpty)
params.drop(1).map(_.name).take(paramCount).mkString(", ")
params.drop(1).map(_.name).take(paramCount - 1).mkString(", ")
else
params.map(_.name).take(paramCount).mkString(", ")

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# parent3.child3.shape3
# class Shape:
# pos_x
# pos_y
# __init__(self, x, y)
# draw(self)
# extent(self)
# rotate_by(self, degrees = 90)
# [Shape]make_shape()
# 49
# degrees=90
from parent3.child3.shape3 import *
make_shape().rotate_by()
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# pyi:parent4.child4.shapeparams4
# class Shape:
# def __init__(self, x, y) -> None: ...
# def draw(self) -> None: ...
# def extent(self) -> int: ...
# def rotate_by(self, units:str, degrees: float = 90) -> Shape: ...
# def make_shape() -> Shape: ...
# 55
# units
from parent4.child4.shapeparams4 import *
make_shape().rotate_by()
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# pyi:parent5.child5.shapeparams5
# class Shape:
# def __init__(self, x, y:float=...) -> None: ...
# def draw(self) -> None: ...
# def extent(self) -> int: ...
# def rotate_by(self, degrees: float = 90) -> Shape: ...
# def make_shape() -> Shape: ...
# def make_shape_at(x, y: int = ..., z:int = ...) -> None: ...
# 42
# x
from parent5.child5.shapeparams5 import *
make_shape_at()
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# parent6.child6.shapeparams6
# class Shape:
# pos_x
# pos_y
# __init__(self, x, y)
# draw(self)
# extent(self)
# rotate_by(self, degrees = 90)
# [Shape]make_shape()
# 55
#
from parent6.child6.shapeparams6 import *
make_shape().extent()
5 changes: 4 additions & 1 deletion tpParser/shared/src/test/scala/TestCompleter.scala
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ class TestCompleter extends FunSuite {
// some of the contents might be meaningfully indented so we can't just trim every line:
val module_name = leadingComments(0).drop(1).trim
val module_contents = leadingComments.slice(1, leadingComments.length - 2).map((x) => if (x.length < 2) x else x.substring(2))
ModuleLoader.addModule(module_name, module_contents)
if (module_name.startsWith("pyi:"))
ModuleLoader.addPyiModule(module_name.substring("pyi:".length), module_contents.mkString("\n"))
else
ModuleLoader.addModule(module_name, module_contents)
// Note: the module contents are not cleared between tests, so it's a good idea to name
// all involved modules uniquely to avoid interference.
}
Expand Down