Parse error on comments in Agda for Emacs? - agda

I've tried type checking modules programs that import modules from Builtin or the standard library, it always brings me to some module in the particular library that I'm importing from and says there's a parse error on a comment. When it does this on a file in the standard library I just delete the comment, but it won't let me edit files in Builtin. I'm using Emacs 25.1 and Agda 2.4.2. What should I do? Specifically, I'm importing Agda.Builtin.Float and it's giving me a parse error on
{-# COMPILED_DATA_UHC Bool_BOOL_ _FALSE_ _TRUE_ #-}
in Agda.Builtin.Bool

Related

How to fix errors in "Total Parser Combinators" by Nils Anders Danielsson

Note: This was originally posted with incorrect error message and is now corrected.
Am trying to compile the Agda source code associated with the paper Total Parser Combinators by Nils Anders Danielsson. The source code is available here github. When compiling I am getting the following error:
Not in scope:
return′
at parser-combinators-master/TotalParserCombinators/Parser.agda:99,46-53 when scope checking return′
I am using Agda version 2.6.2 and have updated std-lib using cabal (according to instructions on Agda Wiki) and the agda/libs/agda-stdlib/README.agda states
This version of the library has been tested using Agda 2.6.2.
I am very much not not an Agda expert; my motivation is the paper as opposed to the code per se. It would, however, be extremely useful to have the code working.
Any pointers on where to look, what to check or to try greatly appreciated.

Agda Installation PLFA Configuration

I am trying to use the Programming Language Foundation with Agda plfa library, however the import does not appear to be working properly.
I have cloned the repository and added the repository path to: ~/.agda/libraries and plfa to ~/.agda/defaults.
When I create a test.agda file and check a single line
module plfa.part1.Naturals where
I get an import error:
You tried to load /Users/johngfisher/Desktop/agda_test/nats.agda
which defines the module plfa.part1.Naturals. However, according to
the include path this module should be defined in
/Users/johngfisher/agda_env/libraries/plfa/src/plfa/part1/Naturals.lagda.md
The file is present in the location the import is coming from so I am unsure of why Agda is unable to find it. Any help would be appreciated.
module plfa.part1.Naturals where
defines a module named plfa.part1.Naturals
Did you mean to type
module test where
open import plfa.part1.Naturals
instead?

Parse c-clang index.h file with with clang itself

I am trying to parse c-clang index.h file with ClangSharp (just for testing purposes of ClangSharp parser on C#) and I found that it misses parsing of functions because of CINDEX_LINKAGE macro in the function declaration.
If I remove it, parser will correctly find FunctionDecl and parse it without errors.
I cannot understand how this macro preventing functions from being parsed. Does someone know how to workaround this?
Issue was in the #include line itself. By default, clang header includes setup to search in the directory on one level up, but clang itself by some reason does not understand such
include format.

Do anybody know how to generate the rsc file of jdt's parser

Do anybody know how to generate the rsc file of jdt's parser .I mean how to serialization the rule of parser .and where can i find the detail about the rule.
I have import jdt to my code ,and try to learn the rule of the parsr.
But the serialization rule confuse .Then i can easier to learn the rule if i find the code which is used to serialization the rule to rsc file.
http://www.eclipse.org/jdt/core/howto/generate%20parser/generateParser.html
i think i hava found the answer.

Is there a `quote`-like facility a la Lisp in Rascal

I know Rascal is intended to be a meta-language for other languages. Do these languages include Rascal itself? Is there any meta-facilities like quote a la Lisp available or planned?
You can transform Rascal using Rascal by including the Rascal syntax definition and simply using the normal quotes. We are not planning to add quoting at run-time for Rascal itself afaik.
One thing that I forgot to mention earlier, is that the "resources" mechanism can be used to manipulate Rascal code at "import" time. You can write any function as in:
#resource{myScheme}
str generateNewCode(str name, loc l) = ...
generateNewCode should generate a Rascal module with name name.
After this you can import as follows:
import MyModule = myScheme://someOtherModuleName;
And then the module that is generated by generateNewCode is imported by Rascal in the module that you typed the import in.
Nothing stops you from writing a generateNewCode function that parses another module, rewrites or extends it and then will be imported.

Resources