Skip to content

test git push #345

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
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
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,8 @@ src/test/java/test/blog/TestLocalExample.java
*.aux
*.log
*.gz
.metals
.vscode
/project/build.properties
.idea
/out
3 changes: 3 additions & 0 deletions .idea/.gitignore

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

9 changes: 9 additions & 0 deletions .idea/blog.iml

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

7 changes: 7 additions & 0 deletions .idea/codeStyles/Project.xml

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

5 changes: 5 additions & 0 deletions .idea/codeStyles/codeStyleConfig.xml

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

10 changes: 10 additions & 0 deletions .idea/libraries/lib.xml

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

9 changes: 9 additions & 0 deletions .idea/libraries/sbt_launch.xml

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

6 changes: 6 additions & 0 deletions .idea/misc.xml

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

10 changes: 10 additions & 0 deletions .idea/modules.xml

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

6 changes: 6 additions & 0 deletions .idea/vcs.xml

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

55 changes: 28 additions & 27 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import com.typesafe.sbt.SbtNativePackager._
import NativePackagerKeys._
import NativePackagerHelper._
import scala.sys.process._

enablePlugins(JavaAppPackaging, UniversalPlugin)

name := "blog"

version := "0.10.alpha1"

javacOptions ++= Seq("-source", "1.5", "-target", "1.5")
javacOptions ++= Seq("-source", "11", "-target", "11")

//scalaVersion := "2.10.3"

Expand All @@ -16,9 +17,9 @@ artifactName := { (sv: ScalaVersion, module: ModuleID, artifact: Artifact) =>
artifact.name + "-" + module.revision + "." + artifact.extension
}

mainClass in (Compile) := Some("blog.Main")
Compile / mainClass := Some("blog.Main")

sources in (Compile, doc) ~= (_ filter (_.getName endsWith ".___")) // do not generate java doc, since it creates problem // TODO in the future, remove this line and fix documentation issue
Compile / doc / sources ~= (_ filter (_.getName endsWith ".___")) // do not generate java doc, since it creates problem // TODO in the future, remove this line and fix documentation issue

libraryDependencies += "gov.nist.math" % "jama" % "1.0.3"

Expand All @@ -31,7 +32,7 @@ libraryDependencies += "de.jflex" % "jflex" % "1.6.0"

libraryDependencies += "junit" % "junit" % "4.11" % "test"

parallelExecution in Test := false // disable parallel test
Test / parallelExecution := false // disable parallel test

// enable sbt to use junit
libraryDependencies += "com.novocode" % "junit-interface" % "0.10" % "test"
Expand All @@ -52,8 +53,8 @@ lazy val ghpages = taskKey[Unit]("Push updated html docs to github pages")

ghpages := {
html.value
(packageBin in Universal).value
(packageBin in Debian).value
(Universal / packageBin).value
(Debian / packageBin).value
"""docs/update_ghpages.sh""" !
}

Expand All @@ -62,7 +63,7 @@ lazy val parser = taskKey[Unit]("Generating parser files")
lazy val lexer = taskKey[Unit]("Generating lexer files")

