Skip to content

Commit

Permalink
remove mod keyword
Browse files Browse the repository at this point in the history
  • Loading branch information
TimWhiting committed Dec 30, 2023
1 parent c734294 commit c7fb71d
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 10 deletions.
1 change: 0 additions & 1 deletion doc/spec/grammar/lexer.l
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ match { return MATCH;}
return { return RETURN;}

module { return MODULE;}
mod { return MOD;}
import { return IMPORT;}
pub { return PUB;}
as { return AS;}
Expand Down
6 changes: 1 addition & 5 deletions doc/spec/grammar/parser.y
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,10 @@ void printDecl( const char* sort, const char* name );
-- Program
----------------------------------------------------------*/

program : semis modkeyword modulepath moduledecl { printDecl("module",$3); }
program : semis MODULE modulepath moduledecl { printDecl("module",$3); }
| moduledecl { printDecl("module","main"); }
;

modkeyword : MODULE
| MOD
;

moduledecl : '{' semis modulebody '}' semis
| semis modulebody
;
Expand Down
4 changes: 2 additions & 2 deletions doc/spec/spec.kk.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ grammar will draw it's lexemes from the _lex_ production.
| _idfinal_ | ::= | [``'``]{.many} | |
|   | | | |
| _reserved_ | ::= | `infix` &bar; `infixr` &bar; `infixl` | |
| | &bar; | ``module`` &bar; `mod` &bar; `import` &bar; `as` | |
| | &bar; | ``module`` &bar; `import` &bar; `as` | |
| | &bar; | ``pub`` &bar; `abstract` | |
| | &bar; | `type` &bar; `struct` &bar; `alias` &bar; `effect` &bar; `con` | |
| | &bar; | `forall` &bar; `exists` &bar; `some` | |
Expand Down Expand Up @@ -485,7 +485,7 @@ ignored.
|~~~~~~~~~~~~~~~~~~~~~~~~~|~~~~~~~|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|~~~|
| _module_~[_lex_]{.opt}~ | ::= | [_moduledecl_]{.opt} _modulebody_ | |
|   | | | |
| _moduledecl_ | ::= | _semis_ (`module` &bar; `mod`) _moduleid_ | |
| _moduledecl_ | ::= | _semis_ `module` _moduleid_ | |
| _moduleid_ | ::= | _qvarid_ &bar; _varid_ | |
|   | | | |
| _modulebody_ | ::= | `{` _semis_ _declarations_ `}` _semis_ | |
Expand Down
4 changes: 2 additions & 2 deletions support/pygments/koka.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class KokaLexer(RegexLexer):

keywords = [
'infix', 'infixr', 'infixl',
'module', 'import', 'as', 'mod'
'module', 'import', 'as',
'pub', 'abstract', 'ctx'
'type', 'struct', 'alias', 'effect', 'con',
'forall', 'exists', 'some',
Expand Down Expand Up @@ -87,7 +87,7 @@ class KokaLexer(RegexLexer):

# special sequences of tokens (we use ?: for non-capturing group as
# required by 'bygroups')
(r'(module|mod)(\s+)(interface\s+)?((?:[a-z]\w*/)*[a-z]\w*)',
(r'(module)(\s+)(interface\s+)?((?:[a-z]\w*/)*[a-z]\w*)',
bygroups(Keyword, Text, Keyword, Name.Namespace)),
(r'(import)(\s+)((?:[a-z]\w*/)*[a-z]\w*)'
r'(?:(\s*)(=)(\s*)((?:qualified\s*)?)'
Expand Down

0 comments on commit c7fb71d

Please sign in to comment.