mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 20:33:03 +00:00
d: examples: simple: fix style
* examples/d/simple/calc.y: Formatting changes.
This commit is contained in:
committed by
Akim Demaille
parent
615bad4186
commit
d53bbd5f06
@@ -115,16 +115,16 @@ if (isInputRange!R && is(ElementType!R : dchar))
|
|||||||
|
|
||||||
// Numbers.
|
// Numbers.
|
||||||
if (input.front.isNumber)
|
if (input.front.isNumber)
|
||||||
{
|
{
|
||||||
import std.conv : parse;
|
import std.conv : parse;
|
||||||
return Symbol(TokenKind.NUM, input.parse!int);
|
return Symbol(TokenKind.NUM, input.parse!int);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Individual characters
|
// Individual characters
|
||||||
auto ch = input.front;
|
auto ch = input.front;
|
||||||
input.popFront;
|
input.popFront;
|
||||||
switch (ch)
|
switch (ch)
|
||||||
{
|
{
|
||||||
case '+': return Symbol(TokenKind.PLUS);
|
case '+': return Symbol(TokenKind.PLUS);
|
||||||
case '-': return Symbol(TokenKind.MINUS);
|
case '-': return Symbol(TokenKind.MINUS);
|
||||||
case '*': return Symbol(TokenKind.STAR);
|
case '*': return Symbol(TokenKind.STAR);
|
||||||
@@ -133,7 +133,7 @@ if (isInputRange!R && is(ElementType!R : dchar))
|
|||||||
case ')': return Symbol(TokenKind.RPAR);
|
case ')': return Symbol(TokenKind.RPAR);
|
||||||
case '\n': return Symbol(TokenKind.EOL);
|
case '\n': return Symbol(TokenKind.EOL);
|
||||||
default: assert(0);
|
default: assert(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user