Skip to content

Commit

Permalink
Merge pull request #1 from bsenduran/public-const
Browse files Browse the repository at this point in the history
Add public key to const defintion
  • Loading branch information
sameerajayasoma authored Jan 30, 2017
2 parents 60a6cba + e71b013 commit 1e991a1
Show file tree
Hide file tree
Showing 5 changed files with 850 additions and 841 deletions.
4 changes: 2 additions & 2 deletions docs/grammar/Ballerina.g4
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ structDefinition
;

structDefinitionBody
: '{' (Identifier ':' typeName ';')+ '}'
: '{' (typeName Identifier ';')+ '}'
;

typeConvertorDefinition
Expand All @@ -85,7 +85,7 @@ typeConvertorBody
;

constantDefinition
: 'const' typeName Identifier '=' literalValue ';'
: 'public'? 'const' typeName Identifier '=' literalValue ';'
;

// cannot have conector declaration, need to validate at semantic analyzing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ LINE_COMMENT=72
'('=4
')'=5
'native'=6
':'=7
'='=8
','=9
'='=7
','=8
':'=9
'[]'=10
'~'=11
'<'=12
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public class BallerinaLexer extends Lexer {
};

private static final String[] _LITERAL_NAMES = {
null, "';'", "'{'", "'}'", "'('", "')'", "'native'", "':'", "'='", "','",
null, "';'", "'{'", "'}'", "'('", "')'", "'native'", "'='", "','", "':'",
"'[]'", "'~'", "'<'", "'>'", "'.'", "'@'", "'->'", "'<-'", "'['", "']'",
"'+'", "'-'", "'!'", "'^'", "'/'", "'*'", "'%'", "'&&'", "'||'", "'>='",
"'<='", "'=='", "'!='", "'action'", "'all'", "'any'", "'as'", "'break'",
Expand Down Expand Up @@ -237,8 +237,8 @@ public BallerinaLexer(CharStream input) {
"\2\2\u00ef\u00f0\7*\2\2\u00f0\n\3\2\2\2\u00f1\u00f2\7+\2\2\u00f2\f\3\2"+
"\2\2\u00f3\u00f4\7p\2\2\u00f4\u00f5\7c\2\2\u00f5\u00f6\7v\2\2\u00f6\u00f7"+
"\7k\2\2\u00f7\u00f8\7x\2\2\u00f8\u00f9\7g\2\2\u00f9\16\3\2\2\2\u00fa\u00fb"+
"\7<\2\2\u00fb\20\3\2\2\2\u00fc\u00fd\7?\2\2\u00fd\22\3\2\2\2\u00fe\u00ff"+
"\7.\2\2\u00ff\24\3\2\2\2\u0100\u0101\7]\2\2\u0101\u0102\7_\2\2\u0102\26"+
"\7?\2\2\u00fb\20\3\2\2\2\u00fc\u00fd\7.\2\2\u00fd\22\3\2\2\2\u00fe\u00ff"+
"\7<\2\2\u00ff\24\3\2\2\2\u0100\u0101\7]\2\2\u0101\u0102\7_\2\2\u0102\26"+
"\3\2\2\2\u0103\u0104\7\u0080\2\2\u0104\30\3\2\2\2\u0105\u0106\7>\2\2\u0106"+
"\32\3\2\2\2\u0107\u0108\7@\2\2\u0108\34\3\2\2\2\u0109\u010a\7\60\2\2\u010a"+
"\36\3\2\2\2\u010b\u010c\7B\2\2\u010c \3\2\2\2\u010d\u010e\7/\2\2\u010e"+
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ LINE_COMMENT=72
'('=4
')'=5
'native'=6
':'=7
'='=8
','=9
'='=7
','=8
':'=9
'[]'=10
'~'=11
'<'=12
Expand Down
Loading

0 comments on commit 1e991a1

Please sign in to comment.