* Reorganize files in TestSuite dir for multiple languages * Add SPython samples to TestSuite * Update TestRunner to support multiple languages * Delete dll files accidentally pushed * Update .gitignore * Revert "Delete dll files accidentally pushed" This reverts commit 62bcba2b821d58ae51ec98e9dadcf621bb0fc003. * Update testing dir path in Testing.cs * Improve TestRunner output * Add random module and it's usage sample * Reorganize gitignore files * Move pascal tests back to TestSuite and create new TestSuiteLanguagePlugins folder for SPython * Revert "Update testing dir path in Testing.cs" This reverts commit 7d94eafb25292421bce8315520b4f6a0de001bbd. * Revert crlf changes in pascal tests * Test changes of _RebuildReleaseAndRunTestsForGitHubActions.bat * Revert "Test changes of _RebuildReleaseAndRunTestsForGitHubActions.bat" This reverts commit 234ceae3e3a339fbc68a6170e2bd201dab14d67d. * Test changes in StorageLocationPicker * Another test changes in StorageLocationPicker.cs * Rename LanguagePlugins folder to AdditionalLanguages * Decouple TestRunner from language names and parameters * Revert calling TestRunner without parameters in .bat files * Fix formatter tests nogui exception handling * Small refactoring in Testing.cs and TestRunner fix of working directory
46 lines
1.7 KiB
C#
46 lines
1.7 KiB
C#
using PascalABCCompiler.Parsers;
|
|
using SPythonParserYacc;
|
|
|
|
namespace SPythonParser
|
|
{
|
|
|
|
public class SPythonKeywords : BaseKeywords
|
|
{
|
|
|
|
protected override string FileName => "keywordsmap.pys";
|
|
|
|
public SPythonKeywords() : base(true)
|
|
{
|
|
CreateNewKeyword("if", Tokens.IF);
|
|
CreateNewKeyword("elif", Tokens.ELIF);
|
|
CreateNewKeyword("else", Tokens.ELSE);
|
|
CreateNewKeyword("while", Tokens.WHILE);
|
|
CreateNewKeyword("for", Tokens.FOR);
|
|
CreateNewKeyword("in", Tokens.IN);
|
|
CreateNewKeyword("def", Tokens.DEF, KeywordKind.Function, true);
|
|
CreateNewKeyword("return", Tokens.RETURN);
|
|
CreateNewKeyword("break", Tokens.BREAK);
|
|
CreateNewKeyword("continue", Tokens.CONTINUE);
|
|
CreateNewKeyword("and", Tokens.AND);
|
|
CreateNewKeyword("or", Tokens.OR);
|
|
CreateNewKeyword("not", Tokens.NOT);
|
|
CreateNewKeyword("import", Tokens.IMPORT /*, KeywordKind.Uses*/);
|
|
CreateNewKeyword("from", Tokens.FROM);
|
|
CreateNewKeyword("global", Tokens.GLOBAL);
|
|
CreateNewKeyword("True", Tokens.TRUE);
|
|
CreateNewKeyword("False", Tokens.FALSE);
|
|
CreateNewKeyword("as", Tokens.AS);
|
|
CreateNewKeyword("pass", Tokens.PASS);
|
|
CreateNewKeyword("class", Tokens.CLASS, isTypeKeyword: true);
|
|
CreateNewKeyword("lambda", Tokens.LAMBDA);
|
|
CreateNewKeyword("exit", Tokens.EXIT);
|
|
CreateNewKeyword("new", Tokens.NEW, KeywordKind.New);
|
|
CreateNewKeyword("is", Tokens.IS);
|
|
CreateNewKeyword("decltype", Tokens.DECLTYPE);
|
|
}
|
|
|
|
protected override int GetIdToken() => (int)Tokens.ID;
|
|
}
|
|
|
|
}
|