Skip to content

Commit

Permalink
UpTo instead of AllExcept for generic token
Browse files Browse the repository at this point in the history
  • Loading branch information
b3b00 committed Jul 3, 2022
1 parent de27133 commit c534f26
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion samples/SimpleTemplate/TemplateLexer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public enum TemplateLexer

#region TEXT

[AllExcept("{%", "{=")]
[UpTo("{%", "{=")]
// [AllExcept("{%")]
TEXT,

Expand Down
2 changes: 1 addition & 1 deletion samples/XML/MinimalXmlLexer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public enum MinimalXmlLexer
[Push("tag")]
OPEN,

[AllExcept("<")]
[UpTo("<")]
CONTENT,

[Sugar("<?")]
Expand Down
4 changes: 2 additions & 2 deletions sly/lexer/GenericLexer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public enum GenericToken
Extension,

Comment,
AllExcept
UpTo
}

public enum IdentifierType
Expand Down Expand Up @@ -882,7 +882,7 @@ public void AddAllExcept(IN token, BuildResult<ILexer<IN>> buildResult, string[]

FSMBuilder.ExceptTransition(allExceptChars0)
.Mark(GetEndLabel(-1,-1))
.End(GenericToken.AllExcept)
.End(GenericToken.UpTo)
.CallBack(callback);
FSMBuilder.ExceptTransitionTo(allExceptChars0,GetEndLabel(-1,-1));
for (int i = 0; i < exceptions.Length; i++)
Expand Down
4 changes: 2 additions & 2 deletions sly/lexer/LexerBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ public static Dictionary<IN, List<LexemeAttribute>> GetLexemes<IN>(BuildResult<I
return attributes;
}

public static BuildResult<ILexer<IN>> BuildLexer<IN>(BuildExtension<IN> extensionBuilder = null) where IN : struct
public static BuildResult<ILexer<IN>> BuildLexer<IN>(BuildExtension<IN> extensionBuilder = null, LexerPostProcess<IN> lexerPostProcess = null) where IN : struct
{
return BuildLexer<IN>(new BuildResult < ILexer < IN >>() , extensionBuilder);
return BuildLexer<IN>(new BuildResult < ILexer < IN >>() , extensionBuilder, lexerPostProcess:lexerPostProcess);
}

public static BuildResult<ILexer<IN>> BuildLexer<IN>(BuildResult<ILexer<IN>> result,
Expand Down
4 changes: 2 additions & 2 deletions sly/lexer/attributes/AllExcept.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
namespace sly.lexer
{
public class AllExceptAttribute : LexemeAttribute
public class UpToAttribute : LexemeAttribute
{
public AllExceptAttribute(params string[] exceptions) : base(GenericToken.AllExcept, exceptions)
public UpToAttribute(params string[] exceptions) : base(GenericToken.UpTo, exceptions)
{
}
}
Expand Down
2 changes: 1 addition & 1 deletion sly/lexer/attributes/LexemeAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,6 @@ public LexemeAttribute(GenericToken generic, IdentifierType idType, string start
public bool IsIdentifier => GenericToken == GenericToken.Identifier;

public bool IsExtension => GenericToken == GenericToken.Extension;
public bool IsAllExcept => GenericToken == GenericToken.AllExcept;
public bool IsAllExcept => GenericToken == GenericToken.UpTo;
}
}
4 changes: 2 additions & 2 deletions sly/sly.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
<Description>#LY is a parser generator halfway between parser combinators and parser generator like ANTLR</Description>
<Authors>b3b00</Authors>
<version>2.9.0.3</version>
<version>2.9.0.4</version>
<PackageProjectUrl>https://github.com/b3b00/sly</PackageProjectUrl>
<RepositoryUrl>https://github.com/b3b00/sly</RepositoryUrl>
<License>https://github.com/b3b00/sly/blob/master/LICENSE</License>
<PackageVersion>2.9.0.3</PackageVersion>
<PackageVersion>2.9.0.4</PackageVersion>
<ApplicationIcon />
<OutputType>Library</OutputType>
<StartupObject />
Expand Down

0 comments on commit c534f26

Please sign in to comment.