-
Notifications
You must be signed in to change notification settings - Fork 126
Filename extensions
This appendix lists the different filename extensions you can meet in an Opa project, with a short description of the nature of the corresponding file or directory.
This part describes for each kind of file in an Opa project :
- a description of the file, meaning what kind of file it is, and what it contains ;
- an output section, documenting what tool/application produces these files ;
- an input section, documenting what tool or what application actually reads these files
api files are text files using a json syntax for encoding the types informations extracted from Opa files, associated to their positions in the source code.
For each opa file, there can be one corresponding api file, generated by the opa compiler using the option --api
user@computer:~/$ ls
bar foo.opa
user@computer:~/$ ls bar
bar.opa
user@computer:~/$ opa --api bar/bar.opa foo.opa
user@computer:~/$ ls
bar foo.api foo.opa foo.exe
user@computer:~/$ ls bar
bar.api bar.opa
These files are text files written using the Opa classic syntax, containing the inferred types of toplevel elements of a corresponding Opa file. They contain a subset of the information contained in a api file, but in an human readable syntax (opa rather than json).
Same than api files, generated by opa with the option --api
Meant to be read by an human, e.g. for debugging.
Configuration of packages for building medium and large applications. These files are used for setting the package organisation of an application, without editing the source files. Their utilisation is optional. It offers a functionality equivalent with the keyword import and package of the Opa syntax.
Hand written by an author of an opa application.
opa
Commented line starts with a sharp character '#'. Then it follows the entry point packages of this grammar :
:: packages <- package list
package <- $package_name ":" entry list
entry <- import / source
import <- "import" package_entry
source <- $filename
package_entry <- $package_name / $extension_package_name
TIP: About filename
- Relative path of filenames are given from the emplacement of the conf file itself
- It is possible to refer to environment variables in a conf file
TIP: About package_name
They follows the same conventions as the import construct in Opa, but no spaces are allowed using the extension syntax, as in these examples: examples:
import stdlib.* import toto.{foo,bar}
Here is a small example:
# a first package, with 2 files
my_package:
import toto.{foo,bar}
relative/path/to/myfile.opa
relative/path/to/myotherfile.opa
# a second package, importing the first one
my.other.package:
import my_package
path/to/some_file.opa
conf for bsl js files, Cf part about plugin for the syntax of these files
Hand written by the author of a js plugin.
opa-plugin-builder
This is the extension of the Opa files. Most of the files in an Opa project are .opa files
Hand written by authors of an Opa application.
opa
opack files are used to group the command line options and arguments for invoking opa to build an Opa application.
user@computer:~/$ opa myproject.opack
is almost equivalent to
user@computer:~/$ cat myproject.opack | grep -v '#' | xargs opa
Hand written by authors of an Opa application.
opa
This is a file where lines correspond to argument or options of the opa compiler.
Lines may be commented with #
, and it is possible to refer to environment variables in a conf file
# This is an example of opack file
myfile_1.opa
myfile_2.opa
--warn-error root
opp stands for OPa Plugin. An opp is a directory containing object files and compiled code, for building an Opa application using external primitives written directly in JavaScript.
opa, opa-plugin-builder
opa, opa-plugin-browser
An opx is a directory containing object files and compiled code from a Opa package. For each Opa package correspond one opx directory once compiled by opa. Some opx files are distributed with opa, these are the compiled packages of the standard library.
opa
opa
- A tour of Opa
- Getting started
- Hello, chat
- Hello, wiki
- Hello, web services
- Hello, web services -- client
- Hello, database
- Hello, reCaptcha, and the rest of the world
- The core language
- Developing for the web
- Xml parsers
- The database
- Low-level MongoDB support
- Running Executables
- The type system
- Filename extensions