lexer := {
val cpfiles = (fullClasspath in Test).value.files
val cpfiles = (Test / fullClasspath).value.files
println(cpfiles)
val cpString = cpfiles.map(_.getAbsolutePath).mkString(System.getProperty("path.separator"))
"""java -cp "%s" jflex.Main -d src/main/java/blog/parse src/parser/BLOGLexer.flex""".format(cpString) !
Expand All @@ -74,51 +75,51 @@ parser := {
}

// the following are packaging settings
packageArchetype.java_application // native package
// packageArchetype.java_application // native package

packageSummary in Linux := "BLOG Probabilistic Programming Language Inference Engine and Tools"
Linux / packageSummary := "BLOG Probabilistic Programming Language Inference Engine and Tools"

packageSummary in Windows := "BLOG Probabilistic Programming Language Inference Engine and Tools"
Windows / packageSummary := "BLOG Probabilistic Programming Language Inference Engine and Tools"

packageDescription := "BLOG Probabilistic Programming Language"

maintainer in Windows := "UC Berkeley RUGS"
Windows / maintainer := "UC Berkeley RUGS"

maintainer in Debian := "UC Berkeley RUGS"
Debian / maintainer := "UC Berkeley RUGS"

debianPackageDependencies in Debian ++= Seq("java2-runtime", "bash (>= 2.05a-11)")
Debian / debianPackageDependencies ++= Seq("java2-runtime", "bash (>= 2.05a-11)")

debianPackageRecommends in Debian += "scala"
Debian / debianPackageRecommends += "scala"

mappings in Universal ++= directory("example")
Universal / mappings ++= directory("example")

mappings in Universal ++= directory("target/pelican") map {case (f, s) => (f, s.replaceFirst("pelican", "docs"))}
Universal / mappings ++= directory("target/pelican") map {case (f, s) => (f, s.replaceFirst("pelican", "docs"))}

mappings in Universal += file("iblog") -> "bin/iblog"
Universal / mappings += file("iblog") -> "bin/iblog"

mappings in Universal += file("iblog.bat") -> "bin/iblog.bat"
Universal / mappings += file("iblog.bat") -> "bin/iblog.bat"

mappings in Universal += file("dblog") -> "bin/dblog"
Universal / mappings += file("dblog") -> "bin/dblog"

mappings in Universal += file("bloglint") -> "bin/bloglint"
Universal / mappings += file("bloglint") -> "bin/bloglint"

mappings in Universal += file("bloglint.bat") -> "bin/bloglint.bat"
Universal / mappings += file("bloglint.bat") -> "bin/bloglint.bat"

mappings in Universal += file("src/main/scala/iblog.scala") -> "bin/iblog.scala"
Universal / mappings += file("src/main/scala/iblog.scala") -> "bin/iblog.scala"

// Include debugging symbols in the compiled classes.
javacOptions += "-g"

scalacOptions += "-g:vars"

// Include the sources in the assembled jar.
unmanagedResourceDirectories in Compile += { baseDirectory.value / "src" }
Compile / unmanagedResourceDirectories += { baseDirectory.value / "src" }

// Stuff below if for ppaml-slam:
libraryDependencies += "com.github.tototoshi" %% "scala-csv" % "1.1.1"
libraryDependencies += "com.github.tototoshi" %% "scala-csv" % "1.3.10"

// This makes Eclipse see the stuff in src/main/resources properly:
EclipseKeys.createSrc := EclipseCreateSrc.Default + EclipseCreateSrc.Resource

// When adding new libraryDependencies, Eclipse will complain about not finding
// them. Run "sbt eclipse" to fix this.
// them. Run "sbt eclipse" to fix this.
Binary file added lib/com.google.code.gson.gson-2.2.4.jar
Binary file not shown.
Binary file added lib/de.jflex.jflex-1.6.0.jar
Binary file not shown.
Binary file added lib/default.blog-0.10.jar
Binary file not shown.
Binary file added lib/gov.nist.math.jama-1.0.3.jar
Binary file not shown.
Binary file added lib/org.apache.ant.ant-1.7.0.jar
Binary file not shown.
Binary file added lib/org.apache.ant.ant-launcher-1.7.0.jar
Binary file not shown.
Binary file added lib/org.apache.commons.commons-math3-3.0.jar
Binary file not shown.
Binary file added lib/org.scala-lang.scala-library-2.10.4.jar
Binary file not shown.
8 changes: 8 additions & 0 deletions out/test/test/test/blog/parse/error_examples/case.blog
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
random Integer f(Integer x) ~
case (x > 0) in { false => Gaussian(x, 1), true => Gaussian(x, 0) };

random Integer f(Integer x) ~
case (x > 0) { false => Gaussian(x, 1), true => Gaussian(x, 0) };

random Integer f(Integer x) ~
case (x > 0) { false -> Gaussian(x, 1), true -> Gaussian(x, 0) };
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
distinct City A B;
distinct City A,,B;
distinct City A[2], B[][];
distinct City A[2], B[];
distinct City A[;

2 changes: 2 additions & 0 deletions out/test/test/test/blog/parse/error_examples/evidence.blog
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
obs Real x = Severe;
obs Damage(First) = Real x;
12 changes: 12 additions & 0 deletions out/test/test/test/blog/parse/error_examples/fixedfuncdecl.blog
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
fixed Boolean Advises(Professor, Student s)
= Real x;

fixed Boolean Advises(Professor p,, Student s)
= 1;

fixed Boolean Advises(Professor p Student s)
= 1;

fixed Boolean Advises(Professor p, Student s)
1;

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
query GradeObtained(John, CS106));

query GradeObtained(John CS106);

query GradeObtained(John, CS106;
Empty file.
10 changes: 10 additions & 0 deletions out/test/test/test/blog/parse/error_examples/missingsemi.blog
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
random Integer z ~ Bernoulli(0.5);
1234 ;
obs x = 1;
ty;
type x, y;
type z;
type ;
random Real z ~ 1.0;
z;
random Real z ~ Gaussian(1, );
3 changes: 3 additions & 0 deletions out/test/test/test/blog/parse/error_examples/numberexpr.blog
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
query #{Person p true};

query #{Person p :: true};
3 changes: 3 additions & 0 deletions out/test/test/test/blog/parse/error_examples/numberstmt.blog
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# ~ Poisson(6);
#Ball ~ ;
#Ball ~ Real x;
5 changes: 5 additions & 0 deletions out/test/test/test/blog/parse/error_examples/obs.blog
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
obs team1player1(M[0]]) = James;

obs team1player1((M[0]) = James;

obs team1player1(M[0]) = ;
12 changes: 12 additions & 0 deletions out/test/test/test/blog/parse/error_examples/operationexpr.blog
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
fixed Integer y = + 2;

fixed Integer y = 1 +;

fixed Integer y = a[[2];

fixed Integer y = a[2;

fixed Integer y = a2];

fixed Integer y = ((1+2/3+4)/8;

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
origin Aircraft Source((Blip);

origin Source(Blip);

origin Aircraft Source(Blip;
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
query exists x (Birthday(x));
query exists Person x (Real x);
3 changes: 3 additions & 0 deletions out/test/test/test/blog/parse/error_examples/querystmt.blog
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
query;
query Real x;
query (!team1win(M[3])) && (team2player1(M[3]) == Mary);
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
random Date Birthday(Person p)
~ Real x;

random Date Birthday(Person p)
Real x;

Loading