karols / fimpp Goto Github PK
View Code? Open in Web Editor NEWFIM++ interpreter
License: GNU General Public License v3.0
FIM++ interpreter
License: GNU General Public License v3.0
I'm trying to write the Fibonacci sequence in FiM++, but I get strange errors, to the point where I can't even use the syntax in the syntax folder anymore!
Example:
Rarity's Gems now becomes add Rarity's Gems and Spike's Hoard.
It claims that 'and' is not recognized, and the phrase:
Rarity's Gems now becomes Rarity's Gems plus Spike's Hoard.
Throws from the RegEx saying it was looking for 'got' but found '." (period) instead...
Am I just doing this all wrong, or is this more WiP than I though?
Conjuctions don't work well because the parser confuses the word and
with the syntax for tuples.
For instance, this works with or
:
Applejack has more than one or Pinkie Pie has more than one
[1.60] parsed: Alternative(
List(
Relational(
VariableValue(applejack),>,NumberValue(1)
),
Relational(
VariableValue(pinkie pie),>,NumberValue(1)
)
)
)
However, replacing or
with and
:
Applejack has more than one and Pinkie Pie has more than one
[1.47] failure: ‘Has’ ain't no pony I've heard of. Do they have tea parties with ‘Has’?
The source of the problem is that the parser attempts to make a tuple from one and Pinkie Pie has ...
, which in turn attempts to make an identifier from Pinkie Pie has ...
. This then fails here because has
is a keyword.
I think ^?
combinator is not the right approach here. The check for keywords should make the parser backtrack instead of failing.
Error: Could not find or load main class stasiak.karol.fimpp.main
Not sure if it is my fault, or a code error, or what. I have the newest JDK, recompiled from scala, ran straight out of the box, compiled into new jars twice, and everything. Not sure exactly whats going on. Is something mislabeled in the code or am I completely missing something?
The supplied jar works. But if I make a new one with make, and then try to interpret some example, I get:
parsing: examples/fibonacci.fimpp
Exception in thread "main" java.lang.NoSuchMethodError: scala.util.parsing.combinator.Parsers$class.lastNoSuccess_$eq(Lscala/util/parsing/combinator/Parsers;Lscala/util/parsing/combinator/Parsers$NoSuccess;)V
at stasiak.karol.fimpp.FimppParser$.lastNoSuccess_$eq(FimppParser.scala:5)
at scala.util.parsing.combinator.Parsers$class.$init$(Parsers.scala:151)
at stasiak.karol.fimpp.FimppParser$.<init>(FimppParser.scala:5)
at stasiak.karol.fimpp.FimppParser$.<clinit>(FimppParser.scala)
at stasiak.karol.fimpp.Main$.main(Main.scala:22)
at stasiak.karol.fimpp.Main.main(Main.scala)
For reference, this is the output of make:
src/stasiak/karol/fimpp/FimppParser.scala:334: warning: match may not be exhaustive.
It would fail on the following input: Error(_, _)
parseAll(module,s) match {
^
warning: there were 2 feature warnings; re-run with -feature for details
two warnings found
cd target && jar cfe ../bin/fimpp.jar stasiak.karol.fimpp.Main stasiak
If one updates both Scala and Java to compile, the later version of scala will require both building and running linked to the scala-parser-combinators jar file. I am not sure what the solution should be. My suggestions would be either a version requirement or version checking in the makefile.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.