Skip to content

Commit

Permalink
Accept underscores in module path (#58)
Browse files Browse the repository at this point in the history
* Accept underscores in module path (with a test)
  • Loading branch information
ManasJayanth authored Sep 24, 2019
1 parent fc67f23 commit 2416a5e
Show file tree
Hide file tree
Showing 10 changed files with 70 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
npm-debug.log
.merlin
yarn-error.log
node_modules
node_modules/
_build
_release
_esy/
y.install
.DS_Store
*.install
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(dirs (:standard \ node_modules \ _esy))
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
(lang dune 1.6)
(name pesy-c-stubs)
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Library.Util.foo();
Bar.bar();
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
let foo = () => print_endline("Hello");
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
let bar = () => print_endline("in bar");
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"name": "pesy-npm",
"version": "0.0.0",
"description": "My Project",
"esy": {
"build": "dune build -p #{self.name}",
"release": {
"releasedBinaries": [
"PesyNpmApp.exe"
]
}
},
"buildDirs": {
"test": {
"imports": [
"Library = require('pesy-npm/lib_foo')"
],
"bin": "TestPesyNpm.re"
},
"lib_foo": {},
"lib_foo/foo/bar": {},
"executable": {
"imports": [
"Bar = require('pesy-npm/lib_foo/foo/bar')",
"Library = require('pesy-npm/lib_foo')"
],
"bin": {
"pesy-npm-app.exe": "PesyNpmApp.re"
}
}
},
"scripts": {
"test": "esy b dune runtest"
},
"dependencies": {
"ocaml": "4.7.x",
"@opam/dune": ">=1.6.0",
"@esy-ocaml/reason": "*",
"refmterr": "*",
"pesy": "*",
"refmterr": "*"
},
"devDependencies": {
"@opam/merlin": "*"
},
"resolutions": {
"pesy": "<RESOLUTION_LINK>"
}
}
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Library.Util.foo();
print_endline("Add Your Test Cases Here");
2 changes: 1 addition & 1 deletion lib/Lexer.mll
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ rule read = parse
| "require" { REQUIRE }
| ['\''] { SQUOTE }
| ['A' - 'Z' ] [ 'A' - 'Z' 'a' - 'z' '_'] * as lxm { MODULE_NAME(lxm) }
| ['@'] ? ['a'-'z' '.' '/' '-' '0'-'9'] + as lxm { MODULE_PATH(lxm) }
| ['@'] ? ['a'-'z' '.' '/' '-' '0'-'9' '_'] + as lxm { MODULE_PATH(lxm) }
| ['\n'] {EOL}
| eof {EOF}

0 comments on commit 2416a5e

Please sign in to comment.