* Define paths using regexps, as is done in the Flex definition.
This commit is contained in:
parent
6f91f02f75
commit
6f82a78de7
1 changed files with 2 additions and 5 deletions
|
@ -93,7 +93,7 @@ exports
|
||||||
|
|
||||||
module Nix-Lexicals
|
module Nix-Lexicals
|
||||||
exports
|
exports
|
||||||
sorts Id Int Str Path PathComp Uri
|
sorts Id Int Str Path Uri
|
||||||
lexical syntax
|
lexical syntax
|
||||||
[a-zA-Z\_][a-zA-Z0-9\_\']* -> Id
|
[a-zA-Z\_][a-zA-Z0-9\_\']* -> Id
|
||||||
"rec" | "let" | "if" | "then" | "else" | "assert" | "with" | "inherit" -> Id {reject}
|
"rec" | "let" | "if" | "then" | "else" | "assert" | "with" | "inherit" -> Id {reject}
|
||||||
|
@ -102,10 +102,7 @@ exports
|
||||||
|
|
||||||
"\"" ~[\n\"]* "\"" -> Str
|
"\"" ~[\n\"]* "\"" -> Str
|
||||||
|
|
||||||
"." ("/" PathComp)+ -> Path
|
[a-zA-Z0-9\.\_\-\+]* ("/"[a-zA-Z0-9\.\_\-\+]+)+ -> Path
|
||||||
".." ("/" PathComp)+ -> Path
|
|
||||||
("/" PathComp)+ -> Path
|
|
||||||
[a-zA-Z0-9\.\_\-\+]+ -> PathComp
|
|
||||||
|
|
||||||
[a-zA-Z] [a-zA-Z0-9\+\-\.]* ":" [a-zA-Z0-9\%\/\?\:\@\&\=\+\$\,\-\_\.\!\~\*\']* -> Uri
|
[a-zA-Z] [a-zA-Z0-9\+\-\.]* ":" [a-zA-Z0-9\%\/\?\:\@\&\=\+\$\,\-\_\.\!\~\*\']* -> Uri
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue