Skip to content
Merged
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
18 changes: 18 additions & 0 deletions test/blackbox-tests/setup-script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,24 @@ make_menhir_parser_using_dep() {
EOF
}

write_menhir_merge_into_sources() {
cat >lang/sub/tokens.mly <<-'EOF'
%token <char> TOKEN
%token EOF
%%
EOF
cat >lang/sub/parser.mly <<-'EOF'
%start <char list> main
%%
main:
| c = TOKEN EOF { [c] }
| c = TOKEN xs = main { c :: xs }
EOF
cat >lang/sub/dune <<-'EOF'
(menhir (modules tokens parser) (merge_into both))
EOF
}

make_melange_virtual_time_project() {
local vlib_public_name="$1"
local impl_public_name="$2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,6 @@ Menhir parsers in qualified subdirectories should be able to refer to sibling mo

Use `merge_into`

$ cat >lang/sub/tokens.mly <<EOF
> %token <char> TOKEN
> %token EOF
> %%
> EOF
$ cat >lang/sub/parser.mly <<EOF
> %start <char list> main
> %%
> main:
> | c = TOKEN EOF { [c] }
> | c = TOKEN xs = main { c :: xs }
> EOF

$ cat >lang/sub/dune <<EOF
> (menhir (modules tokens parser) (merge_into both))
> EOF
$ write_menhir_merge_into_sources

$ dune build
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,7 @@ $ cat >ast.ml <<EOF

Use `merge_into`

$ cat >lang/sub/tokens.mly <<EOF
> %token <char> TOKEN
> %token EOF
> %%
> EOF
$ cat >lang/sub/parser.mly <<EOF
> %start <char list> main
> %%
> main:
> | c = TOKEN EOF { [c] }
> | c = TOKEN xs = main { c :: xs }
> EOF

$ cat >lang/sub/dune <<EOF
> (menhir (modules tokens parser) (merge_into both))
> EOF
$ write_menhir_merge_into_sources

$ dune build

Loading