Rename print to output

This commit is contained in:
Jeff 2023-10-10 15:50:57 -04:00
parent 532c751c36
commit a207087cca
6 changed files with 27 additions and 24 deletions

View File

@ -59,13 +59,13 @@ function <message number> {
(statement (statement
(expression (expression
(function_call (function_call
(identifier) (tool)
(expression (expression
(identifier))))) (identifier)))))
(statement (statement
(expression (expression
(function_call (function_call
(identifier) (tool)
(expression (expression
(identifier)))))))))))) (identifier))))))))))))

View File

@ -3,7 +3,7 @@ While Loop
================== ==================
while true { while true {
(print "This is a bad idea...") (output "This is a bad idea...")
} }
--- ---

View File

@ -178,7 +178,7 @@ module.exports = grammar({
), ),
tool: $ => choice( tool: $ => choice(
'print', 'output',
'read', 'read',
'write', 'write',
), ),

View File

@ -726,7 +726,7 @@
"members": [ "members": [
{ {
"type": "STRING", "type": "STRING",
"value": "print" "value": "output"
}, },
{ {
"type": "STRING", "type": "STRING",

View File

@ -598,7 +598,7 @@
"named": false "named": false
}, },
{ {
"type": "print", "type": "output",
"named": false "named": false
}, },
{ {

View File

@ -55,7 +55,7 @@ enum {
anon_sym_while = 36, anon_sym_while = 36,
anon_sym_for = 37, anon_sym_for = 37,
anon_sym_in = 38, anon_sym_in = 38,
anon_sym_print = 39, anon_sym_output = 39,
anon_sym_read = 40, anon_sym_read = 40,
anon_sym_write = 41, anon_sym_write = 41,
anon_sym_select = 42, anon_sym_select = 42,
@ -139,7 +139,7 @@ static const char * const ts_symbol_names[] = {
[anon_sym_while] = "while", [anon_sym_while] = "while",
[anon_sym_for] = "for", [anon_sym_for] = "for",
[anon_sym_in] = "in", [anon_sym_in] = "in",
[anon_sym_print] = "print", [anon_sym_output] = "output",
[anon_sym_read] = "read", [anon_sym_read] = "read",
[anon_sym_write] = "write", [anon_sym_write] = "write",
[anon_sym_select] = "select", [anon_sym_select] = "select",
@ -223,7 +223,7 @@ static const TSSymbol ts_symbol_map[] = {
[anon_sym_while] = anon_sym_while, [anon_sym_while] = anon_sym_while,
[anon_sym_for] = anon_sym_for, [anon_sym_for] = anon_sym_for,
[anon_sym_in] = anon_sym_in, [anon_sym_in] = anon_sym_in,
[anon_sym_print] = anon_sym_print, [anon_sym_output] = anon_sym_output,
[anon_sym_read] = anon_sym_read, [anon_sym_read] = anon_sym_read,
[anon_sym_write] = anon_sym_write, [anon_sym_write] = anon_sym_write,
[anon_sym_select] = anon_sym_select, [anon_sym_select] = anon_sym_select,
@ -424,7 +424,7 @@ static const TSSymbolMetadata ts_symbol_metadata[] = {
.visible = true, .visible = true,
.named = false, .named = false,
}, },
[anon_sym_print] = { [anon_sym_output] = {
.visible = true, .visible = true,
.named = false, .named = false,
}, },
@ -1192,7 +1192,7 @@ static bool ts_lex_keywords(TSLexer *lexer, TSStateId state) {
case 0: case 0:
if (lookahead == 'f') ADVANCE(1); if (lookahead == 'f') ADVANCE(1);
if (lookahead == 'i') ADVANCE(2); if (lookahead == 'i') ADVANCE(2);
if (lookahead == 'p') ADVANCE(3); if (lookahead == 'o') ADVANCE(3);
if (lookahead == 'r') ADVANCE(4); if (lookahead == 'r') ADVANCE(4);
if (lookahead == 's') ADVANCE(5); if (lookahead == 's') ADVANCE(5);
if (lookahead == 't') ADVANCE(6); if (lookahead == 't') ADVANCE(6);
@ -1213,7 +1213,7 @@ static bool ts_lex_keywords(TSLexer *lexer, TSStateId state) {
if (lookahead == 'n') ADVANCE(13); if (lookahead == 'n') ADVANCE(13);
END_STATE(); END_STATE();
case 3: case 3:
if (lookahead == 'r') ADVANCE(14); if (lookahead == 'u') ADVANCE(14);
END_STATE(); END_STATE();
case 4: case 4:
if (lookahead == 'e') ADVANCE(15); if (lookahead == 'e') ADVANCE(15);
@ -1250,7 +1250,7 @@ static bool ts_lex_keywords(TSLexer *lexer, TSStateId state) {
if (lookahead == 't') ADVANCE(26); if (lookahead == 't') ADVANCE(26);
END_STATE(); END_STATE();
case 14: case 14:
if (lookahead == 'i') ADVANCE(27); if (lookahead == 't') ADVANCE(27);
END_STATE(); END_STATE();
case 15: case 15:
if (lookahead == 'a') ADVANCE(28); if (lookahead == 'a') ADVANCE(28);
@ -1290,7 +1290,7 @@ static bool ts_lex_keywords(TSLexer *lexer, TSStateId state) {
if (lookahead == 'o') ADVANCE(39); if (lookahead == 'o') ADVANCE(39);
END_STATE(); END_STATE();
case 27: case 27:
if (lookahead == 'n') ADVANCE(40); if (lookahead == 'p') ADVANCE(40);
END_STATE(); END_STATE();
case 28: case 28:
if (lookahead == 'd') ADVANCE(41); if (lookahead == 'd') ADVANCE(41);
@ -1329,7 +1329,7 @@ static bool ts_lex_keywords(TSLexer *lexer, TSStateId state) {
ACCEPT_TOKEN(anon_sym_into); ACCEPT_TOKEN(anon_sym_into);
END_STATE(); END_STATE();
case 40: case 40:
if (lookahead == 't') ADVANCE(51); if (lookahead == 'u') ADVANCE(51);
END_STATE(); END_STATE();
case 41: case 41:
ACCEPT_TOKEN(anon_sym_read); ACCEPT_TOKEN(anon_sym_read);
@ -1362,10 +1362,10 @@ static bool ts_lex_keywords(TSLexer *lexer, TSStateId state) {
if (lookahead == 't') ADVANCE(58); if (lookahead == 't') ADVANCE(58);
END_STATE(); END_STATE();
case 51: case 51:
ACCEPT_TOKEN(anon_sym_print); if (lookahead == 't') ADVANCE(59);
END_STATE(); END_STATE();
case 52: case 52:
if (lookahead == 't') ADVANCE(59); if (lookahead == 't') ADVANCE(60);
END_STATE(); END_STATE();
case 53: case 53:
ACCEPT_TOKEN(anon_sym_table); ACCEPT_TOKEN(anon_sym_table);
@ -1380,18 +1380,21 @@ static bool ts_lex_keywords(TSLexer *lexer, TSStateId state) {
ACCEPT_TOKEN(anon_sym_write); ACCEPT_TOKEN(anon_sym_write);
END_STATE(); END_STATE();
case 57: case 57:
if (lookahead == 'o') ADVANCE(60); if (lookahead == 'o') ADVANCE(61);
END_STATE(); END_STATE();
case 58: case 58:
ACCEPT_TOKEN(anon_sym_insert); ACCEPT_TOKEN(anon_sym_insert);
END_STATE(); END_STATE();
case 59: case 59:
ACCEPT_TOKEN(anon_sym_select); ACCEPT_TOKEN(anon_sym_output);
END_STATE(); END_STATE();
case 60: case 60:
if (lookahead == 'n') ADVANCE(61); ACCEPT_TOKEN(anon_sym_select);
END_STATE(); END_STATE();
case 61: case 61:
if (lookahead == 'n') ADVANCE(62);
END_STATE();
case 62:
ACCEPT_TOKEN(anon_sym_function); ACCEPT_TOKEN(anon_sym_function);
END_STATE(); END_STATE();
default: default:
@ -1653,7 +1656,7 @@ static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = {
[anon_sym_while] = ACTIONS(1), [anon_sym_while] = ACTIONS(1),
[anon_sym_for] = ACTIONS(1), [anon_sym_for] = ACTIONS(1),
[anon_sym_in] = ACTIONS(1), [anon_sym_in] = ACTIONS(1),
[anon_sym_print] = ACTIONS(1), [anon_sym_output] = ACTIONS(1),
[anon_sym_read] = ACTIONS(1), [anon_sym_read] = ACTIONS(1),
[anon_sym_write] = ACTIONS(1), [anon_sym_write] = ACTIONS(1),
[anon_sym_select] = ACTIONS(1), [anon_sym_select] = ACTIONS(1),
@ -6156,7 +6159,7 @@ static const uint16_t ts_small_parse_table[] = {
STATE(58), 1, STATE(58), 1,
sym_tool, sym_tool,
ACTIONS(450), 3, ACTIONS(450), 3,
anon_sym_print, anon_sym_output,
anon_sym_read, anon_sym_read,
anon_sym_write, anon_sym_write,
[5575] = 3, [5575] = 3,
@ -6165,7 +6168,7 @@ static const uint16_t ts_small_parse_table[] = {
STATE(65), 1, STATE(65), 1,
sym_tool, sym_tool,
ACTIONS(450), 3, ACTIONS(450), 3,
anon_sym_print, anon_sym_output,
anon_sym_read, anon_sym_read,
anon_sym_write, anon_sym_write,
[5587] = 3, [5587] = 3,
@ -6174,7 +6177,7 @@ static const uint16_t ts_small_parse_table[] = {
STATE(52), 1, STATE(52), 1,
sym_tool, sym_tool,
ACTIONS(450), 3, ACTIONS(450), 3,
anon_sym_print, anon_sym_output,
anon_sym_read, anon_sym_read,
anon_sym_write, anon_sym_write,
[5599] = 3, [5599] = 3,