d: remove unnecessary methods from the Lexer interface

The complete symbol approach in yylex removes the need for the methods
semanticVal, startPos and endPos, which were used when the values were
reported separately.

* data/skeletons/lalr1.d: Here.
* doc/bison.texi: Remove sections about the three methods.
* examples/d/calc/calc.y, examples/d/simple/calc.y: Remove the unused methods.
* tests/calc.at, tests/d.at, tests/scanner.at: Test it.
This commit is contained in:
Adela Vais
2020-12-21 15:49:27 +02:00
committed by Akim Demaille
parent 27109d9d4a
commit 32bb53870b
7 changed files with 1 additions and 69 deletions

View File

@@ -108,11 +108,6 @@ if (isInputRange!R && is(ElementType!R : dchar))
Value semanticVal_;
public final Value semanticVal()
{
return semanticVal_;
}
Symbol yylex()
{
import std.uni : isWhite, isNumber;
@@ -167,16 +162,6 @@ if (isInputRange!R && is(ElementType!R : dchar))
default: assert(0);
}
}
Position startPos() const
{
return location.begin;
}
Position endPos() const
{
return location.end;
}
}
int main()