Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pratter
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
koizel
pratter
Commits
12d599ce
Commit
12d599ce
authored
4 years ago
by
koizel
Browse files
Options
Downloads
Plain Diff
Merge branch 'hotfix-1.0.1'
parents
559126a5
25a7ae35
No related branches found
Branches containing commit
Tags
1.0.1
Tags containing commit
No related merge requests found
Pipeline
#3398
passed with stage
Stage: test
in 27 minutes and 4 seconds
Changes
4
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
.gitlab-ci.yml
+22
-0
22 additions, 0 deletions
.gitlab-ci.yml
CHANGELOG.md
+7
-0
7 additions, 0 deletions
CHANGELOG.md
pratter.opam
+2
-2
2 additions, 2 deletions
pratter.opam
t/main.ml
+12
-5
12 additions, 5 deletions
t/main.ml
with
43 additions
and
7 deletions
.gitlab-ci.yml
0 → 100644
+
22
−
0
View file @
12d599ce
image
:
ocaml/opam2
stages
:
-
test
test
:
stage
:
test
cache
:
key
:
"
$CI_COMMIT_REF_SLUG"
paths
:
-
_opam
script
:
-
sudo apt install -y m4
-
opam repository set-url default https://opam.ocaml.org
-
opam update
-
opam switch $OCAML_VERSION
-
opam install --deps-only -t -y .
-
eval $(opam env)
-
dune runtest
parallel
:
matrix
:
-
OCAML_VERSION
:
[
"
4.02"
,
"
4.04"
,
"
4.06"
,
"
4.07"
,
"
4.08"
,
"
4.09"
,
"
4.10"
]
This diff is collapsed.
Click to expand it.
CHANGELOG.md
+
7
−
0
View file @
12d599ce
...
...
@@ -3,6 +3,13 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
## [Unreleased]
## [1.0.1] -- 2021-01-16
### Fixed
-
Correct OCaml dependency
-
Tests comply with OCaml 4.02
### Added
-
Gitlab continuous integration
## [1.0] -- 2021-01-14
### Changed
-
API: parser uses a data structure passed as argument
...
...
This diff is collapsed.
Click to expand it.
pratter.opam
+
2
−
2
View file @
12d599ce
opam-version: "2.0"
version: "1.0"
version: "1.0
.1
"
synopsis:
"An implementation of the Pratt parsing algorithm for first order terms"
description: """
...
...
@@ -13,7 +13,7 @@ license: "BSD-3-Clause"
homepage: "https://github.com/gabrielhdt/pratter"
bug-reports: "https://github.com/gabrielhdt/pratter/issues"
depends: [
"ocaml" {>= "4.0
.5
"}
"ocaml" {>= "4.0
2
"}
"dune" {>= "2.7"}
"alcotest" {with-test}
"odoc" {with-doc}
...
...
This diff is collapsed.
Click to expand it.
t/main.ml
+
12
−
5
View file @
12d599ce
...
...
@@ -21,10 +21,18 @@ struct
type
nonrec
table
=
table
let
get_unary
{
unary
;
_
}
t
=
match
t
with
Symb
id
->
StrMap
.
find_opt
id
unary
|
_
->
None
match
t
with
|
Symb
id
->
(
try
Some
(
StrMap
.
find
id
unary
)
with
Not_found
->
None
)
|
_
->
None
let
get_binary
{
binary
;
_
}
t
=
match
t
with
Symb
id
->
StrMap
.
find_opt
id
binary
|
_
->
None
match
t
with
|
Symb
id
->
(
try
Some
(
StrMap
.
find
id
binary
)
with
Not_found
->
None
)
|
_
->
None
let
make_appl
_
t
u
=
Appl
(
t
,
u
)
end
...
...
@@ -46,7 +54,7 @@ module TTerm : Alcotest.TESTABLE with type t = term = struct
(** Syntactic equality *)
let
rec
equal
t
u
=
match
(
t
,
u
)
with
|
Symb
t
,
Symb
u
->
String
.
equal
t
u
|
Symb
t
,
Symb
u
->
t
=
u
|
Appl
(
t
,
t'
)
,
Appl
(
u
,
u'
)
->
equal
t
u
&&
equal
t'
u'
|
_
->
false
...
...
@@ -69,8 +77,7 @@ let simple_binary () =
let
two_operators
()
=
let
tbl
=
[
(
"+"
,
(
1
.
0
,
Pratter
.
Left
));
(
"*"
,
(
1
.
1
,
Pratter
.
Left
))
]
|>
List
.
to_seq
|>
StrMap
.
of_seq
StrMap
.(
empty
|>
add
"+"
(
1
.
0
,
Pratter
.
Left
)
|>
add
"*"
(
1
.
1
,
Pratter
.
Left
))
in
let
tbl
=
{
empty
with
binary
=
tbl
}
in
let
x
=
symb
"x"
in
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment