mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-22 22:16:16 +02:00
* Do not filter when parsing. This is much faster.
* Add some rejections and lexical restrictions to the grammar to make this work.
This commit is contained in:
parent
15801c88fa
commit
06ae269c7c
2 changed files with 7 additions and 0 deletions
|
@ -91,6 +91,10 @@ exports
|
|||
lexical syntax
|
||||
[a-zA-Z\_][a-zA-Z0-9\_\']* -> Id
|
||||
"rec" -> Id {reject}
|
||||
"let" -> Id {reject}
|
||||
"if" -> Id {reject}
|
||||
"then" -> Id {reject}
|
||||
"else" -> Id {reject}
|
||||
"true" -> Id {reject}
|
||||
"false" -> Id {reject}
|
||||
"assert" -> Id {reject}
|
||||
|
@ -108,6 +112,7 @@ exports
|
|||
lexical restrictions
|
||||
Id -/- [a-zA-Z0-9\_\']
|
||||
Int -/- [0-9]
|
||||
Path -/- [a-zA-Z0-9\.\_\-\+\/]
|
||||
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
@ -126,6 +131,7 @@ exports
|
|||
|
||||
"//" Uauthority Uabspath? -> Unetpath
|
||||
"/" Upathsegments -> Uabspath
|
||||
"//" Uuric* -> Uabspath {reject}
|
||||
Urelsegment Uabspath? -> Urelpath
|
||||
|
||||
(Uunreserved | Uescaped | [\;\@\&\=\+\$\,])+ -> Urelsegment
|
||||
|
|
|
@ -109,6 +109,7 @@ Expr parseExprFromFile(Path path)
|
|||
SG_OUTPUT_ON();
|
||||
SG_ASFIX2ME_ON();
|
||||
SG_AMBIGUITY_ERROR_ON();
|
||||
SG_FILTER_OFF();
|
||||
|
||||
initialised = true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue