Commit 9a212c32 authored by Custom2043's avatar Custom2043
Browse files

Add doc

parent a5a36fb0
......@@ -339,7 +339,9 @@ If the current token is still null, then the search is successful if the file's
- If the transient's first search is a TokenSearch of a non-transient identifier
Then the search is successful if the current token matches the identifier.
Then the search is successful if the current token matches the identifier.
This token can be declared after the transient line. That's because the transient token can be build from anywhere, and thus the current token can be anything. Plus, there is no risk of a left-recursion since the token is not build here, it is just checked.
......@@ -353,6 +355,15 @@ Thus we need to create the referenced token with the current one. To prevent lef
Other tokens are build exactly as it would be as a classic token.
### Transient with only previous search
If a TokenSearch referencing a transient token is preceded with a '#', then lines are read up to the current line, instead of the transient token's declaration line.
Identifier = #Token
This is useful when some token can only use those declared before him. It can only be used on transient token. It can be used on the first search, even though it doesn't have any effect.
### Strings
String are considered as transient, as they can't be a current token and generally follow the same construction rules as transient tokens do.
......
......@@ -176,7 +176,7 @@ public class Compiler
if (!found)
report(new Info(InfoModel.tokenUndeclared, token));
else if (first && foundAfterThisLine)
if ((currentLine.header.trans != null) || !tokenTransient)
if ((currentLine.header.trans != null) == tokenTransient)
report(new Info(InfoModel.firstTokenUndeclared, token));
if (!tokenTransient && tokenSearch.trans != null)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment