From f33918748aee39ce2e1f6d9cf39518a160bad7ab Mon Sep 17 00:00:00 2001 From: Kiith-Sa Date: Thu, 27 Dec 2012 21:21:56 +0100 Subject: [PATCH] Replaced 'in' by 'const' in exception, scanner. --- dyaml/exception.d | 2 +- dyaml/scanner.d | 44 ++++++++++++++++++++++---------------------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/dyaml/exception.d b/dyaml/exception.d index cd0e944..d280dd3 100644 --- a/dyaml/exception.d +++ b/dyaml/exception.d @@ -38,7 +38,7 @@ struct Mark public: ///Construct a Mark with specified line and column in the file. - this(in uint line, in uint column) pure @safe nothrow + this(const uint line, const uint column) pure @safe nothrow { line_ = cast(ushort)min(ushort.max, line); column_ = cast(ushort)min(ushort.max, column); diff --git a/dyaml/scanner.d b/dyaml/scanner.d index 83c89f4..f7401f9 100644 --- a/dyaml/scanner.d +++ b/dyaml/scanner.d @@ -182,7 +182,7 @@ final class Scanner * or if there are any tokens left if no types specified. * false otherwise. */ - bool checkToken(in TokenID[] ids ...) @safe + bool checkToken(const TokenID[] ids ...) @safe { //Check if the next token is one of specified types. while(needMoreTokens()){fetchToken();} @@ -379,7 +379,7 @@ final class Scanner * * Params: column = Current column in the file/stream. */ - void unwindIndent(in int column) @trusted + void unwindIndent(const int column) @trusted { if(flowLevel_ > 0) { @@ -789,7 +789,7 @@ final class Scanner } ///Scan a string of alphanumeric or "-_" characters. - dstring scanAlphaNumeric(string name)(in Mark startMark) @trusted + dstring scanAlphaNumeric(string name)(const Mark startMark) @trusted { uint length = 0; dchar c = reader_.peek(); @@ -873,7 +873,7 @@ final class Scanner } ///Scan name of a directive token. - dstring scanDirectiveName(in Mark startMark) @trusted + dstring scanDirectiveName(const Mark startMark) @trusted { //Scan directive name. const name = scanAlphaNumeric!"a directive"(startMark); @@ -886,7 +886,7 @@ final class Scanner } ///Scan value of a YAML directive token. Returns major, minor version separated by '.'. - dstring scanYAMLDirectiveValue(in Mark startMark) @trusted + dstring scanYAMLDirectiveValue(const Mark startMark) @trusted { findNextNonSpace(); @@ -907,7 +907,7 @@ final class Scanner } ///Scan a number from a YAML directive. - dstring scanYAMLDirectiveNumber(in Mark startMark) @trusted + dstring scanYAMLDirectiveNumber(const Mark startMark) @trusted { enforce(isDigit(reader_.peek()), new Error("While scanning a directive", startMark, @@ -922,7 +922,7 @@ final class Scanner } ///Scan value of a tag directive. - dstring scanTagDirectiveValue(in Mark startMark) @safe + dstring scanTagDirectiveValue(const Mark startMark) @safe { findNextNonSpace(); const handle = scanTagDirectiveHandle(startMark); @@ -931,7 +931,7 @@ final class Scanner } ///Scan handle of a tag directive. - dstring scanTagDirectiveHandle(in Mark startMark) @trusted + dstring scanTagDirectiveHandle(const Mark startMark) @trusted { const value = scanTagHandle("directive", startMark); enforce(reader_.peek() == ' ', @@ -942,7 +942,7 @@ final class Scanner } ///Scan prefix of a tag directive. - dstring scanTagDirectivePrefix(in Mark startMark) @trusted + dstring scanTagDirectivePrefix(const Mark startMark) @trusted { const value = scanTagURI("directive", startMark); enforce(" \0\n\r\u0085\u2028\u2029"d.canFind(reader_.peek()), @@ -954,7 +954,7 @@ final class Scanner } ///Scan (and ignore) ignored line after a directive. - void scanDirectiveIgnoredLine(in Mark startMark) @trusted + void scanDirectiveIgnoredLine(const Mark startMark) @trusted { findNextNonSpace(); if(reader_.peek() == '#'){scanToNextBreak();} @@ -1061,7 +1061,7 @@ final class Scanner } ///Scan a block scalar token with specified style. - Token scanBlockScalar(in ScalarStyle style) @system + Token scanBlockScalar(const ScalarStyle style) @system { const startMark = reader_.mark; @@ -1142,7 +1142,7 @@ final class Scanner } ///Scan chomping and indentation indicators of a scalar token. - Tuple!(Chomping, int) scanBlockScalarIndicators(in Mark startMark) @trusted + Tuple!(Chomping, int) scanBlockScalarIndicators(const Mark startMark) @trusted { auto chomping = Chomping.Clip; int increment = int.min; @@ -1185,7 +1185,7 @@ final class Scanner } ///Scan (and ignore) ignored line in a block scalar. - void scanBlockScalarIgnoredLine(in Mark startMark) @trusted + void scanBlockScalarIgnoredLine(const Mark startMark) @trusted { findNextNonSpace(); if(reader_.peek == '#'){scanToNextBreak();} @@ -1220,7 +1220,7 @@ final class Scanner } ///Scan line breaks at lower or specified indentation in a block scalar. - Tuple!(dchar[], Mark) scanBlockScalarBreaks(in uint indent) @safe + Tuple!(dchar[], Mark) scanBlockScalarBreaks(const uint indent) @safe { dchar[] chunks; Mark endMark = reader_.mark; @@ -1237,7 +1237,7 @@ final class Scanner } ///Scan a qouted flow scalar token with specified quotes. - Token scanFlowScalar(in ScalarStyle quotes) @system + Token scanFlowScalar(const ScalarStyle quotes) @system { const startMark = reader_.mark; const quote = reader_.get(); @@ -1259,7 +1259,7 @@ final class Scanner } ///Scan nonspace characters in a flow scalar. - void scanFlowScalarNonSpaces(in ScalarStyle quotes, in Mark startMark) @system + void scanFlowScalarNonSpaces(const ScalarStyle quotes, const Mark startMark) @system { for(;;) { @@ -1346,7 +1346,7 @@ final class Scanner } ///Scan space characters in a flow scalar. - void scanFlowScalarSpaces(in Mark startMark) @system + void scanFlowScalarSpaces(const Mark startMark) @system { uint length = 0; while(" \t"d.canFind(reader_.peek(length))){++length;} @@ -1374,7 +1374,7 @@ final class Scanner } ///Scan line breaks in a flow scalar. - dstring scanFlowScalarBreaks(in Mark startMark) @system + dstring scanFlowScalarBreaks(const Mark startMark) @system { auto appender = appender!dstring(); for(;;) @@ -1464,7 +1464,7 @@ final class Scanner } ///Scan spaces in a plain scalar. - dstring scanPlainSpaces(in Mark startMark) @system + dstring scanPlainSpaces(const Mark startMark) @system { ///The specification is really confusing about tabs in plain scalars. ///We just forbid them completely. Do not use tabs in YAML! @@ -1512,7 +1512,7 @@ final class Scanner } ///Scan handle of a tag token. - dstring scanTagHandle(const string name, in Mark startMark) @system + dstring scanTagHandle(const string name, const Mark startMark) @system { dchar c = reader_.peek(); enforce(c == '!', @@ -1541,7 +1541,7 @@ final class Scanner } ///Scan URI in a tag token. - dstring scanTagURI(const string name, in Mark startMark) @system + dstring scanTagURI(const string name, const Mark startMark) @system { //Note: we do not check if URI is well-formed. //Using appender_, so clear it when we're done. @@ -1573,7 +1573,7 @@ final class Scanner } ///Scan URI escape sequences. - dstring scanURIEscapes(const string name, in Mark startMark) @system + dstring scanURIEscapes(const string name, const Mark startMark) @system { ubyte[] bytes; Mark mark = reader_.mark;