commit ace8bb673d034d776a5dd08915a5747c90523a47 Author: Maxwell Jeffress Date: Sun Mar 15 14:40:13 2026 +1100 stuff i guess diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..65330c4 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,46 @@ +root = true + +[*] +charset = utf-8 + +[*.{json,toml,yml,gyp}] +indent_style = space +indent_size = 2 + +[*.js] +indent_style = space +indent_size = 2 + +[*.scm] +indent_style = space +indent_size = 2 + +[*.{c,cc,h}] +indent_style = space +indent_size = 4 + +[*.rs] +indent_style = space +indent_size = 4 + +[*.{py,pyi}] +indent_style = space +indent_size = 4 + +[*.swift] +indent_style = space +indent_size = 4 + +[*.go] +indent_style = tab +indent_size = 8 + +[Makefile] +indent_style = tab +indent_size = 8 + +[parser.c] +indent_size = 2 + +[{alloc,array,parser}.h] +indent_size = 2 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..7772c94 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,42 @@ +* text=auto eol=lf + +# Generated source files +src/*.json linguist-generated +src/parser.c linguist-generated +src/tree_sitter/* linguist-generated + +# C bindings +bindings/c/** linguist-generated +CMakeLists.txt linguist-generated +Makefile linguist-generated + +# Rust bindings +bindings/rust/* linguist-generated +Cargo.toml linguist-generated +Cargo.lock linguist-generated + +# Node.js bindings +bindings/node/* linguist-generated +binding.gyp linguist-generated +package.json linguist-generated +package-lock.json linguist-generated + +# Python bindings +bindings/python/** linguist-generated +setup.py linguist-generated +pyproject.toml linguist-generated + +# Go bindings +bindings/go/* linguist-generated +go.mod linguist-generated +go.sum linguist-generated + +# Swift bindings +bindings/swift/** linguist-generated +Package.swift linguist-generated +Package.resolved linguist-generated + +# Zig bindings +bindings/zig/* linguist-generated +build.zig linguist-generated +build.zig.zon linguist-generated diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..87a0c80 --- /dev/null +++ b/.gitignore @@ -0,0 +1,50 @@ +# Rust artifacts +target/ +Cargo.lock + +# Node artifacts +build/ +prebuilds/ +node_modules/ +package-lock.json + +# Swift artifacts +.build/ +Package.resolved + +# Go artifacts +_obj/ + +# Python artifacts +.venv/ +dist/ +*.egg-info +*.whl + +# C artifacts +*.a +*.so +*.so.* +*.dylib +*.dll +*.pc +*.exp +*.lib + +# Zig artifacts +.zig-cache/ +zig-cache/ +zig-out/ + +# Example dirs +/examples/*/ + +# Grammar volatiles +*.wasm +*.obj +*.o + +# Archives +*.tar.gz +*.tgz +*.zip diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..d236e55 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,66 @@ +cmake_minimum_required(VERSION 3.13) + +project(tree-sitter-ground + VERSION "1.0.0" + DESCRIPTION "Ground VM textual representation highlighter" + HOMEPAGE_URL "https://chookspace.com/ground/grammar" + LANGUAGES C) + +option(BUILD_SHARED_LIBS "Build using shared libraries" ON) +option(TREE_SITTER_REUSE_ALLOCATOR "Reuse the library allocator" OFF) + +set(TREE_SITTER_ABI_VERSION 15 CACHE STRING "Tree-sitter ABI version") +if(NOT ${TREE_SITTER_ABI_VERSION} MATCHES "^[0-9]+$") + unset(TREE_SITTER_ABI_VERSION CACHE) + message(FATAL_ERROR "TREE_SITTER_ABI_VERSION must be an integer") +endif() + +include(GNUInstallDirs) + +find_program(TREE_SITTER_CLI tree-sitter DOC "Tree-sitter CLI") + +add_custom_command(OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/src/parser.c" + DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/src/grammar.json" + COMMAND "${TREE_SITTER_CLI}" generate src/grammar.json + --abi=${TREE_SITTER_ABI_VERSION} + WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" + COMMENT "Generating parser.c") + +add_library(tree-sitter-ground src/parser.c) +if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/src/scanner.c) + target_sources(tree-sitter-ground PRIVATE src/scanner.c) +endif() +target_include_directories(tree-sitter-ground + PRIVATE src + INTERFACE $ + $) + +target_compile_definitions(tree-sitter-ground PRIVATE + $<$:TREE_SITTER_REUSE_ALLOCATOR> + $<$:TREE_SITTER_DEBUG>) + +set_target_properties(tree-sitter-ground + PROPERTIES + C_STANDARD 11 + POSITION_INDEPENDENT_CODE ON + SOVERSION "${TREE_SITTER_ABI_VERSION}.${PROJECT_VERSION_MAJOR}" + DEFINE_SYMBOL "") + +configure_file(bindings/c/tree-sitter-ground.pc.in + "${CMAKE_CURRENT_BINARY_DIR}/tree-sitter-ground.pc" @ONLY) + +install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/bindings/c/tree_sitter" + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" + FILES_MATCHING PATTERN "*.h") +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/tree-sitter-ground.pc" + DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") +install(TARGETS tree-sitter-ground + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}") + +file(GLOB QUERIES queries/*.scm) +install(FILES ${QUERIES} + DESTINATION "${CMAKE_INSTALL_DATADIR}/tree-sitter/queries/ground") + +add_custom_target(ts-test "${TREE_SITTER_CLI}" test + WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" + COMMENT "tree-sitter test") diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..1d71b71 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,34 @@ +[package] +name = "tree-sitter-ground" +description = "Ground VM textual representation highlighter" +version = "1.0.0" +authors = ["Maxwell Jeffress "] +license = "MIT" +readme = "README.md" +keywords = ["incremental", "parsing", "tree-sitter", "ground"] +categories = ["parser-implementations", "parsing", "text-editors"] +repository = "https://chookspace.com/ground/grammar" +edition = "2021" +autoexamples = false + +build = "bindings/rust/build.rs" +include = [ + "bindings/rust/*", + "grammar.js", + "queries/*", + "src/*", + "tree-sitter.json", + "/LICENSE", +] + +[lib] +path = "bindings/rust/lib.rs" + +[dependencies] +tree-sitter-language = "0.1" + +[build-dependencies] +cc = "1.2" + +[dev-dependencies] +tree-sitter = "0.25.10" diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..4c94c5f --- /dev/null +++ b/Makefile @@ -0,0 +1,99 @@ +ifeq ($(OS),Windows_NT) +$(error Windows is not supported) +endif + +LANGUAGE_NAME := tree-sitter-ground +HOMEPAGE_URL := https://chookspace.com/ground/grammar +VERSION := 1.0.0 + +# repository +SRC_DIR := src + +TS ?= tree-sitter + +# install directory layout +PREFIX ?= /usr/local +DATADIR ?= $(PREFIX)/share +INCLUDEDIR ?= $(PREFIX)/include +LIBDIR ?= $(PREFIX)/lib +PCLIBDIR ?= $(LIBDIR)/pkgconfig + +# source/object files +PARSER := $(SRC_DIR)/parser.c +EXTRAS := $(filter-out $(PARSER),$(wildcard $(SRC_DIR)/*.c)) +OBJS := $(patsubst %.c,%.o,$(PARSER) $(EXTRAS)) + +# flags +ARFLAGS ?= rcs +override CFLAGS += -I$(SRC_DIR) -std=c11 -fPIC + +# ABI versioning +SONAME_MAJOR = $(shell sed -n 's/\#define LANGUAGE_VERSION //p' $(PARSER)) +SONAME_MINOR = $(word 1,$(subst ., ,$(VERSION))) + +# OS-specific bits +ifeq ($(shell uname),Darwin) + SOEXT = dylib + SOEXTVER_MAJOR = $(SONAME_MAJOR).$(SOEXT) + SOEXTVER = $(SONAME_MAJOR).$(SONAME_MINOR).$(SOEXT) + LINKSHARED = -dynamiclib -Wl,-install_name,$(LIBDIR)/lib$(LANGUAGE_NAME).$(SOEXTVER),-rpath,@executable_path/../Frameworks +else + SOEXT = so + SOEXTVER_MAJOR = $(SOEXT).$(SONAME_MAJOR) + SOEXTVER = $(SOEXT).$(SONAME_MAJOR).$(SONAME_MINOR) + LINKSHARED = -shared -Wl,-soname,lib$(LANGUAGE_NAME).$(SOEXTVER) +endif +ifneq ($(filter $(shell uname),FreeBSD NetBSD DragonFly),) + PCLIBDIR := $(PREFIX)/libdata/pkgconfig +endif + +all: lib$(LANGUAGE_NAME).a lib$(LANGUAGE_NAME).$(SOEXT) $(LANGUAGE_NAME).pc + +lib$(LANGUAGE_NAME).a: $(OBJS) + $(AR) $(ARFLAGS) $@ $^ + +lib$(LANGUAGE_NAME).$(SOEXT): $(OBJS) + $(CC) $(LDFLAGS) $(LINKSHARED) $^ $(LDLIBS) -o $@ +ifneq ($(STRIP),) + $(STRIP) $@ +endif + +$(LANGUAGE_NAME).pc: bindings/c/$(LANGUAGE_NAME).pc.in + sed -e 's|@PROJECT_VERSION@|$(VERSION)|' \ + -e 's|@CMAKE_INSTALL_LIBDIR@|$(LIBDIR:$(PREFIX)/%=%)|' \ + -e 's|@CMAKE_INSTALL_INCLUDEDIR@|$(INCLUDEDIR:$(PREFIX)/%=%)|' \ + -e 's|@PROJECT_DESCRIPTION@|$(DESCRIPTION)|' \ + -e 's|@PROJECT_HOMEPAGE_URL@|$(HOMEPAGE_URL)|' \ + -e 's|@CMAKE_INSTALL_PREFIX@|$(PREFIX)|' $< > $@ + +$(PARSER): $(SRC_DIR)/grammar.json + $(TS) generate $^ + +install: all + install -d '$(DESTDIR)$(DATADIR)'/tree-sitter/queries/ground '$(DESTDIR)$(INCLUDEDIR)'/tree_sitter '$(DESTDIR)$(PCLIBDIR)' '$(DESTDIR)$(LIBDIR)' + install -m644 bindings/c/tree_sitter/$(LANGUAGE_NAME).h '$(DESTDIR)$(INCLUDEDIR)'/tree_sitter/$(LANGUAGE_NAME).h + install -m644 $(LANGUAGE_NAME).pc '$(DESTDIR)$(PCLIBDIR)'/$(LANGUAGE_NAME).pc + install -m644 lib$(LANGUAGE_NAME).a '$(DESTDIR)$(LIBDIR)'/lib$(LANGUAGE_NAME).a + install -m755 lib$(LANGUAGE_NAME).$(SOEXT) '$(DESTDIR)$(LIBDIR)'/lib$(LANGUAGE_NAME).$(SOEXTVER) + ln -sf lib$(LANGUAGE_NAME).$(SOEXTVER) '$(DESTDIR)$(LIBDIR)'/lib$(LANGUAGE_NAME).$(SOEXTVER_MAJOR) + ln -sf lib$(LANGUAGE_NAME).$(SOEXTVER_MAJOR) '$(DESTDIR)$(LIBDIR)'/lib$(LANGUAGE_NAME).$(SOEXT) +ifneq ($(wildcard queries/*.scm),) + install -m644 queries/*.scm '$(DESTDIR)$(DATADIR)'/tree-sitter/queries/ground +endif + +uninstall: + $(RM) '$(DESTDIR)$(LIBDIR)'/lib$(LANGUAGE_NAME).a \ + '$(DESTDIR)$(LIBDIR)'/lib$(LANGUAGE_NAME).$(SOEXTVER) \ + '$(DESTDIR)$(LIBDIR)'/lib$(LANGUAGE_NAME).$(SOEXTVER_MAJOR) \ + '$(DESTDIR)$(LIBDIR)'/lib$(LANGUAGE_NAME).$(SOEXT) \ + '$(DESTDIR)$(INCLUDEDIR)'/tree_sitter/$(LANGUAGE_NAME).h \ + '$(DESTDIR)$(PCLIBDIR)'/$(LANGUAGE_NAME).pc + $(RM) -r '$(DESTDIR)$(DATADIR)'/tree-sitter/queries/ground + +clean: + $(RM) $(OBJS) $(LANGUAGE_NAME).pc lib$(LANGUAGE_NAME).a lib$(LANGUAGE_NAME).$(SOEXT) + +test: + $(TS) test + +.PHONY: all install uninstall clean test diff --git a/Package.swift b/Package.swift new file mode 100644 index 0000000..bb844df --- /dev/null +++ b/Package.swift @@ -0,0 +1,41 @@ +// swift-tools-version:5.3 + +import Foundation +import PackageDescription + +var sources = ["src/parser.c"] +if FileManager.default.fileExists(atPath: "src/scanner.c") { + sources.append("src/scanner.c") +} + +let package = Package( + name: "TreeSitterGround", + products: [ + .library(name: "TreeSitterGround", targets: ["TreeSitterGround"]), + ], + dependencies: [ + .package(name: "SwiftTreeSitter", url: "https://github.com/tree-sitter/swift-tree-sitter", from: "0.9.0"), + ], + targets: [ + .target( + name: "TreeSitterGround", + dependencies: [], + path: ".", + sources: sources, + resources: [ + .copy("queries") + ], + publicHeadersPath: "bindings/swift", + cSettings: [.headerSearchPath("src")] + ), + .testTarget( + name: "TreeSitterGroundTests", + dependencies: [ + "SwiftTreeSitter", + "TreeSitterGround", + ], + path: "bindings/swift/TreeSitterGroundTests" + ) + ], + cLanguageStandard: .c11 +) diff --git a/binding.gyp b/binding.gyp new file mode 100644 index 0000000..17b32d5 --- /dev/null +++ b/binding.gyp @@ -0,0 +1,35 @@ +{ + "targets": [ + { + "target_name": "tree_sitter_ground_binding", + "dependencies": [ + " + +typedef struct TSLanguage TSLanguage; + +extern "C" TSLanguage *tree_sitter_ground(); + +// "tree-sitter", "language" hashed with BLAKE2 +const napi_type_tag LANGUAGE_TYPE_TAG = { + 0x8AF2E5212AD58ABF, 0xD5006CAD83ABBA16 +}; + +Napi::Object Init(Napi::Env env, Napi::Object exports) { + auto language = Napi::External::New(env, tree_sitter_ground()); + language.TypeTag(&LANGUAGE_TYPE_TAG); + exports["language"] = language; + return exports; +} + +NODE_API_MODULE(tree_sitter_ground_binding, Init) diff --git a/bindings/node/binding_test.js b/bindings/node/binding_test.js new file mode 100644 index 0000000..55becac --- /dev/null +++ b/bindings/node/binding_test.js @@ -0,0 +1,9 @@ +const assert = require("node:assert"); +const { test } = require("node:test"); + +const Parser = require("tree-sitter"); + +test("can load grammar", () => { + const parser = new Parser(); + assert.doesNotThrow(() => parser.setLanguage(require("."))); +}); diff --git a/bindings/node/index.d.ts b/bindings/node/index.d.ts new file mode 100644 index 0000000..528e060 --- /dev/null +++ b/bindings/node/index.d.ts @@ -0,0 +1,27 @@ +type BaseNode = { + type: string; + named: boolean; +}; + +type ChildNode = { + multiple: boolean; + required: boolean; + types: BaseNode[]; +}; + +type NodeInfo = + | (BaseNode & { + subtypes: BaseNode[]; + }) + | (BaseNode & { + fields: { [name: string]: ChildNode }; + children: ChildNode[]; + }); + +type Language = { + language: unknown; + nodeTypeInfo: NodeInfo[]; +}; + +declare const language: Language; +export = language; diff --git a/bindings/node/index.js b/bindings/node/index.js new file mode 100644 index 0000000..bc3c8ce --- /dev/null +++ b/bindings/node/index.js @@ -0,0 +1,11 @@ +const root = require("path").join(__dirname, "..", ".."); + +module.exports = + typeof process.versions.bun === "string" + // Support `bun build --compile` by being statically analyzable enough to find the .node file at build-time + ? require(`../../prebuilds/${process.platform}-${process.arch}/tree-sitter-ground.node`) + : require("node-gyp-build")(root); + +try { + module.exports.nodeTypeInfo = require("../../src/node-types.json"); +} catch (_) {} diff --git a/bindings/python/tests/test_binding.py b/bindings/python/tests/test_binding.py new file mode 100644 index 0000000..ebf0069 --- /dev/null +++ b/bindings/python/tests/test_binding.py @@ -0,0 +1,12 @@ +from unittest import TestCase + +from tree_sitter import Language, Parser +import tree_sitter_ground + + +class TestLanguage(TestCase): + def test_can_load_grammar(self): + try: + Parser(Language(tree_sitter_ground.language())) + except Exception: + self.fail("Error loading Ground grammar") diff --git a/bindings/python/tree_sitter_ground/__init__.py b/bindings/python/tree_sitter_ground/__init__.py new file mode 100644 index 0000000..8744224 --- /dev/null +++ b/bindings/python/tree_sitter_ground/__init__.py @@ -0,0 +1,42 @@ +"""Ground VM textual representation highlighter""" + +from importlib.resources import files as _files + +from ._binding import language + + +def _get_query(name, file): + query = _files(f"{__package__}.queries") / file + globals()[name] = query.read_text() + return globals()[name] + + +def __getattr__(name): + # NOTE: uncomment these to include any queries that this grammar contains: + + # if name == "HIGHLIGHTS_QUERY": + # return _get_query("HIGHLIGHTS_QUERY", "highlights.scm") + # if name == "INJECTIONS_QUERY": + # return _get_query("INJECTIONS_QUERY", "injections.scm") + # if name == "LOCALS_QUERY": + # return _get_query("LOCALS_QUERY", "locals.scm") + # if name == "TAGS_QUERY": + # return _get_query("TAGS_QUERY", "tags.scm") + + raise AttributeError(f"module {__name__!r} has no attribute {name!r}") + + +__all__ = [ + "language", + # "HIGHLIGHTS_QUERY", + # "INJECTIONS_QUERY", + # "LOCALS_QUERY", + # "TAGS_QUERY", +] + + +def __dir__(): + return sorted(__all__ + [ + "__all__", "__builtins__", "__cached__", "__doc__", "__file__", + "__loader__", "__name__", "__package__", "__path__", "__spec__", + ]) diff --git a/bindings/python/tree_sitter_ground/__init__.pyi b/bindings/python/tree_sitter_ground/__init__.pyi new file mode 100644 index 0000000..abf6633 --- /dev/null +++ b/bindings/python/tree_sitter_ground/__init__.pyi @@ -0,0 +1,10 @@ +from typing import Final + +# NOTE: uncomment these to include any queries that this grammar contains: + +# HIGHLIGHTS_QUERY: Final[str] +# INJECTIONS_QUERY: Final[str] +# LOCALS_QUERY: Final[str] +# TAGS_QUERY: Final[str] + +def language() -> object: ... diff --git a/bindings/python/tree_sitter_ground/binding.c b/bindings/python/tree_sitter_ground/binding.c new file mode 100644 index 0000000..e9f294a --- /dev/null +++ b/bindings/python/tree_sitter_ground/binding.c @@ -0,0 +1,35 @@ +#include + +typedef struct TSLanguage TSLanguage; + +TSLanguage *tree_sitter_ground(void); + +static PyObject* _binding_language(PyObject *Py_UNUSED(self), PyObject *Py_UNUSED(args)) { + return PyCapsule_New(tree_sitter_ground(), "tree_sitter.Language", NULL); +} + +static struct PyModuleDef_Slot slots[] = { +#ifdef Py_GIL_DISABLED + {Py_mod_gil, Py_MOD_GIL_NOT_USED}, +#endif + {0, NULL} +}; + +static PyMethodDef methods[] = { + {"language", _binding_language, METH_NOARGS, + "Get the tree-sitter language for this grammar."}, + {NULL, NULL, 0, NULL} +}; + +static struct PyModuleDef module = { + .m_base = PyModuleDef_HEAD_INIT, + .m_name = "_binding", + .m_doc = NULL, + .m_size = 0, + .m_methods = methods, + .m_slots = slots, +}; + +PyMODINIT_FUNC PyInit__binding(void) { + return PyModuleDef_Init(&module); +} diff --git a/bindings/python/tree_sitter_ground/py.typed b/bindings/python/tree_sitter_ground/py.typed new file mode 100644 index 0000000..e69de29 diff --git a/bindings/rust/build.rs b/bindings/rust/build.rs new file mode 100644 index 0000000..e64c705 --- /dev/null +++ b/bindings/rust/build.rs @@ -0,0 +1,21 @@ +fn main() { + let src_dir = std::path::Path::new("src"); + + let mut c_config = cc::Build::new(); + c_config.std("c11").include(src_dir); + + #[cfg(target_env = "msvc")] + c_config.flag("-utf-8"); + + let parser_path = src_dir.join("parser.c"); + c_config.file(&parser_path); + println!("cargo:rerun-if-changed={}", parser_path.to_str().unwrap()); + + let scanner_path = src_dir.join("scanner.c"); + if scanner_path.exists() { + c_config.file(&scanner_path); + println!("cargo:rerun-if-changed={}", scanner_path.to_str().unwrap()); + } + + c_config.compile("tree-sitter-ground"); +} diff --git a/bindings/rust/lib.rs b/bindings/rust/lib.rs new file mode 100644 index 0000000..6c44e92 --- /dev/null +++ b/bindings/rust/lib.rs @@ -0,0 +1,51 @@ +//! This crate provides Ground language support for the [tree-sitter] parsing library. +//! +//! Typically, you will use the [`LANGUAGE`] constant to add this language to a +//! tree-sitter [`Parser`], and then use the parser to parse some code: +//! +//! ``` +//! let code = r#" +//! "#; +//! let mut parser = tree_sitter::Parser::new(); +//! let language = tree_sitter_ground::LANGUAGE; +//! parser +//! .set_language(&language.into()) +//! .expect("Error loading Ground parser"); +//! let tree = parser.parse(code, None).unwrap(); +//! assert!(!tree.root_node().has_error()); +//! ``` +//! +//! [`Parser`]: https://docs.rs/tree-sitter/0.25.10/tree_sitter/struct.Parser.html +//! [tree-sitter]: https://tree-sitter.github.io/ + +use tree_sitter_language::LanguageFn; + +extern "C" { + fn tree_sitter_ground() -> *const (); +} + +/// The tree-sitter [`LanguageFn`] for this grammar. +pub const LANGUAGE: LanguageFn = unsafe { LanguageFn::from_raw(tree_sitter_ground) }; + +/// The content of the [`node-types.json`] file for this grammar. +/// +/// [`node-types.json`]: https://tree-sitter.github.io/tree-sitter/using-parsers/6-static-node-types +pub const NODE_TYPES: &str = include_str!("../../src/node-types.json"); + +// NOTE: uncomment these to include any queries that this grammar contains: + +// pub const HIGHLIGHTS_QUERY: &str = include_str!("../../queries/highlights.scm"); +// pub const INJECTIONS_QUERY: &str = include_str!("../../queries/injections.scm"); +// pub const LOCALS_QUERY: &str = include_str!("../../queries/locals.scm"); +// pub const TAGS_QUERY: &str = include_str!("../../queries/tags.scm"); + +#[cfg(test)] +mod tests { + #[test] + fn test_can_load_grammar() { + let mut parser = tree_sitter::Parser::new(); + parser + .set_language(&super::LANGUAGE.into()) + .expect("Error loading Ground parser"); + } +} diff --git a/bindings/swift/TreeSitterGround/ground.h b/bindings/swift/TreeSitterGround/ground.h new file mode 100644 index 0000000..f6fe091 --- /dev/null +++ b/bindings/swift/TreeSitterGround/ground.h @@ -0,0 +1,16 @@ +#ifndef TREE_SITTER_GROUND_H_ +#define TREE_SITTER_GROUND_H_ + +typedef struct TSLanguage TSLanguage; + +#ifdef __cplusplus +extern "C" { +#endif + +const TSLanguage *tree_sitter_ground(void); + +#ifdef __cplusplus +} +#endif + +#endif // TREE_SITTER_GROUND_H_ diff --git a/bindings/swift/TreeSitterGroundTests/TreeSitterGroundTests.swift b/bindings/swift/TreeSitterGroundTests/TreeSitterGroundTests.swift new file mode 100644 index 0000000..bca3ed2 --- /dev/null +++ b/bindings/swift/TreeSitterGroundTests/TreeSitterGroundTests.swift @@ -0,0 +1,12 @@ +import XCTest +import SwiftTreeSitter +import TreeSitterGround + +final class TreeSitterGroundTests: XCTestCase { + func testCanLoadGrammar() throws { + let parser = Parser() + let language = Language(language: tree_sitter_ground()) + XCTAssertNoThrow(try parser.setLanguage(language), + "Error loading Ground grammar") + } +} diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..5279d8f --- /dev/null +++ b/go.mod @@ -0,0 +1,5 @@ +module chookspace.com/ground/grammar + +go 1.22 + +require github.com/tree-sitter/go-tree-sitter v0.24.0 diff --git a/grammar.js b/grammar.js new file mode 100644 index 0000000..29f08a1 --- /dev/null +++ b/grammar.js @@ -0,0 +1,89 @@ +/** + * @file Ground VM textual representation highlighter + * @author Maxwell Jeffress + * @license MIT + */ + +/// +// @ts-check + +module.exports = grammar({ + name: "ground", + + extras: $ => [ + /\s/, + $.comment, + ], + + rules: { + source_file: $ => repeat($._statement), + + _statement: $ => choice( + $.label_definition, + $.function_definition, + $.struct_definition, + $.instruction, + ), + + comment: $ => token(seq('#', /.*/)), + + label_definition: $ => seq('@', $.identifier), + + function_definition: $ => seq( + 'fun', + field('name', $.function_reference), + field('return_type', $.type_reference), + repeat(seq(field('arg_type', $.type_reference), field('arg_name', $.direct_reference))), + repeat($._statement), + 'endfun' + ), + + struct_definition: $ => seq( + 'struct', + field('name', $.type_reference), + repeat($._statement), + 'endstruct' + ), + + instruction: $ => seq( + field('keyword', $.keyword), + repeat($._argument) + ), + + keyword: $ => choice( + 'if', 'jump', 'end', 'input', 'print', 'println', + 'set', 'init', 'gettype', 'exists', 'setlist', 'setlistat', + 'getlistat', 'getlistsize', 'listappend', 'getstrsize', 'getstrcharat', + 'add', 'subtract', 'multiply', 'divide', 'equal', 'inequal', 'not', + 'greater', 'lesser', 'stoi', 'stod', 'tostring', 'return', 'call', + 'use', 'extern', 'getfield', 'setfield' + ), + + _argument: $ => choice( + $.value_reference, + $.direct_reference, + $.line_reference, + $.function_reference, + $.type_reference, + $.string, + $.int, + $.double, + $.char, + $.bool + ), + + value_reference: $ => seq('$', $.identifier), + direct_reference: $ => seq('&', $.identifier), + line_reference: $ => seq('%', $.identifier), + function_reference: $ => seq('!', $.identifier), + type_reference: $ => seq('-', $.identifier), + + identifier: $ => /[a-zA-Z_][a-zA-Z0-9_]*/, + + string: $ => /"[^"]*"/, + int: $ => /-?\d+/, + double: $ => /-?\d+\.\d+/, + char: $ => /'[^']'/, + bool: $ => choice('true', 'false'), + } +}); diff --git a/package.json b/package.json new file mode 100644 index 0000000..86db10d --- /dev/null +++ b/package.json @@ -0,0 +1,53 @@ +{ + "name": "tree-sitter-ground", + "version": "1.0.0", + "description": "Ground VM textual representation highlighter", + "repository": "https://chookspace.com/ground/grammar", + "license": "MIT", + "author": { + "name": "Maxwell Jeffress", + "email": "maxwelljeffress@proton.me", + "url": "https://maxwellj.xyz/" + }, + "main": "bindings/node", + "types": "bindings/node", + "keywords": [ + "incremental", + "parsing", + "tree-sitter", + "ground" + ], + "files": [ + "grammar.js", + "tree-sitter.json", + "binding.gyp", + "prebuilds/**", + "bindings/node/*", + "queries/*", + "src/**", + "*.wasm" + ], + "dependencies": { + "node-addon-api": "^8.5.0", + "node-gyp-build": "^4.8.4" + }, + "devDependencies": { + "prebuildify": "^6.0.1", + "tree-sitter": "^0.22.4", + "tree-sitter-cli": "^0.25.10" + }, + "peerDependencies": { + "tree-sitter": "^0.22.4" + }, + "peerDependenciesMeta": { + "tree-sitter": { + "optional": true + } + }, + "scripts": { + "install": "node-gyp-build", + "prestart": "tree-sitter build --wasm", + "start": "tree-sitter playground", + "test": "node --test bindings/node/*_test.js" + } +} diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..a24e5ee --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,29 @@ +[build-system] +requires = ["setuptools>=62.4.0", "wheel"] +build-backend = "setuptools.build_meta" + +[project] +name = "tree-sitter-ground" +description = "Ground VM textual representation highlighter" +version = "1.0.0" +keywords = ["incremental", "parsing", "tree-sitter", "ground"] +classifiers = [ + "Intended Audience :: Developers", + "Topic :: Software Development :: Compilers", + "Topic :: Text Processing :: Linguistic", + "Typing :: Typed", +] +authors = [{ name = "Maxwell Jeffress", email = "maxwelljeffress@proton.me" }] +requires-python = ">=3.10" +license.text = "MIT" +readme = "README.md" + +[project.urls] +Homepage = "https://chookspace.com/ground/grammar" + +[project.optional-dependencies] +core = ["tree-sitter~=0.24"] + +[tool.cibuildwheel] +build = "cp310-*" +build-frontend = "build" diff --git a/queries/highlights.scm b/queries/highlights.scm new file mode 100644 index 0000000..e1ba1c7 --- /dev/null +++ b/queries/highlights.scm @@ -0,0 +1,20 @@ +(comment) @comment + +(keyword) @keyword +"fun" @keyword +"endfun" @keyword +"struct" @keyword +"endstruct" @keyword + +(label_definition "@" @punctuation.special (identifier) @label) +(line_reference "%" @punctuation.special (identifier) @label) +(value_reference "$" @punctuation.special (identifier) @variable) +(direct_reference "&" @punctuation.special (identifier) @variable.parameter) +(function_reference "!" @punctuation.special (identifier) @function) +(type_reference "-" @punctuation.special (identifier) @type) + +(string) @string +(int) @number +(double) @number +(char) @character +(bool) @boolean diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..6ae0ba1 --- /dev/null +++ b/setup.py @@ -0,0 +1,77 @@ +from os import path +from sysconfig import get_config_var + +from setuptools import Extension, find_packages, setup +from setuptools.command.build import build +from setuptools.command.build_ext import build_ext +from setuptools.command.egg_info import egg_info +from wheel.bdist_wheel import bdist_wheel + + +class Build(build): + def run(self): + if path.isdir("queries"): + dest = path.join(self.build_lib, "tree_sitter_ground", "queries") + self.copy_tree("queries", dest) + super().run() + + +class BuildExt(build_ext): + def build_extension(self, ext: Extension): + if self.compiler.compiler_type != "msvc": + ext.extra_compile_args = ["-std=c11", "-fvisibility=hidden"] + else: + ext.extra_compile_args = ["/std:c11", "/utf-8"] + if path.exists("src/scanner.c"): + ext.sources.append("src/scanner.c") + if ext.py_limited_api: + ext.define_macros.append(("Py_LIMITED_API", "0x030A0000")) + super().build_extension(ext) + + +class BdistWheel(bdist_wheel): + def get_tag(self): + python, abi, platform = super().get_tag() + if python.startswith("cp"): + python, abi = "cp310", "abi3" + return python, abi, platform + + +class EggInfo(egg_info): + def find_sources(self): + super().find_sources() + self.filelist.recursive_include("queries", "*.scm") + self.filelist.include("src/tree_sitter/*.h") + + +setup( + packages=find_packages("bindings/python"), + package_dir={"": "bindings/python"}, + package_data={ + "tree_sitter_ground": ["*.pyi", "py.typed"], + "tree_sitter_ground.queries": ["*.scm"], + }, + ext_package="tree_sitter_ground", + ext_modules=[ + Extension( + name="_binding", + sources=[ + "bindings/python/tree_sitter_ground/binding.c", + "src/parser.c", + ], + define_macros=[ + ("PY_SSIZE_T_CLEAN", None), + ("TREE_SITTER_HIDE_SYMBOLS", None), + ], + include_dirs=["src"], + py_limited_api=not get_config_var("Py_GIL_DISABLED"), + ) + ], + cmdclass={ + "build": Build, + "build_ext": BuildExt, + "bdist_wheel": BdistWheel, + "egg_info": EggInfo, + }, + zip_safe=False +) diff --git a/src/grammar.json b/src/grammar.json new file mode 100644 index 0000000..9f9362f --- /dev/null +++ b/src/grammar.json @@ -0,0 +1,475 @@ +{ + "$schema": "https://tree-sitter.github.io/tree-sitter/assets/schemas/grammar.schema.json", + "name": "ground", + "rules": { + "source_file": { + "type": "REPEAT", + "content": { + "type": "SYMBOL", + "name": "_statement" + } + }, + "_statement": { + "type": "CHOICE", + "members": [ + { + "type": "SYMBOL", + "name": "label_definition" + }, + { + "type": "SYMBOL", + "name": "function_definition" + }, + { + "type": "SYMBOL", + "name": "struct_definition" + }, + { + "type": "SYMBOL", + "name": "instruction" + } + ] + }, + "comment": { + "type": "TOKEN", + "content": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "#" + }, + { + "type": "PATTERN", + "value": ".*" + } + ] + } + }, + "label_definition": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "@" + }, + { + "type": "SYMBOL", + "name": "identifier" + } + ] + }, + "function_definition": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "fun" + }, + { + "type": "FIELD", + "name": "name", + "content": { + "type": "SYMBOL", + "name": "function_reference" + } + }, + { + "type": "FIELD", + "name": "return_type", + "content": { + "type": "SYMBOL", + "name": "type_reference" + } + }, + { + "type": "REPEAT", + "content": { + "type": "SEQ", + "members": [ + { + "type": "FIELD", + "name": "arg_type", + "content": { + "type": "SYMBOL", + "name": "type_reference" + } + }, + { + "type": "FIELD", + "name": "arg_name", + "content": { + "type": "SYMBOL", + "name": "direct_reference" + } + } + ] + } + }, + { + "type": "REPEAT", + "content": { + "type": "SYMBOL", + "name": "_statement" + } + }, + { + "type": "STRING", + "value": "endfun" + } + ] + }, + "struct_definition": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "struct" + }, + { + "type": "FIELD", + "name": "name", + "content": { + "type": "SYMBOL", + "name": "type_reference" + } + }, + { + "type": "REPEAT", + "content": { + "type": "SYMBOL", + "name": "_statement" + } + }, + { + "type": "STRING", + "value": "endstruct" + } + ] + }, + "instruction": { + "type": "SEQ", + "members": [ + { + "type": "FIELD", + "name": "keyword", + "content": { + "type": "SYMBOL", + "name": "keyword" + } + }, + { + "type": "REPEAT", + "content": { + "type": "SYMBOL", + "name": "_argument" + } + } + ] + }, + "keyword": { + "type": "CHOICE", + "members": [ + { + "type": "STRING", + "value": "if" + }, + { + "type": "STRING", + "value": "jump" + }, + { + "type": "STRING", + "value": "end" + }, + { + "type": "STRING", + "value": "input" + }, + { + "type": "STRING", + "value": "print" + }, + { + "type": "STRING", + "value": "println" + }, + { + "type": "STRING", + "value": "set" + }, + { + "type": "STRING", + "value": "init" + }, + { + "type": "STRING", + "value": "gettype" + }, + { + "type": "STRING", + "value": "exists" + }, + { + "type": "STRING", + "value": "setlist" + }, + { + "type": "STRING", + "value": "setlistat" + }, + { + "type": "STRING", + "value": "getlistat" + }, + { + "type": "STRING", + "value": "getlistsize" + }, + { + "type": "STRING", + "value": "listappend" + }, + { + "type": "STRING", + "value": "getstrsize" + }, + { + "type": "STRING", + "value": "getstrcharat" + }, + { + "type": "STRING", + "value": "add" + }, + { + "type": "STRING", + "value": "subtract" + }, + { + "type": "STRING", + "value": "multiply" + }, + { + "type": "STRING", + "value": "divide" + }, + { + "type": "STRING", + "value": "equal" + }, + { + "type": "STRING", + "value": "inequal" + }, + { + "type": "STRING", + "value": "not" + }, + { + "type": "STRING", + "value": "greater" + }, + { + "type": "STRING", + "value": "lesser" + }, + { + "type": "STRING", + "value": "stoi" + }, + { + "type": "STRING", + "value": "stod" + }, + { + "type": "STRING", + "value": "tostring" + }, + { + "type": "STRING", + "value": "return" + }, + { + "type": "STRING", + "value": "call" + }, + { + "type": "STRING", + "value": "use" + }, + { + "type": "STRING", + "value": "extern" + }, + { + "type": "STRING", + "value": "getfield" + }, + { + "type": "STRING", + "value": "setfield" + } + ] + }, + "_argument": { + "type": "CHOICE", + "members": [ + { + "type": "SYMBOL", + "name": "value_reference" + }, + { + "type": "SYMBOL", + "name": "direct_reference" + }, + { + "type": "SYMBOL", + "name": "line_reference" + }, + { + "type": "SYMBOL", + "name": "function_reference" + }, + { + "type": "SYMBOL", + "name": "type_reference" + }, + { + "type": "SYMBOL", + "name": "string" + }, + { + "type": "SYMBOL", + "name": "int" + }, + { + "type": "SYMBOL", + "name": "double" + }, + { + "type": "SYMBOL", + "name": "char" + }, + { + "type": "SYMBOL", + "name": "bool" + } + ] + }, + "value_reference": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "$" + }, + { + "type": "SYMBOL", + "name": "identifier" + } + ] + }, + "direct_reference": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "&" + }, + { + "type": "SYMBOL", + "name": "identifier" + } + ] + }, + "line_reference": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "%" + }, + { + "type": "SYMBOL", + "name": "identifier" + } + ] + }, + "function_reference": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "!" + }, + { + "type": "SYMBOL", + "name": "identifier" + } + ] + }, + "type_reference": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "-" + }, + { + "type": "SYMBOL", + "name": "identifier" + } + ] + }, + "identifier": { + "type": "PATTERN", + "value": "[a-zA-Z_][a-zA-Z0-9_]*" + }, + "string": { + "type": "PATTERN", + "value": "\"[^\"]*\"" + }, + "int": { + "type": "PATTERN", + "value": "-?\\d+" + }, + "double": { + "type": "PATTERN", + "value": "-?\\d+\\.\\d+" + }, + "char": { + "type": "PATTERN", + "value": "'[^']'" + }, + "bool": { + "type": "CHOICE", + "members": [ + { + "type": "STRING", + "value": "true" + }, + { + "type": "STRING", + "value": "false" + } + ] + } + }, + "extras": [ + { + "type": "PATTERN", + "value": "\\s" + }, + { + "type": "SYMBOL", + "name": "comment" + } + ], + "conflicts": [], + "precedences": [], + "externals": [], + "inline": [], + "supertypes": [], + "reserved": {} +} \ No newline at end of file diff --git a/src/node-types.json b/src/node-types.json new file mode 100644 index 0000000..e578f47 --- /dev/null +++ b/src/node-types.json @@ -0,0 +1,511 @@ +[ + { + "type": "bool", + "named": true, + "fields": {} + }, + { + "type": "direct_reference", + "named": true, + "fields": {}, + "children": { + "multiple": false, + "required": true, + "types": [ + { + "type": "identifier", + "named": true + } + ] + } + }, + { + "type": "function_definition", + "named": true, + "fields": { + "arg_name": { + "multiple": true, + "required": false, + "types": [ + { + "type": "direct_reference", + "named": true + } + ] + }, + "arg_type": { + "multiple": true, + "required": false, + "types": [ + { + "type": "type_reference", + "named": true + } + ] + }, + "name": { + "multiple": false, + "required": true, + "types": [ + { + "type": "function_reference", + "named": true + } + ] + }, + "return_type": { + "multiple": false, + "required": true, + "types": [ + { + "type": "type_reference", + "named": true + } + ] + } + }, + "children": { + "multiple": true, + "required": false, + "types": [ + { + "type": "function_definition", + "named": true + }, + { + "type": "instruction", + "named": true + }, + { + "type": "label_definition", + "named": true + }, + { + "type": "struct_definition", + "named": true + } + ] + } + }, + { + "type": "function_reference", + "named": true, + "fields": {}, + "children": { + "multiple": false, + "required": true, + "types": [ + { + "type": "identifier", + "named": true + } + ] + } + }, + { + "type": "instruction", + "named": true, + "fields": { + "keyword": { + "multiple": false, + "required": true, + "types": [ + { + "type": "keyword", + "named": true + } + ] + } + }, + "children": { + "multiple": true, + "required": false, + "types": [ + { + "type": "bool", + "named": true + }, + { + "type": "char", + "named": true + }, + { + "type": "direct_reference", + "named": true + }, + { + "type": "double", + "named": true + }, + { + "type": "function_reference", + "named": true + }, + { + "type": "int", + "named": true + }, + { + "type": "line_reference", + "named": true + }, + { + "type": "string", + "named": true + }, + { + "type": "type_reference", + "named": true + }, + { + "type": "value_reference", + "named": true + } + ] + } + }, + { + "type": "keyword", + "named": true, + "fields": {} + }, + { + "type": "label_definition", + "named": true, + "fields": {}, + "children": { + "multiple": false, + "required": true, + "types": [ + { + "type": "identifier", + "named": true + } + ] + } + }, + { + "type": "line_reference", + "named": true, + "fields": {}, + "children": { + "multiple": false, + "required": true, + "types": [ + { + "type": "identifier", + "named": true + } + ] + } + }, + { + "type": "source_file", + "named": true, + "root": true, + "fields": {}, + "children": { + "multiple": true, + "required": false, + "types": [ + { + "type": "function_definition", + "named": true + }, + { + "type": "instruction", + "named": true + }, + { + "type": "label_definition", + "named": true + }, + { + "type": "struct_definition", + "named": true + } + ] + } + }, + { + "type": "struct_definition", + "named": true, + "fields": { + "name": { + "multiple": false, + "required": true, + "types": [ + { + "type": "type_reference", + "named": true + } + ] + } + }, + "children": { + "multiple": true, + "required": false, + "types": [ + { + "type": "function_definition", + "named": true + }, + { + "type": "instruction", + "named": true + }, + { + "type": "label_definition", + "named": true + }, + { + "type": "struct_definition", + "named": true + } + ] + } + }, + { + "type": "type_reference", + "named": true, + "fields": {}, + "children": { + "multiple": false, + "required": true, + "types": [ + { + "type": "identifier", + "named": true + } + ] + } + }, + { + "type": "value_reference", + "named": true, + "fields": {}, + "children": { + "multiple": false, + "required": true, + "types": [ + { + "type": "identifier", + "named": true + } + ] + } + }, + { + "type": "!", + "named": false + }, + { + "type": "$", + "named": false + }, + { + "type": "%", + "named": false + }, + { + "type": "&", + "named": false + }, + { + "type": "-", + "named": false + }, + { + "type": "@", + "named": false + }, + { + "type": "add", + "named": false + }, + { + "type": "call", + "named": false + }, + { + "type": "char", + "named": true + }, + { + "type": "comment", + "named": true, + "extra": true + }, + { + "type": "divide", + "named": false + }, + { + "type": "double", + "named": true + }, + { + "type": "end", + "named": false + }, + { + "type": "endfun", + "named": false + }, + { + "type": "endstruct", + "named": false + }, + { + "type": "equal", + "named": false + }, + { + "type": "exists", + "named": false + }, + { + "type": "extern", + "named": false + }, + { + "type": "false", + "named": false + }, + { + "type": "fun", + "named": false + }, + { + "type": "getfield", + "named": false + }, + { + "type": "getlistat", + "named": false + }, + { + "type": "getlistsize", + "named": false + }, + { + "type": "getstrcharat", + "named": false + }, + { + "type": "getstrsize", + "named": false + }, + { + "type": "gettype", + "named": false + }, + { + "type": "greater", + "named": false + }, + { + "type": "identifier", + "named": true + }, + { + "type": "if", + "named": false + }, + { + "type": "inequal", + "named": false + }, + { + "type": "init", + "named": false + }, + { + "type": "input", + "named": false + }, + { + "type": "int", + "named": true + }, + { + "type": "jump", + "named": false + }, + { + "type": "lesser", + "named": false + }, + { + "type": "listappend", + "named": false + }, + { + "type": "multiply", + "named": false + }, + { + "type": "not", + "named": false + }, + { + "type": "print", + "named": false + }, + { + "type": "println", + "named": false + }, + { + "type": "return", + "named": false + }, + { + "type": "set", + "named": false + }, + { + "type": "setfield", + "named": false + }, + { + "type": "setlist", + "named": false + }, + { + "type": "setlistat", + "named": false + }, + { + "type": "stod", + "named": false + }, + { + "type": "stoi", + "named": false + }, + { + "type": "string", + "named": true + }, + { + "type": "struct", + "named": false + }, + { + "type": "subtract", + "named": false + }, + { + "type": "tostring", + "named": false + }, + { + "type": "true", + "named": false + }, + { + "type": "use", + "named": false + } +] \ No newline at end of file diff --git a/src/parser.c b/src/parser.c new file mode 100644 index 0000000..f104551 --- /dev/null +++ b/src/parser.c @@ -0,0 +1,5888 @@ +/* Automatically @generated by tree-sitter v0.25.10 */ + +#include "tree_sitter/parser.h" + +#if defined(__GNUC__) || defined(__clang__) +#pragma GCC diagnostic ignored "-Wmissing-field-initializers" +#endif + +#define LANGUAGE_VERSION 15 +#define STATE_COUNT 106 +#define LARGE_STATE_COUNT 77 +#define SYMBOL_COUNT 71 +#define ALIAS_COUNT 0 +#define TOKEN_COUNT 54 +#define EXTERNAL_TOKEN_COUNT 0 +#define FIELD_COUNT 5 +#define MAX_ALIAS_SEQUENCE_LENGTH 6 +#define MAX_RESERVED_WORD_SET_SIZE 0 +#define PRODUCTION_ID_COUNT 7 +#define SUPERTYPE_COUNT 0 + +enum ts_symbol_identifiers { + sym_comment = 1, + anon_sym_AT = 2, + anon_sym_fun = 3, + anon_sym_endfun = 4, + anon_sym_struct = 5, + anon_sym_endstruct = 6, + anon_sym_if = 7, + anon_sym_jump = 8, + anon_sym_end = 9, + anon_sym_input = 10, + anon_sym_print = 11, + anon_sym_println = 12, + anon_sym_set = 13, + anon_sym_init = 14, + anon_sym_gettype = 15, + anon_sym_exists = 16, + anon_sym_setlist = 17, + anon_sym_setlistat = 18, + anon_sym_getlistat = 19, + anon_sym_getlistsize = 20, + anon_sym_listappend = 21, + anon_sym_getstrsize = 22, + anon_sym_getstrcharat = 23, + anon_sym_add = 24, + anon_sym_subtract = 25, + anon_sym_multiply = 26, + anon_sym_divide = 27, + anon_sym_equal = 28, + anon_sym_inequal = 29, + anon_sym_not = 30, + anon_sym_greater = 31, + anon_sym_lesser = 32, + anon_sym_stoi = 33, + anon_sym_stod = 34, + anon_sym_tostring = 35, + anon_sym_return = 36, + anon_sym_call = 37, + anon_sym_use = 38, + anon_sym_extern = 39, + anon_sym_getfield = 40, + anon_sym_setfield = 41, + anon_sym_DOLLAR = 42, + anon_sym_AMP = 43, + anon_sym_PERCENT = 44, + anon_sym_BANG = 45, + anon_sym_DASH = 46, + sym_identifier = 47, + sym_string = 48, + sym_int = 49, + sym_double = 50, + sym_char = 51, + anon_sym_true = 52, + anon_sym_false = 53, + sym_source_file = 54, + sym__statement = 55, + sym_label_definition = 56, + sym_function_definition = 57, + sym_struct_definition = 58, + sym_instruction = 59, + sym_keyword = 60, + sym__argument = 61, + sym_value_reference = 62, + sym_direct_reference = 63, + sym_line_reference = 64, + sym_function_reference = 65, + sym_type_reference = 66, + sym_bool = 67, + aux_sym_source_file_repeat1 = 68, + aux_sym_function_definition_repeat1 = 69, + aux_sym_instruction_repeat1 = 70, +}; + +static const char * const ts_symbol_names[] = { + [ts_builtin_sym_end] = "end", + [sym_comment] = "comment", + [anon_sym_AT] = "@", + [anon_sym_fun] = "fun", + [anon_sym_endfun] = "endfun", + [anon_sym_struct] = "struct", + [anon_sym_endstruct] = "endstruct", + [anon_sym_if] = "if", + [anon_sym_jump] = "jump", + [anon_sym_end] = "end", + [anon_sym_input] = "input", + [anon_sym_print] = "print", + [anon_sym_println] = "println", + [anon_sym_set] = "set", + [anon_sym_init] = "init", + [anon_sym_gettype] = "gettype", + [anon_sym_exists] = "exists", + [anon_sym_setlist] = "setlist", + [anon_sym_setlistat] = "setlistat", + [anon_sym_getlistat] = "getlistat", + [anon_sym_getlistsize] = "getlistsize", + [anon_sym_listappend] = "listappend", + [anon_sym_getstrsize] = "getstrsize", + [anon_sym_getstrcharat] = "getstrcharat", + [anon_sym_add] = "add", + [anon_sym_subtract] = "subtract", + [anon_sym_multiply] = "multiply", + [anon_sym_divide] = "divide", + [anon_sym_equal] = "equal", + [anon_sym_inequal] = "inequal", + [anon_sym_not] = "not", + [anon_sym_greater] = "greater", + [anon_sym_lesser] = "lesser", + [anon_sym_stoi] = "stoi", + [anon_sym_stod] = "stod", + [anon_sym_tostring] = "tostring", + [anon_sym_return] = "return", + [anon_sym_call] = "call", + [anon_sym_use] = "use", + [anon_sym_extern] = "extern", + [anon_sym_getfield] = "getfield", + [anon_sym_setfield] = "setfield", + [anon_sym_DOLLAR] = "$", + [anon_sym_AMP] = "&", + [anon_sym_PERCENT] = "%", + [anon_sym_BANG] = "!", + [anon_sym_DASH] = "-", + [sym_identifier] = "identifier", + [sym_string] = "string", + [sym_int] = "int", + [sym_double] = "double", + [sym_char] = "char", + [anon_sym_true] = "true", + [anon_sym_false] = "false", + [sym_source_file] = "source_file", + [sym__statement] = "_statement", + [sym_label_definition] = "label_definition", + [sym_function_definition] = "function_definition", + [sym_struct_definition] = "struct_definition", + [sym_instruction] = "instruction", + [sym_keyword] = "keyword", + [sym__argument] = "_argument", + [sym_value_reference] = "value_reference", + [sym_direct_reference] = "direct_reference", + [sym_line_reference] = "line_reference", + [sym_function_reference] = "function_reference", + [sym_type_reference] = "type_reference", + [sym_bool] = "bool", + [aux_sym_source_file_repeat1] = "source_file_repeat1", + [aux_sym_function_definition_repeat1] = "function_definition_repeat1", + [aux_sym_instruction_repeat1] = "instruction_repeat1", +}; + +static const TSSymbol ts_symbol_map[] = { + [ts_builtin_sym_end] = ts_builtin_sym_end, + [sym_comment] = sym_comment, + [anon_sym_AT] = anon_sym_AT, + [anon_sym_fun] = anon_sym_fun, + [anon_sym_endfun] = anon_sym_endfun, + [anon_sym_struct] = anon_sym_struct, + [anon_sym_endstruct] = anon_sym_endstruct, + [anon_sym_if] = anon_sym_if, + [anon_sym_jump] = anon_sym_jump, + [anon_sym_end] = anon_sym_end, + [anon_sym_input] = anon_sym_input, + [anon_sym_print] = anon_sym_print, + [anon_sym_println] = anon_sym_println, + [anon_sym_set] = anon_sym_set, + [anon_sym_init] = anon_sym_init, + [anon_sym_gettype] = anon_sym_gettype, + [anon_sym_exists] = anon_sym_exists, + [anon_sym_setlist] = anon_sym_setlist, + [anon_sym_setlistat] = anon_sym_setlistat, + [anon_sym_getlistat] = anon_sym_getlistat, + [anon_sym_getlistsize] = anon_sym_getlistsize, + [anon_sym_listappend] = anon_sym_listappend, + [anon_sym_getstrsize] = anon_sym_getstrsize, + [anon_sym_getstrcharat] = anon_sym_getstrcharat, + [anon_sym_add] = anon_sym_add, + [anon_sym_subtract] = anon_sym_subtract, + [anon_sym_multiply] = anon_sym_multiply, + [anon_sym_divide] = anon_sym_divide, + [anon_sym_equal] = anon_sym_equal, + [anon_sym_inequal] = anon_sym_inequal, + [anon_sym_not] = anon_sym_not, + [anon_sym_greater] = anon_sym_greater, + [anon_sym_lesser] = anon_sym_lesser, + [anon_sym_stoi] = anon_sym_stoi, + [anon_sym_stod] = anon_sym_stod, + [anon_sym_tostring] = anon_sym_tostring, + [anon_sym_return] = anon_sym_return, + [anon_sym_call] = anon_sym_call, + [anon_sym_use] = anon_sym_use, + [anon_sym_extern] = anon_sym_extern, + [anon_sym_getfield] = anon_sym_getfield, + [anon_sym_setfield] = anon_sym_setfield, + [anon_sym_DOLLAR] = anon_sym_DOLLAR, + [anon_sym_AMP] = anon_sym_AMP, + [anon_sym_PERCENT] = anon_sym_PERCENT, + [anon_sym_BANG] = anon_sym_BANG, + [anon_sym_DASH] = anon_sym_DASH, + [sym_identifier] = sym_identifier, + [sym_string] = sym_string, + [sym_int] = sym_int, + [sym_double] = sym_double, + [sym_char] = sym_char, + [anon_sym_true] = anon_sym_true, + [anon_sym_false] = anon_sym_false, + [sym_source_file] = sym_source_file, + [sym__statement] = sym__statement, + [sym_label_definition] = sym_label_definition, + [sym_function_definition] = sym_function_definition, + [sym_struct_definition] = sym_struct_definition, + [sym_instruction] = sym_instruction, + [sym_keyword] = sym_keyword, + [sym__argument] = sym__argument, + [sym_value_reference] = sym_value_reference, + [sym_direct_reference] = sym_direct_reference, + [sym_line_reference] = sym_line_reference, + [sym_function_reference] = sym_function_reference, + [sym_type_reference] = sym_type_reference, + [sym_bool] = sym_bool, + [aux_sym_source_file_repeat1] = aux_sym_source_file_repeat1, + [aux_sym_function_definition_repeat1] = aux_sym_function_definition_repeat1, + [aux_sym_instruction_repeat1] = aux_sym_instruction_repeat1, +}; + +static const TSSymbolMetadata ts_symbol_metadata[] = { + [ts_builtin_sym_end] = { + .visible = false, + .named = true, + }, + [sym_comment] = { + .visible = true, + .named = true, + }, + [anon_sym_AT] = { + .visible = true, + .named = false, + }, + [anon_sym_fun] = { + .visible = true, + .named = false, + }, + [anon_sym_endfun] = { + .visible = true, + .named = false, + }, + [anon_sym_struct] = { + .visible = true, + .named = false, + }, + [anon_sym_endstruct] = { + .visible = true, + .named = false, + }, + [anon_sym_if] = { + .visible = true, + .named = false, + }, + [anon_sym_jump] = { + .visible = true, + .named = false, + }, + [anon_sym_end] = { + .visible = true, + .named = false, + }, + [anon_sym_input] = { + .visible = true, + .named = false, + }, + [anon_sym_print] = { + .visible = true, + .named = false, + }, + [anon_sym_println] = { + .visible = true, + .named = false, + }, + [anon_sym_set] = { + .visible = true, + .named = false, + }, + [anon_sym_init] = { + .visible = true, + .named = false, + }, + [anon_sym_gettype] = { + .visible = true, + .named = false, + }, + [anon_sym_exists] = { + .visible = true, + .named = false, + }, + [anon_sym_setlist] = { + .visible = true, + .named = false, + }, + [anon_sym_setlistat] = { + .visible = true, + .named = false, + }, + [anon_sym_getlistat] = { + .visible = true, + .named = false, + }, + [anon_sym_getlistsize] = { + .visible = true, + .named = false, + }, + [anon_sym_listappend] = { + .visible = true, + .named = false, + }, + [anon_sym_getstrsize] = { + .visible = true, + .named = false, + }, + [anon_sym_getstrcharat] = { + .visible = true, + .named = false, + }, + [anon_sym_add] = { + .visible = true, + .named = false, + }, + [anon_sym_subtract] = { + .visible = true, + .named = false, + }, + [anon_sym_multiply] = { + .visible = true, + .named = false, + }, + [anon_sym_divide] = { + .visible = true, + .named = false, + }, + [anon_sym_equal] = { + .visible = true, + .named = false, + }, + [anon_sym_inequal] = { + .visible = true, + .named = false, + }, + [anon_sym_not] = { + .visible = true, + .named = false, + }, + [anon_sym_greater] = { + .visible = true, + .named = false, + }, + [anon_sym_lesser] = { + .visible = true, + .named = false, + }, + [anon_sym_stoi] = { + .visible = true, + .named = false, + }, + [anon_sym_stod] = { + .visible = true, + .named = false, + }, + [anon_sym_tostring] = { + .visible = true, + .named = false, + }, + [anon_sym_return] = { + .visible = true, + .named = false, + }, + [anon_sym_call] = { + .visible = true, + .named = false, + }, + [anon_sym_use] = { + .visible = true, + .named = false, + }, + [anon_sym_extern] = { + .visible = true, + .named = false, + }, + [anon_sym_getfield] = { + .visible = true, + .named = false, + }, + [anon_sym_setfield] = { + .visible = true, + .named = false, + }, + [anon_sym_DOLLAR] = { + .visible = true, + .named = false, + }, + [anon_sym_AMP] = { + .visible = true, + .named = false, + }, + [anon_sym_PERCENT] = { + .visible = true, + .named = false, + }, + [anon_sym_BANG] = { + .visible = true, + .named = false, + }, + [anon_sym_DASH] = { + .visible = true, + .named = false, + }, + [sym_identifier] = { + .visible = true, + .named = true, + }, + [sym_string] = { + .visible = true, + .named = true, + }, + [sym_int] = { + .visible = true, + .named = true, + }, + [sym_double] = { + .visible = true, + .named = true, + }, + [sym_char] = { + .visible = true, + .named = true, + }, + [anon_sym_true] = { + .visible = true, + .named = false, + }, + [anon_sym_false] = { + .visible = true, + .named = false, + }, + [sym_source_file] = { + .visible = true, + .named = true, + }, + [sym__statement] = { + .visible = false, + .named = true, + }, + [sym_label_definition] = { + .visible = true, + .named = true, + }, + [sym_function_definition] = { + .visible = true, + .named = true, + }, + [sym_struct_definition] = { + .visible = true, + .named = true, + }, + [sym_instruction] = { + .visible = true, + .named = true, + }, + [sym_keyword] = { + .visible = true, + .named = true, + }, + [sym__argument] = { + .visible = false, + .named = true, + }, + [sym_value_reference] = { + .visible = true, + .named = true, + }, + [sym_direct_reference] = { + .visible = true, + .named = true, + }, + [sym_line_reference] = { + .visible = true, + .named = true, + }, + [sym_function_reference] = { + .visible = true, + .named = true, + }, + [sym_type_reference] = { + .visible = true, + .named = true, + }, + [sym_bool] = { + .visible = true, + .named = true, + }, + [aux_sym_source_file_repeat1] = { + .visible = false, + .named = false, + }, + [aux_sym_function_definition_repeat1] = { + .visible = false, + .named = false, + }, + [aux_sym_instruction_repeat1] = { + .visible = false, + .named = false, + }, +}; + +enum ts_field_identifiers { + field_arg_name = 1, + field_arg_type = 2, + field_keyword = 3, + field_name = 4, + field_return_type = 5, +}; + +static const char * const ts_field_names[] = { + [0] = NULL, + [field_arg_name] = "arg_name", + [field_arg_type] = "arg_type", + [field_keyword] = "keyword", + [field_name] = "name", + [field_return_type] = "return_type", +}; + +static const TSMapSlice ts_field_map_slices[PRODUCTION_ID_COUNT] = { + [1] = {.index = 0, .length = 1}, + [2] = {.index = 1, .length = 1}, + [3] = {.index = 2, .length = 2}, + [4] = {.index = 4, .length = 2}, + [5] = {.index = 6, .length = 4}, + [6] = {.index = 10, .length = 4}, +}; + +static const TSFieldMapEntry ts_field_map_entries[] = { + [0] = + {field_keyword, 0}, + [1] = + {field_name, 1}, + [2] = + {field_name, 1}, + {field_return_type, 2}, + [4] = + {field_arg_name, 1}, + {field_arg_type, 0}, + [6] = + {field_arg_name, 3, .inherited = true}, + {field_arg_type, 3, .inherited = true}, + {field_name, 1}, + {field_return_type, 2}, + [10] = + {field_arg_name, 0, .inherited = true}, + {field_arg_name, 1, .inherited = true}, + {field_arg_type, 0, .inherited = true}, + {field_arg_type, 1, .inherited = true}, +}; + +static const TSSymbol ts_alias_sequences[PRODUCTION_ID_COUNT][MAX_ALIAS_SEQUENCE_LENGTH] = { + [0] = {0}, +}; + +static const uint16_t ts_non_terminal_alias_map[] = { + 0, +}; + +static const TSStateId ts_primary_state_ids[STATE_COUNT] = { + [0] = 0, + [1] = 1, + [2] = 2, + [3] = 3, + [4] = 4, + [5] = 3, + [6] = 2, + [7] = 4, + [8] = 3, + [9] = 2, + [10] = 4, + [11] = 11, + [12] = 12, + [13] = 13, + [14] = 14, + [15] = 12, + [16] = 11, + [17] = 13, + [18] = 18, + [19] = 19, + [20] = 20, + [21] = 18, + [22] = 12, + [23] = 14, + [24] = 13, + [25] = 19, + [26] = 11, + [27] = 18, + [28] = 14, + [29] = 19, + [30] = 20, + [31] = 20, + [32] = 32, + [33] = 32, + [34] = 34, + [35] = 34, + [36] = 32, + [37] = 34, + [38] = 38, + [39] = 38, + [40] = 40, + [41] = 40, + [42] = 42, + [43] = 43, + [44] = 44, + [45] = 40, + [46] = 46, + [47] = 43, + [48] = 44, + [49] = 38, + [50] = 46, + [51] = 44, + [52] = 43, + [53] = 46, + [54] = 54, + [55] = 55, + [56] = 56, + [57] = 57, + [58] = 58, + [59] = 58, + [60] = 56, + [61] = 61, + [62] = 58, + [63] = 63, + [64] = 61, + [65] = 63, + [66] = 57, + [67] = 67, + [68] = 68, + [69] = 67, + [70] = 63, + [71] = 68, + [72] = 67, + [73] = 56, + [74] = 61, + [75] = 57, + [76] = 68, + [77] = 77, + [78] = 78, + [79] = 79, + [80] = 79, + [81] = 81, + [82] = 77, + [83] = 81, + [84] = 77, + [85] = 81, + [86] = 79, + [87] = 87, + [88] = 88, + [89] = 89, + [90] = 88, + [91] = 89, + [92] = 92, + [93] = 87, + [94] = 94, + [95] = 88, + [96] = 89, + [97] = 92, + [98] = 94, + [99] = 94, + [100] = 87, + [101] = 101, + [102] = 102, + [103] = 92, + [104] = 101, + [105] = 101, +}; + +static bool ts_lex(TSLexer *lexer, TSStateId state) { + START_LEXER(); + eof = lexer->eof(lexer); + switch (state) { + case 0: + if (eof) ADVANCE(159); + ADVANCE_MAP( + '!', 207, + '"', 3, + '#', 160, + '$', 204, + '%', 206, + '&', 205, + '\'', 157, + '-', 208, + '@', 161, + 'a', 30, + 'c', 6, + 'd', 55, + 'e', 83, + 'f', 7, + 'g', 32, + 'i', 51, + 'j', 141, + 'l', 43, + 'm', 143, + 'n', 90, + 'p', 101, + 'r', 44, + 's', 45, + 't', 91, + 'u', 109, + ); + if (('\t' <= lookahead && lookahead <= '\r') || + lookahead == ' ') SKIP(0); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(211); + END_STATE(); + case 1: + ADVANCE_MAP( + '!', 207, + '"', 3, + '#', 160, + '$', 204, + '%', 206, + '&', 205, + '\'', 157, + '-', 208, + '@', 161, + 'a', 30, + 'c', 6, + 'd', 55, + 'e', 86, + 'f', 7, + 'g', 32, + 'i', 51, + 'j', 141, + 'l', 43, + 'm', 143, + 'n', 90, + 'p', 101, + 'r', 44, + 's', 45, + 't', 91, + 'u', 109, + ); + if (('\t' <= lookahead && lookahead <= '\r') || + lookahead == ' ') SKIP(1); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(211); + END_STATE(); + case 2: + ADVANCE_MAP( + '!', 207, + '"', 3, + '#', 160, + '$', 204, + '%', 206, + '&', 205, + '\'', 157, + '-', 208, + '@', 161, + 'a', 30, + 'c', 6, + 'd', 55, + 'e', 87, + 'f', 7, + 'g', 32, + 'i', 51, + 'j', 141, + 'l', 43, + 'm', 143, + 'n', 90, + 'p', 101, + 'r', 44, + 's', 45, + 't', 91, + 'u', 109, + ); + if (('\t' <= lookahead && lookahead <= '\r') || + lookahead == ' ') SKIP(2); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(211); + END_STATE(); + case 3: + if (lookahead == '"') ADVANCE(210); + if (lookahead != 0) ADVANCE(3); + END_STATE(); + case 4: + if (lookahead == '#') ADVANCE(160); + if (('\t' <= lookahead && lookahead <= '\r') || + lookahead == ' ') SKIP(4); + if (('A' <= lookahead && lookahead <= 'Z') || + lookahead == '_' || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(209); + END_STATE(); + case 5: + if (lookahead == '\'') ADVANCE(213); + END_STATE(); + case 6: + if (lookahead == 'a') ADVANCE(71); + END_STATE(); + case 7: + if (lookahead == 'a') ADVANCE(75); + if (lookahead == 'u') ADVANCE(77); + END_STATE(); + case 8: + if (lookahead == 'a') ADVANCE(96); + END_STATE(); + case 9: + if (lookahead == 'a') ADVANCE(68); + END_STATE(); + case 10: + if (lookahead == 'a') ADVANCE(69); + END_STATE(); + case 11: + if (lookahead == 'a') ADVANCE(105); + END_STATE(); + case 12: + if (lookahead == 'a') ADVANCE(139); + END_STATE(); + case 13: + if (lookahead == 'a') ADVANCE(129); + if (lookahead == 's') ADVANCE(63); + END_STATE(); + case 14: + if (lookahead == 'a') ADVANCE(131); + END_STATE(); + case 15: + if (lookahead == 'a') ADVANCE(19); + END_STATE(); + case 16: + if (lookahead == 'b') ADVANCE(133); + END_STATE(); + case 17: + if (lookahead == 'c') ADVANCE(54); + if (lookahead == 's') ADVANCE(56); + END_STATE(); + case 18: + if (lookahead == 'c') ADVANCE(124); + END_STATE(); + case 19: + if (lookahead == 'c') ADVANCE(127); + END_STATE(); + case 20: + if (lookahead == 'c') ADVANCE(128); + END_STATE(); + case 21: + if (lookahead == 'd') ADVANCE(186); + END_STATE(); + case 22: + if (lookahead == 'd') ADVANCE(170); + END_STATE(); + case 23: + if (lookahead == 'd') ADVANCE(196); + if (lookahead == 'i') ADVANCE(195); + END_STATE(); + case 24: + if (lookahead == 'd') ADVANCE(202); + END_STATE(); + case 25: + if (lookahead == 'd') ADVANCE(203); + END_STATE(); + case 26: + if (lookahead == 'd') ADVANCE(183); + END_STATE(); + case 27: + if (lookahead == 'd') ADVANCE(168); + END_STATE(); + case 28: + if (lookahead == 'd') ADVANCE(169); + END_STATE(); + case 29: + if (lookahead == 'd') ADVANCE(171); + END_STATE(); + case 30: + if (lookahead == 'd') ADVANCE(21); + END_STATE(); + case 31: + if (lookahead == 'd') ADVANCE(37); + END_STATE(); + case 32: + if (lookahead == 'e') ADVANCE(118); + if (lookahead == 'r') ADVANCE(41); + END_STATE(); + case 33: + if (lookahead == 'e') ADVANCE(97); + if (lookahead == 'i') ADVANCE(121); + if (lookahead == 'p') ADVANCE(146); + END_STATE(); + case 34: + if (lookahead == 'e') ADVANCE(200); + END_STATE(); + case 35: + if (lookahead == 'e') ADVANCE(214); + END_STATE(); + case 36: + if (lookahead == 'e') ADVANCE(215); + END_STATE(); + case 37: + if (lookahead == 'e') ADVANCE(189); + END_STATE(); + case 38: + if (lookahead == 'e') ADVANCE(177); + END_STATE(); + case 39: + if (lookahead == 'e') ADVANCE(184); + END_STATE(); + case 40: + if (lookahead == 'e') ADVANCE(182); + END_STATE(); + case 41: + if (lookahead == 'e') ADVANCE(12); + END_STATE(); + case 42: + if (lookahead == 'e') ADVANCE(103); + END_STATE(); + case 43: + if (lookahead == 'e') ADVANCE(117); + if (lookahead == 'i') ADVANCE(111); + END_STATE(); + case 44: + if (lookahead == 'e') ADVANCE(138); + END_STATE(); + case 45: + if (lookahead == 'e') ADVANCE(120); + if (lookahead == 't') ADVANCE(89); + if (lookahead == 'u') ADVANCE(16); + END_STATE(); + case 46: + if (lookahead == 'e') ADVANCE(99); + END_STATE(); + case 47: + if (lookahead == 'e') ADVANCE(72); + END_STATE(); + case 48: + if (lookahead == 'e') ADVANCE(100); + END_STATE(); + case 49: + if (lookahead == 'e') ADVANCE(84); + END_STATE(); + case 50: + if (lookahead == 'e') ADVANCE(73); + END_STATE(); + case 51: + if (lookahead == 'f') ADVANCE(166); + if (lookahead == 'n') ADVANCE(33); + END_STATE(); + case 52: + if (lookahead == 'f') ADVANCE(61); + if (lookahead == 'l') ADVANCE(65); + if (lookahead == 's') ADVANCE(136); + if (lookahead == 't') ADVANCE(153); + END_STATE(); + case 53: + if (lookahead == 'g') ADVANCE(197); + END_STATE(); + case 54: + if (lookahead == 'h') ADVANCE(11); + END_STATE(); + case 55: + if (lookahead == 'i') ADVANCE(151); + END_STATE(); + case 56: + if (lookahead == 'i') ADVANCE(154); + END_STATE(); + case 57: + if (lookahead == 'i') ADVANCE(88); + END_STATE(); + case 58: + if (lookahead == 'i') ADVANCE(31); + END_STATE(); + case 59: + if (lookahead == 'i') ADVANCE(93); + END_STATE(); + case 60: + if (lookahead == 'i') ADVANCE(82); + END_STATE(); + case 61: + if (lookahead == 'i') ADVANCE(47); + END_STATE(); + case 62: + if (lookahead == 'i') ADVANCE(50); + END_STATE(); + case 63: + if (lookahead == 'i') ADVANCE(155); + END_STATE(); + case 64: + if (lookahead == 'i') ADVANCE(114); + if (lookahead == 't') ADVANCE(42); + END_STATE(); + case 65: + if (lookahead == 'i') ADVANCE(115); + END_STATE(); + case 66: + if (lookahead == 'i') ADVANCE(116); + END_STATE(); + case 67: + if (lookahead == 'l') ADVANCE(199); + END_STATE(); + case 68: + if (lookahead == 'l') ADVANCE(190); + END_STATE(); + case 69: + if (lookahead == 'l') ADVANCE(191); + END_STATE(); + case 70: + if (lookahead == 'l') ADVANCE(152); + END_STATE(); + case 71: + if (lookahead == 'l') ADVANCE(67); + END_STATE(); + case 72: + if (lookahead == 'l') ADVANCE(24); + END_STATE(); + case 73: + if (lookahead == 'l') ADVANCE(25); + END_STATE(); + case 74: + if (lookahead == 'l') ADVANCE(137); + END_STATE(); + case 75: + if (lookahead == 'l') ADVANCE(110); + END_STATE(); + case 76: + if (lookahead == 'm') ADVANCE(92); + END_STATE(); + case 77: + if (lookahead == 'n') ADVANCE(162); + END_STATE(); + case 78: + if (lookahead == 'n') ADVANCE(163); + END_STATE(); + case 79: + if (lookahead == 'n') ADVANCE(201); + END_STATE(); + case 80: + if (lookahead == 'n') ADVANCE(198); + END_STATE(); + case 81: + if (lookahead == 'n') ADVANCE(174); + END_STATE(); + case 82: + if (lookahead == 'n') ADVANCE(53); + END_STATE(); + case 83: + if (lookahead == 'n') ADVANCE(22); + if (lookahead == 'q') ADVANCE(147); + if (lookahead == 'x') ADVANCE(64); + END_STATE(); + case 84: + if (lookahead == 'n') ADVANCE(26); + END_STATE(); + case 85: + if (lookahead == 'n') ADVANCE(27); + if (lookahead == 'q') ADVANCE(147); + if (lookahead == 'x') ADVANCE(64); + END_STATE(); + case 86: + if (lookahead == 'n') ADVANCE(28); + if (lookahead == 'q') ADVANCE(147); + if (lookahead == 'x') ADVANCE(64); + END_STATE(); + case 87: + if (lookahead == 'n') ADVANCE(29); + if (lookahead == 'q') ADVANCE(147); + if (lookahead == 'x') ADVANCE(64); + END_STATE(); + case 88: + if (lookahead == 'n') ADVANCE(123); + END_STATE(); + case 89: + if (lookahead == 'o') ADVANCE(23); + if (lookahead == 'r') ADVANCE(142); + END_STATE(); + case 90: + if (lookahead == 'o') ADVANCE(119); + END_STATE(); + case 91: + if (lookahead == 'o') ADVANCE(113); + if (lookahead == 'r') ADVANCE(145); + END_STATE(); + case 92: + if (lookahead == 'p') ADVANCE(167); + END_STATE(); + case 93: + if (lookahead == 'p') ADVANCE(70); + END_STATE(); + case 94: + if (lookahead == 'p') ADVANCE(38); + END_STATE(); + case 95: + if (lookahead == 'p') ADVANCE(49); + END_STATE(); + case 96: + if (lookahead == 'p') ADVANCE(95); + END_STATE(); + case 97: + if (lookahead == 'q') ADVANCE(149); + END_STATE(); + case 98: + if (lookahead == 'r') ADVANCE(17); + END_STATE(); + case 99: + if (lookahead == 'r') ADVANCE(194); + END_STATE(); + case 100: + if (lookahead == 'r') ADVANCE(193); + END_STATE(); + case 101: + if (lookahead == 'r') ADVANCE(57); + END_STATE(); + case 102: + if (lookahead == 'r') ADVANCE(15); + END_STATE(); + case 103: + if (lookahead == 'r') ADVANCE(79); + END_STATE(); + case 104: + if (lookahead == 'r') ADVANCE(80); + END_STATE(); + case 105: + if (lookahead == 'r') ADVANCE(14); + END_STATE(); + case 106: + if (lookahead == 'r') ADVANCE(60); + END_STATE(); + case 107: + if (lookahead == 'r') ADVANCE(150); + END_STATE(); + case 108: + if (lookahead == 's') ADVANCE(178); + END_STATE(); + case 109: + if (lookahead == 's') ADVANCE(34); + END_STATE(); + case 110: + if (lookahead == 's') ADVANCE(36); + END_STATE(); + case 111: + if (lookahead == 's') ADVANCE(132); + END_STATE(); + case 112: + if (lookahead == 's') ADVANCE(46); + END_STATE(); + case 113: + if (lookahead == 's') ADVANCE(140); + END_STATE(); + case 114: + if (lookahead == 's') ADVANCE(135); + END_STATE(); + case 115: + if (lookahead == 's') ADVANCE(125); + END_STATE(); + case 116: + if (lookahead == 's') ADVANCE(126); + END_STATE(); + case 117: + if (lookahead == 's') ADVANCE(112); + END_STATE(); + case 118: + if (lookahead == 't') ADVANCE(52); + END_STATE(); + case 119: + if (lookahead == 't') ADVANCE(192); + END_STATE(); + case 120: + if (lookahead == 't') ADVANCE(175); + END_STATE(); + case 121: + if (lookahead == 't') ADVANCE(176); + END_STATE(); + case 122: + if (lookahead == 't') ADVANCE(172); + END_STATE(); + case 123: + if (lookahead == 't') ADVANCE(173); + END_STATE(); + case 124: + if (lookahead == 't') ADVANCE(164); + END_STATE(); + case 125: + if (lookahead == 't') ADVANCE(13); + END_STATE(); + case 126: + if (lookahead == 't') ADVANCE(179); + END_STATE(); + case 127: + if (lookahead == 't') ADVANCE(187); + END_STATE(); + case 128: + if (lookahead == 't') ADVANCE(165); + END_STATE(); + case 129: + if (lookahead == 't') ADVANCE(181); + END_STATE(); + case 130: + if (lookahead == 't') ADVANCE(180); + END_STATE(); + case 131: + if (lookahead == 't') ADVANCE(185); + END_STATE(); + case 132: + if (lookahead == 't') ADVANCE(8); + END_STATE(); + case 133: + if (lookahead == 't') ADVANCE(102); + END_STATE(); + case 134: + if (lookahead == 't') ADVANCE(107); + END_STATE(); + case 135: + if (lookahead == 't') ADVANCE(108); + END_STATE(); + case 136: + if (lookahead == 't') ADVANCE(98); + END_STATE(); + case 137: + if (lookahead == 't') ADVANCE(59); + END_STATE(); + case 138: + if (lookahead == 't') ADVANCE(148); + END_STATE(); + case 139: + if (lookahead == 't') ADVANCE(48); + END_STATE(); + case 140: + if (lookahead == 't') ADVANCE(106); + END_STATE(); + case 141: + if (lookahead == 'u') ADVANCE(76); + END_STATE(); + case 142: + if (lookahead == 'u') ADVANCE(18); + END_STATE(); + case 143: + if (lookahead == 'u') ADVANCE(74); + END_STATE(); + case 144: + if (lookahead == 'u') ADVANCE(78); + END_STATE(); + case 145: + if (lookahead == 'u') ADVANCE(35); + END_STATE(); + case 146: + if (lookahead == 'u') ADVANCE(122); + END_STATE(); + case 147: + if (lookahead == 'u') ADVANCE(9); + END_STATE(); + case 148: + if (lookahead == 'u') ADVANCE(104); + END_STATE(); + case 149: + if (lookahead == 'u') ADVANCE(10); + END_STATE(); + case 150: + if (lookahead == 'u') ADVANCE(20); + END_STATE(); + case 151: + if (lookahead == 'v') ADVANCE(58); + END_STATE(); + case 152: + if (lookahead == 'y') ADVANCE(188); + END_STATE(); + case 153: + if (lookahead == 'y') ADVANCE(94); + END_STATE(); + case 154: + if (lookahead == 'z') ADVANCE(39); + END_STATE(); + case 155: + if (lookahead == 'z') ADVANCE(40); + END_STATE(); + case 156: + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(212); + END_STATE(); + case 157: + if (lookahead != 0 && + lookahead != '\'') ADVANCE(5); + END_STATE(); + case 158: + if (eof) ADVANCE(159); + ADVANCE_MAP( + '!', 207, + '"', 3, + '#', 160, + '$', 204, + '%', 206, + '&', 205, + '\'', 157, + '-', 208, + '@', 161, + 'a', 30, + 'c', 6, + 'd', 55, + 'e', 85, + 'f', 7, + 'g', 32, + 'i', 51, + 'j', 141, + 'l', 43, + 'm', 143, + 'n', 90, + 'p', 101, + 'r', 44, + 's', 45, + 't', 91, + 'u', 109, + ); + if (('\t' <= lookahead && lookahead <= '\r') || + lookahead == ' ') SKIP(158); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(211); + END_STATE(); + case 159: + ACCEPT_TOKEN(ts_builtin_sym_end); + END_STATE(); + case 160: + ACCEPT_TOKEN(sym_comment); + if (lookahead != 0 && + lookahead != '\n') ADVANCE(160); + END_STATE(); + case 161: + ACCEPT_TOKEN(anon_sym_AT); + END_STATE(); + case 162: + ACCEPT_TOKEN(anon_sym_fun); + END_STATE(); + case 163: + ACCEPT_TOKEN(anon_sym_endfun); + END_STATE(); + case 164: + ACCEPT_TOKEN(anon_sym_struct); + END_STATE(); + case 165: + ACCEPT_TOKEN(anon_sym_endstruct); + END_STATE(); + case 166: + ACCEPT_TOKEN(anon_sym_if); + END_STATE(); + case 167: + ACCEPT_TOKEN(anon_sym_jump); + END_STATE(); + case 168: + ACCEPT_TOKEN(anon_sym_end); + END_STATE(); + case 169: + ACCEPT_TOKEN(anon_sym_end); + if (lookahead == 'f') ADVANCE(144); + END_STATE(); + case 170: + ACCEPT_TOKEN(anon_sym_end); + if (lookahead == 'f') ADVANCE(144); + if (lookahead == 's') ADVANCE(134); + END_STATE(); + case 171: + ACCEPT_TOKEN(anon_sym_end); + if (lookahead == 's') ADVANCE(134); + END_STATE(); + case 172: + ACCEPT_TOKEN(anon_sym_input); + END_STATE(); + case 173: + ACCEPT_TOKEN(anon_sym_print); + if (lookahead == 'l') ADVANCE(81); + END_STATE(); + case 174: + ACCEPT_TOKEN(anon_sym_println); + END_STATE(); + case 175: + ACCEPT_TOKEN(anon_sym_set); + if (lookahead == 'f') ADVANCE(62); + if (lookahead == 'l') ADVANCE(66); + END_STATE(); + case 176: + ACCEPT_TOKEN(anon_sym_init); + END_STATE(); + case 177: + ACCEPT_TOKEN(anon_sym_gettype); + END_STATE(); + case 178: + ACCEPT_TOKEN(anon_sym_exists); + END_STATE(); + case 179: + ACCEPT_TOKEN(anon_sym_setlist); + if (lookahead == 'a') ADVANCE(130); + END_STATE(); + case 180: + ACCEPT_TOKEN(anon_sym_setlistat); + END_STATE(); + case 181: + ACCEPT_TOKEN(anon_sym_getlistat); + END_STATE(); + case 182: + ACCEPT_TOKEN(anon_sym_getlistsize); + END_STATE(); + case 183: + ACCEPT_TOKEN(anon_sym_listappend); + END_STATE(); + case 184: + ACCEPT_TOKEN(anon_sym_getstrsize); + END_STATE(); + case 185: + ACCEPT_TOKEN(anon_sym_getstrcharat); + END_STATE(); + case 186: + ACCEPT_TOKEN(anon_sym_add); + END_STATE(); + case 187: + ACCEPT_TOKEN(anon_sym_subtract); + END_STATE(); + case 188: + ACCEPT_TOKEN(anon_sym_multiply); + END_STATE(); + case 189: + ACCEPT_TOKEN(anon_sym_divide); + END_STATE(); + case 190: + ACCEPT_TOKEN(anon_sym_equal); + END_STATE(); + case 191: + ACCEPT_TOKEN(anon_sym_inequal); + END_STATE(); + case 192: + ACCEPT_TOKEN(anon_sym_not); + END_STATE(); + case 193: + ACCEPT_TOKEN(anon_sym_greater); + END_STATE(); + case 194: + ACCEPT_TOKEN(anon_sym_lesser); + END_STATE(); + case 195: + ACCEPT_TOKEN(anon_sym_stoi); + END_STATE(); + case 196: + ACCEPT_TOKEN(anon_sym_stod); + END_STATE(); + case 197: + ACCEPT_TOKEN(anon_sym_tostring); + END_STATE(); + case 198: + ACCEPT_TOKEN(anon_sym_return); + END_STATE(); + case 199: + ACCEPT_TOKEN(anon_sym_call); + END_STATE(); + case 200: + ACCEPT_TOKEN(anon_sym_use); + END_STATE(); + case 201: + ACCEPT_TOKEN(anon_sym_extern); + END_STATE(); + case 202: + ACCEPT_TOKEN(anon_sym_getfield); + END_STATE(); + case 203: + ACCEPT_TOKEN(anon_sym_setfield); + END_STATE(); + case 204: + ACCEPT_TOKEN(anon_sym_DOLLAR); + END_STATE(); + case 205: + ACCEPT_TOKEN(anon_sym_AMP); + END_STATE(); + case 206: + ACCEPT_TOKEN(anon_sym_PERCENT); + END_STATE(); + case 207: + ACCEPT_TOKEN(anon_sym_BANG); + END_STATE(); + case 208: + ACCEPT_TOKEN(anon_sym_DASH); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(211); + END_STATE(); + case 209: + ACCEPT_TOKEN(sym_identifier); + if (('0' <= lookahead && lookahead <= '9') || + ('A' <= lookahead && lookahead <= 'Z') || + lookahead == '_' || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(209); + END_STATE(); + case 210: + ACCEPT_TOKEN(sym_string); + END_STATE(); + case 211: + ACCEPT_TOKEN(sym_int); + if (lookahead == '.') ADVANCE(156); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(211); + END_STATE(); + case 212: + ACCEPT_TOKEN(sym_double); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(212); + END_STATE(); + case 213: + ACCEPT_TOKEN(sym_char); + END_STATE(); + case 214: + ACCEPT_TOKEN(anon_sym_true); + END_STATE(); + case 215: + ACCEPT_TOKEN(anon_sym_false); + END_STATE(); + default: + return false; + } +} + +static const TSLexerMode ts_lex_modes[STATE_COUNT] = { + [0] = {.lex_state = 0}, + [1] = {.lex_state = 158}, + [2] = {.lex_state = 158}, + [3] = {.lex_state = 1}, + [4] = {.lex_state = 158}, + [5] = {.lex_state = 158}, + [6] = {.lex_state = 2}, + [7] = {.lex_state = 2}, + [8] = {.lex_state = 2}, + [9] = {.lex_state = 1}, + [10] = {.lex_state = 1}, + [11] = {.lex_state = 2}, + [12] = {.lex_state = 158}, + [13] = {.lex_state = 158}, + [14] = {.lex_state = 2}, + [15] = {.lex_state = 2}, + [16] = {.lex_state = 158}, + [17] = {.lex_state = 2}, + [18] = {.lex_state = 158}, + [19] = {.lex_state = 2}, + [20] = {.lex_state = 2}, + [21] = {.lex_state = 2}, + [22] = {.lex_state = 1}, + [23] = {.lex_state = 158}, + [24] = {.lex_state = 1}, + [25] = {.lex_state = 158}, + [26] = {.lex_state = 1}, + [27] = {.lex_state = 1}, + [28] = {.lex_state = 1}, + [29] = {.lex_state = 1}, + [30] = {.lex_state = 1}, + [31] = {.lex_state = 158}, + [32] = {.lex_state = 1}, + [33] = {.lex_state = 1}, + [34] = {.lex_state = 1}, + [35] = {.lex_state = 1}, + [36] = {.lex_state = 1}, + [37] = {.lex_state = 1}, + [38] = {.lex_state = 1}, + [39] = {.lex_state = 1}, + [40] = {.lex_state = 158}, + [41] = {.lex_state = 2}, + [42] = {.lex_state = 158}, + [43] = {.lex_state = 2}, + [44] = {.lex_state = 2}, + [45] = {.lex_state = 1}, + [46] = {.lex_state = 1}, + [47] = {.lex_state = 2}, + [48] = {.lex_state = 2}, + [49] = {.lex_state = 1}, + [50] = {.lex_state = 1}, + [51] = {.lex_state = 2}, + [52] = {.lex_state = 2}, + [53] = {.lex_state = 1}, + [54] = {.lex_state = 1}, + [55] = {.lex_state = 1}, + [56] = {.lex_state = 1}, + [57] = {.lex_state = 1}, + [58] = {.lex_state = 2}, + [59] = {.lex_state = 1}, + [60] = {.lex_state = 158}, + [61] = {.lex_state = 1}, + [62] = {.lex_state = 158}, + [63] = {.lex_state = 1}, + [64] = {.lex_state = 158}, + [65] = {.lex_state = 2}, + [66] = {.lex_state = 158}, + [67] = {.lex_state = 1}, + [68] = {.lex_state = 1}, + [69] = {.lex_state = 158}, + [70] = {.lex_state = 158}, + [71] = {.lex_state = 2}, + [72] = {.lex_state = 2}, + [73] = {.lex_state = 2}, + [74] = {.lex_state = 2}, + [75] = {.lex_state = 2}, + [76] = {.lex_state = 158}, + [77] = {.lex_state = 0}, + [78] = {.lex_state = 0}, + [79] = {.lex_state = 0}, + [80] = {.lex_state = 0}, + [81] = {.lex_state = 0}, + [82] = {.lex_state = 0}, + [83] = {.lex_state = 0}, + [84] = {.lex_state = 0}, + [85] = {.lex_state = 0}, + [86] = {.lex_state = 0}, + [87] = {.lex_state = 4}, + [88] = {.lex_state = 4}, + [89] = {.lex_state = 4}, + [90] = {.lex_state = 4}, + [91] = {.lex_state = 4}, + [92] = {.lex_state = 4}, + [93] = {.lex_state = 4}, + [94] = {.lex_state = 4}, + [95] = {.lex_state = 4}, + [96] = {.lex_state = 4}, + [97] = {.lex_state = 4}, + [98] = {.lex_state = 4}, + [99] = {.lex_state = 4}, + [100] = {.lex_state = 4}, + [101] = {.lex_state = 4}, + [102] = {.lex_state = 0}, + [103] = {.lex_state = 4}, + [104] = {.lex_state = 4}, + [105] = {.lex_state = 4}, +}; + +static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { + [STATE(0)] = { + [ts_builtin_sym_end] = ACTIONS(1), + [sym_comment] = ACTIONS(3), + [anon_sym_AT] = ACTIONS(1), + [anon_sym_fun] = ACTIONS(1), + [anon_sym_endfun] = ACTIONS(1), + [anon_sym_struct] = ACTIONS(1), + [anon_sym_endstruct] = ACTIONS(1), + [anon_sym_if] = ACTIONS(1), + [anon_sym_jump] = ACTIONS(1), + [anon_sym_end] = ACTIONS(1), + [anon_sym_input] = ACTIONS(1), + [anon_sym_print] = ACTIONS(1), + [anon_sym_println] = ACTIONS(1), + [anon_sym_set] = ACTIONS(1), + [anon_sym_init] = ACTIONS(1), + [anon_sym_gettype] = ACTIONS(1), + [anon_sym_exists] = ACTIONS(1), + [anon_sym_setlist] = ACTIONS(1), + [anon_sym_setlistat] = ACTIONS(1), + [anon_sym_getlistat] = ACTIONS(1), + [anon_sym_getlistsize] = ACTIONS(1), + [anon_sym_listappend] = ACTIONS(1), + [anon_sym_getstrsize] = ACTIONS(1), + [anon_sym_getstrcharat] = ACTIONS(1), + [anon_sym_add] = ACTIONS(1), + [anon_sym_subtract] = ACTIONS(1), + [anon_sym_multiply] = ACTIONS(1), + [anon_sym_divide] = ACTIONS(1), + [anon_sym_equal] = ACTIONS(1), + [anon_sym_inequal] = ACTIONS(1), + [anon_sym_not] = ACTIONS(1), + [anon_sym_greater] = ACTIONS(1), + [anon_sym_lesser] = ACTIONS(1), + [anon_sym_stoi] = ACTIONS(1), + [anon_sym_stod] = ACTIONS(1), + [anon_sym_tostring] = ACTIONS(1), + [anon_sym_return] = ACTIONS(1), + [anon_sym_call] = ACTIONS(1), + [anon_sym_use] = ACTIONS(1), + [anon_sym_extern] = ACTIONS(1), + [anon_sym_getfield] = ACTIONS(1), + [anon_sym_setfield] = ACTIONS(1), + [anon_sym_DOLLAR] = ACTIONS(1), + [anon_sym_AMP] = ACTIONS(1), + [anon_sym_PERCENT] = ACTIONS(1), + [anon_sym_BANG] = ACTIONS(1), + [anon_sym_DASH] = ACTIONS(1), + [sym_string] = ACTIONS(1), + [sym_int] = ACTIONS(1), + [sym_double] = ACTIONS(1), + [sym_char] = ACTIONS(1), + [anon_sym_true] = ACTIONS(1), + [anon_sym_false] = ACTIONS(1), + }, + [STATE(1)] = { + [sym_source_file] = STATE(102), + [sym__statement] = STATE(42), + [sym_label_definition] = STATE(42), + [sym_function_definition] = STATE(42), + [sym_struct_definition] = STATE(42), + [sym_instruction] = STATE(42), + [sym_keyword] = STATE(2), + [aux_sym_source_file_repeat1] = STATE(42), + [ts_builtin_sym_end] = ACTIONS(5), + [sym_comment] = ACTIONS(3), + [anon_sym_AT] = ACTIONS(7), + [anon_sym_fun] = ACTIONS(9), + [anon_sym_struct] = ACTIONS(11), + [anon_sym_if] = ACTIONS(13), + [anon_sym_jump] = ACTIONS(13), + [anon_sym_end] = ACTIONS(13), + [anon_sym_input] = ACTIONS(13), + [anon_sym_print] = ACTIONS(15), + [anon_sym_println] = ACTIONS(13), + [anon_sym_set] = ACTIONS(15), + [anon_sym_init] = ACTIONS(13), + [anon_sym_gettype] = ACTIONS(13), + [anon_sym_exists] = ACTIONS(13), + [anon_sym_setlist] = ACTIONS(15), + [anon_sym_setlistat] = ACTIONS(13), + [anon_sym_getlistat] = ACTIONS(13), + [anon_sym_getlistsize] = ACTIONS(13), + [anon_sym_listappend] = ACTIONS(13), + [anon_sym_getstrsize] = ACTIONS(13), + [anon_sym_getstrcharat] = ACTIONS(13), + [anon_sym_add] = ACTIONS(13), + [anon_sym_subtract] = ACTIONS(13), + [anon_sym_multiply] = ACTIONS(13), + [anon_sym_divide] = ACTIONS(13), + [anon_sym_equal] = ACTIONS(13), + [anon_sym_inequal] = ACTIONS(13), + [anon_sym_not] = ACTIONS(13), + [anon_sym_greater] = ACTIONS(13), + [anon_sym_lesser] = ACTIONS(13), + [anon_sym_stoi] = ACTIONS(13), + [anon_sym_stod] = ACTIONS(13), + [anon_sym_tostring] = ACTIONS(13), + [anon_sym_return] = ACTIONS(13), + [anon_sym_call] = ACTIONS(13), + [anon_sym_use] = ACTIONS(13), + [anon_sym_extern] = ACTIONS(13), + [anon_sym_getfield] = ACTIONS(13), + [anon_sym_setfield] = ACTIONS(13), + }, + [STATE(2)] = { + [sym__argument] = STATE(4), + [sym_value_reference] = STATE(4), + [sym_direct_reference] = STATE(4), + [sym_line_reference] = STATE(4), + [sym_function_reference] = STATE(4), + [sym_type_reference] = STATE(4), + [sym_bool] = STATE(4), + [aux_sym_instruction_repeat1] = STATE(4), + [ts_builtin_sym_end] = ACTIONS(17), + [sym_comment] = ACTIONS(3), + [anon_sym_AT] = ACTIONS(17), + [anon_sym_fun] = ACTIONS(17), + [anon_sym_struct] = ACTIONS(17), + [anon_sym_if] = ACTIONS(17), + [anon_sym_jump] = ACTIONS(17), + [anon_sym_end] = ACTIONS(17), + [anon_sym_input] = ACTIONS(17), + [anon_sym_print] = ACTIONS(19), + [anon_sym_println] = ACTIONS(17), + [anon_sym_set] = ACTIONS(19), + [anon_sym_init] = ACTIONS(17), + [anon_sym_gettype] = ACTIONS(17), + [anon_sym_exists] = ACTIONS(17), + [anon_sym_setlist] = ACTIONS(19), + [anon_sym_setlistat] = ACTIONS(17), + [anon_sym_getlistat] = ACTIONS(17), + [anon_sym_getlistsize] = ACTIONS(17), + [anon_sym_listappend] = ACTIONS(17), + [anon_sym_getstrsize] = ACTIONS(17), + [anon_sym_getstrcharat] = ACTIONS(17), + [anon_sym_add] = ACTIONS(17), + [anon_sym_subtract] = ACTIONS(17), + [anon_sym_multiply] = ACTIONS(17), + [anon_sym_divide] = ACTIONS(17), + [anon_sym_equal] = ACTIONS(17), + [anon_sym_inequal] = ACTIONS(17), + [anon_sym_not] = ACTIONS(17), + [anon_sym_greater] = ACTIONS(17), + [anon_sym_lesser] = ACTIONS(17), + [anon_sym_stoi] = ACTIONS(17), + [anon_sym_stod] = ACTIONS(17), + [anon_sym_tostring] = ACTIONS(17), + [anon_sym_return] = ACTIONS(17), + [anon_sym_call] = ACTIONS(17), + [anon_sym_use] = ACTIONS(17), + [anon_sym_extern] = ACTIONS(17), + [anon_sym_getfield] = ACTIONS(17), + [anon_sym_setfield] = ACTIONS(17), + [anon_sym_DOLLAR] = ACTIONS(21), + [anon_sym_AMP] = ACTIONS(23), + [anon_sym_PERCENT] = ACTIONS(25), + [anon_sym_BANG] = ACTIONS(27), + [anon_sym_DASH] = ACTIONS(29), + [sym_string] = ACTIONS(31), + [sym_int] = ACTIONS(33), + [sym_double] = ACTIONS(31), + [sym_char] = ACTIONS(31), + [anon_sym_true] = ACTIONS(35), + [anon_sym_false] = ACTIONS(35), + }, + [STATE(3)] = { + [sym__argument] = STATE(3), + [sym_value_reference] = STATE(3), + [sym_direct_reference] = STATE(3), + [sym_line_reference] = STATE(3), + [sym_function_reference] = STATE(3), + [sym_type_reference] = STATE(3), + [sym_bool] = STATE(3), + [aux_sym_instruction_repeat1] = STATE(3), + [sym_comment] = ACTIONS(3), + [anon_sym_AT] = ACTIONS(37), + [anon_sym_fun] = ACTIONS(37), + [anon_sym_endfun] = ACTIONS(37), + [anon_sym_struct] = ACTIONS(37), + [anon_sym_if] = ACTIONS(37), + [anon_sym_jump] = ACTIONS(37), + [anon_sym_end] = ACTIONS(39), + [anon_sym_input] = ACTIONS(37), + [anon_sym_print] = ACTIONS(39), + [anon_sym_println] = ACTIONS(37), + [anon_sym_set] = ACTIONS(39), + [anon_sym_init] = ACTIONS(37), + [anon_sym_gettype] = ACTIONS(37), + [anon_sym_exists] = ACTIONS(37), + [anon_sym_setlist] = ACTIONS(39), + [anon_sym_setlistat] = ACTIONS(37), + [anon_sym_getlistat] = ACTIONS(37), + [anon_sym_getlistsize] = ACTIONS(37), + [anon_sym_listappend] = ACTIONS(37), + [anon_sym_getstrsize] = ACTIONS(37), + [anon_sym_getstrcharat] = ACTIONS(37), + [anon_sym_add] = ACTIONS(37), + [anon_sym_subtract] = ACTIONS(37), + [anon_sym_multiply] = ACTIONS(37), + [anon_sym_divide] = ACTIONS(37), + [anon_sym_equal] = ACTIONS(37), + [anon_sym_inequal] = ACTIONS(37), + [anon_sym_not] = ACTIONS(37), + [anon_sym_greater] = ACTIONS(37), + [anon_sym_lesser] = ACTIONS(37), + [anon_sym_stoi] = ACTIONS(37), + [anon_sym_stod] = ACTIONS(37), + [anon_sym_tostring] = ACTIONS(37), + [anon_sym_return] = ACTIONS(37), + [anon_sym_call] = ACTIONS(37), + [anon_sym_use] = ACTIONS(37), + [anon_sym_extern] = ACTIONS(37), + [anon_sym_getfield] = ACTIONS(37), + [anon_sym_setfield] = ACTIONS(37), + [anon_sym_DOLLAR] = ACTIONS(41), + [anon_sym_AMP] = ACTIONS(44), + [anon_sym_PERCENT] = ACTIONS(47), + [anon_sym_BANG] = ACTIONS(50), + [anon_sym_DASH] = ACTIONS(53), + [sym_string] = ACTIONS(56), + [sym_int] = ACTIONS(59), + [sym_double] = ACTIONS(56), + [sym_char] = ACTIONS(56), + [anon_sym_true] = ACTIONS(62), + [anon_sym_false] = ACTIONS(62), + }, + [STATE(4)] = { + [sym__argument] = STATE(5), + [sym_value_reference] = STATE(5), + [sym_direct_reference] = STATE(5), + [sym_line_reference] = STATE(5), + [sym_function_reference] = STATE(5), + [sym_type_reference] = STATE(5), + [sym_bool] = STATE(5), + [aux_sym_instruction_repeat1] = STATE(5), + [ts_builtin_sym_end] = ACTIONS(65), + [sym_comment] = ACTIONS(3), + [anon_sym_AT] = ACTIONS(65), + [anon_sym_fun] = ACTIONS(65), + [anon_sym_struct] = ACTIONS(65), + [anon_sym_if] = ACTIONS(65), + [anon_sym_jump] = ACTIONS(65), + [anon_sym_end] = ACTIONS(65), + [anon_sym_input] = ACTIONS(65), + [anon_sym_print] = ACTIONS(67), + [anon_sym_println] = ACTIONS(65), + [anon_sym_set] = ACTIONS(67), + [anon_sym_init] = ACTIONS(65), + [anon_sym_gettype] = ACTIONS(65), + [anon_sym_exists] = ACTIONS(65), + [anon_sym_setlist] = ACTIONS(67), + [anon_sym_setlistat] = ACTIONS(65), + [anon_sym_getlistat] = ACTIONS(65), + [anon_sym_getlistsize] = ACTIONS(65), + [anon_sym_listappend] = ACTIONS(65), + [anon_sym_getstrsize] = ACTIONS(65), + [anon_sym_getstrcharat] = ACTIONS(65), + [anon_sym_add] = ACTIONS(65), + [anon_sym_subtract] = ACTIONS(65), + [anon_sym_multiply] = ACTIONS(65), + [anon_sym_divide] = ACTIONS(65), + [anon_sym_equal] = ACTIONS(65), + [anon_sym_inequal] = ACTIONS(65), + [anon_sym_not] = ACTIONS(65), + [anon_sym_greater] = ACTIONS(65), + [anon_sym_lesser] = ACTIONS(65), + [anon_sym_stoi] = ACTIONS(65), + [anon_sym_stod] = ACTIONS(65), + [anon_sym_tostring] = ACTIONS(65), + [anon_sym_return] = ACTIONS(65), + [anon_sym_call] = ACTIONS(65), + [anon_sym_use] = ACTIONS(65), + [anon_sym_extern] = ACTIONS(65), + [anon_sym_getfield] = ACTIONS(65), + [anon_sym_setfield] = ACTIONS(65), + [anon_sym_DOLLAR] = ACTIONS(21), + [anon_sym_AMP] = ACTIONS(23), + [anon_sym_PERCENT] = ACTIONS(25), + [anon_sym_BANG] = ACTIONS(27), + [anon_sym_DASH] = ACTIONS(29), + [sym_string] = ACTIONS(69), + [sym_int] = ACTIONS(71), + [sym_double] = ACTIONS(69), + [sym_char] = ACTIONS(69), + [anon_sym_true] = ACTIONS(35), + [anon_sym_false] = ACTIONS(35), + }, + [STATE(5)] = { + [sym__argument] = STATE(5), + [sym_value_reference] = STATE(5), + [sym_direct_reference] = STATE(5), + [sym_line_reference] = STATE(5), + [sym_function_reference] = STATE(5), + [sym_type_reference] = STATE(5), + [sym_bool] = STATE(5), + [aux_sym_instruction_repeat1] = STATE(5), + [ts_builtin_sym_end] = ACTIONS(37), + [sym_comment] = ACTIONS(3), + [anon_sym_AT] = ACTIONS(37), + [anon_sym_fun] = ACTIONS(37), + [anon_sym_struct] = ACTIONS(37), + [anon_sym_if] = ACTIONS(37), + [anon_sym_jump] = ACTIONS(37), + [anon_sym_end] = ACTIONS(37), + [anon_sym_input] = ACTIONS(37), + [anon_sym_print] = ACTIONS(39), + [anon_sym_println] = ACTIONS(37), + [anon_sym_set] = ACTIONS(39), + [anon_sym_init] = ACTIONS(37), + [anon_sym_gettype] = ACTIONS(37), + [anon_sym_exists] = ACTIONS(37), + [anon_sym_setlist] = ACTIONS(39), + [anon_sym_setlistat] = ACTIONS(37), + [anon_sym_getlistat] = ACTIONS(37), + [anon_sym_getlistsize] = ACTIONS(37), + [anon_sym_listappend] = ACTIONS(37), + [anon_sym_getstrsize] = ACTIONS(37), + [anon_sym_getstrcharat] = ACTIONS(37), + [anon_sym_add] = ACTIONS(37), + [anon_sym_subtract] = ACTIONS(37), + [anon_sym_multiply] = ACTIONS(37), + [anon_sym_divide] = ACTIONS(37), + [anon_sym_equal] = ACTIONS(37), + [anon_sym_inequal] = ACTIONS(37), + [anon_sym_not] = ACTIONS(37), + [anon_sym_greater] = ACTIONS(37), + [anon_sym_lesser] = ACTIONS(37), + [anon_sym_stoi] = ACTIONS(37), + [anon_sym_stod] = ACTIONS(37), + [anon_sym_tostring] = ACTIONS(37), + [anon_sym_return] = ACTIONS(37), + [anon_sym_call] = ACTIONS(37), + [anon_sym_use] = ACTIONS(37), + [anon_sym_extern] = ACTIONS(37), + [anon_sym_getfield] = ACTIONS(37), + [anon_sym_setfield] = ACTIONS(37), + [anon_sym_DOLLAR] = ACTIONS(73), + [anon_sym_AMP] = ACTIONS(76), + [anon_sym_PERCENT] = ACTIONS(79), + [anon_sym_BANG] = ACTIONS(82), + [anon_sym_DASH] = ACTIONS(85), + [sym_string] = ACTIONS(88), + [sym_int] = ACTIONS(91), + [sym_double] = ACTIONS(88), + [sym_char] = ACTIONS(88), + [anon_sym_true] = ACTIONS(94), + [anon_sym_false] = ACTIONS(94), + }, + [STATE(6)] = { + [sym__argument] = STATE(7), + [sym_value_reference] = STATE(7), + [sym_direct_reference] = STATE(7), + [sym_line_reference] = STATE(7), + [sym_function_reference] = STATE(7), + [sym_type_reference] = STATE(7), + [sym_bool] = STATE(7), + [aux_sym_instruction_repeat1] = STATE(7), + [sym_comment] = ACTIONS(3), + [anon_sym_AT] = ACTIONS(17), + [anon_sym_fun] = ACTIONS(17), + [anon_sym_struct] = ACTIONS(17), + [anon_sym_endstruct] = ACTIONS(17), + [anon_sym_if] = ACTIONS(17), + [anon_sym_jump] = ACTIONS(17), + [anon_sym_end] = ACTIONS(19), + [anon_sym_input] = ACTIONS(17), + [anon_sym_print] = ACTIONS(19), + [anon_sym_println] = ACTIONS(17), + [anon_sym_set] = ACTIONS(19), + [anon_sym_init] = ACTIONS(17), + [anon_sym_gettype] = ACTIONS(17), + [anon_sym_exists] = ACTIONS(17), + [anon_sym_setlist] = ACTIONS(19), + [anon_sym_setlistat] = ACTIONS(17), + [anon_sym_getlistat] = ACTIONS(17), + [anon_sym_getlistsize] = ACTIONS(17), + [anon_sym_listappend] = ACTIONS(17), + [anon_sym_getstrsize] = ACTIONS(17), + [anon_sym_getstrcharat] = ACTIONS(17), + [anon_sym_add] = ACTIONS(17), + [anon_sym_subtract] = ACTIONS(17), + [anon_sym_multiply] = ACTIONS(17), + [anon_sym_divide] = ACTIONS(17), + [anon_sym_equal] = ACTIONS(17), + [anon_sym_inequal] = ACTIONS(17), + [anon_sym_not] = ACTIONS(17), + [anon_sym_greater] = ACTIONS(17), + [anon_sym_lesser] = ACTIONS(17), + [anon_sym_stoi] = ACTIONS(17), + [anon_sym_stod] = ACTIONS(17), + [anon_sym_tostring] = ACTIONS(17), + [anon_sym_return] = ACTIONS(17), + [anon_sym_call] = ACTIONS(17), + [anon_sym_use] = ACTIONS(17), + [anon_sym_extern] = ACTIONS(17), + [anon_sym_getfield] = ACTIONS(17), + [anon_sym_setfield] = ACTIONS(17), + [anon_sym_DOLLAR] = ACTIONS(97), + [anon_sym_AMP] = ACTIONS(99), + [anon_sym_PERCENT] = ACTIONS(101), + [anon_sym_BANG] = ACTIONS(103), + [anon_sym_DASH] = ACTIONS(105), + [sym_string] = ACTIONS(107), + [sym_int] = ACTIONS(109), + [sym_double] = ACTIONS(107), + [sym_char] = ACTIONS(107), + [anon_sym_true] = ACTIONS(111), + [anon_sym_false] = ACTIONS(111), + }, + [STATE(7)] = { + [sym__argument] = STATE(8), + [sym_value_reference] = STATE(8), + [sym_direct_reference] = STATE(8), + [sym_line_reference] = STATE(8), + [sym_function_reference] = STATE(8), + [sym_type_reference] = STATE(8), + [sym_bool] = STATE(8), + [aux_sym_instruction_repeat1] = STATE(8), + [sym_comment] = ACTIONS(3), + [anon_sym_AT] = ACTIONS(65), + [anon_sym_fun] = ACTIONS(65), + [anon_sym_struct] = ACTIONS(65), + [anon_sym_endstruct] = ACTIONS(65), + [anon_sym_if] = ACTIONS(65), + [anon_sym_jump] = ACTIONS(65), + [anon_sym_end] = ACTIONS(67), + [anon_sym_input] = ACTIONS(65), + [anon_sym_print] = ACTIONS(67), + [anon_sym_println] = ACTIONS(65), + [anon_sym_set] = ACTIONS(67), + [anon_sym_init] = ACTIONS(65), + [anon_sym_gettype] = ACTIONS(65), + [anon_sym_exists] = ACTIONS(65), + [anon_sym_setlist] = ACTIONS(67), + [anon_sym_setlistat] = ACTIONS(65), + [anon_sym_getlistat] = ACTIONS(65), + [anon_sym_getlistsize] = ACTIONS(65), + [anon_sym_listappend] = ACTIONS(65), + [anon_sym_getstrsize] = ACTIONS(65), + [anon_sym_getstrcharat] = ACTIONS(65), + [anon_sym_add] = ACTIONS(65), + [anon_sym_subtract] = ACTIONS(65), + [anon_sym_multiply] = ACTIONS(65), + [anon_sym_divide] = ACTIONS(65), + [anon_sym_equal] = ACTIONS(65), + [anon_sym_inequal] = ACTIONS(65), + [anon_sym_not] = ACTIONS(65), + [anon_sym_greater] = ACTIONS(65), + [anon_sym_lesser] = ACTIONS(65), + [anon_sym_stoi] = ACTIONS(65), + [anon_sym_stod] = ACTIONS(65), + [anon_sym_tostring] = ACTIONS(65), + [anon_sym_return] = ACTIONS(65), + [anon_sym_call] = ACTIONS(65), + [anon_sym_use] = ACTIONS(65), + [anon_sym_extern] = ACTIONS(65), + [anon_sym_getfield] = ACTIONS(65), + [anon_sym_setfield] = ACTIONS(65), + [anon_sym_DOLLAR] = ACTIONS(97), + [anon_sym_AMP] = ACTIONS(99), + [anon_sym_PERCENT] = ACTIONS(101), + [anon_sym_BANG] = ACTIONS(103), + [anon_sym_DASH] = ACTIONS(105), + [sym_string] = ACTIONS(113), + [sym_int] = ACTIONS(115), + [sym_double] = ACTIONS(113), + [sym_char] = ACTIONS(113), + [anon_sym_true] = ACTIONS(111), + [anon_sym_false] = ACTIONS(111), + }, + [STATE(8)] = { + [sym__argument] = STATE(8), + [sym_value_reference] = STATE(8), + [sym_direct_reference] = STATE(8), + [sym_line_reference] = STATE(8), + [sym_function_reference] = STATE(8), + [sym_type_reference] = STATE(8), + [sym_bool] = STATE(8), + [aux_sym_instruction_repeat1] = STATE(8), + [sym_comment] = ACTIONS(3), + [anon_sym_AT] = ACTIONS(37), + [anon_sym_fun] = ACTIONS(37), + [anon_sym_struct] = ACTIONS(37), + [anon_sym_endstruct] = ACTIONS(37), + [anon_sym_if] = ACTIONS(37), + [anon_sym_jump] = ACTIONS(37), + [anon_sym_end] = ACTIONS(39), + [anon_sym_input] = ACTIONS(37), + [anon_sym_print] = ACTIONS(39), + [anon_sym_println] = ACTIONS(37), + [anon_sym_set] = ACTIONS(39), + [anon_sym_init] = ACTIONS(37), + [anon_sym_gettype] = ACTIONS(37), + [anon_sym_exists] = ACTIONS(37), + [anon_sym_setlist] = ACTIONS(39), + [anon_sym_setlistat] = ACTIONS(37), + [anon_sym_getlistat] = ACTIONS(37), + [anon_sym_getlistsize] = ACTIONS(37), + [anon_sym_listappend] = ACTIONS(37), + [anon_sym_getstrsize] = ACTIONS(37), + [anon_sym_getstrcharat] = ACTIONS(37), + [anon_sym_add] = ACTIONS(37), + [anon_sym_subtract] = ACTIONS(37), + [anon_sym_multiply] = ACTIONS(37), + [anon_sym_divide] = ACTIONS(37), + [anon_sym_equal] = ACTIONS(37), + [anon_sym_inequal] = ACTIONS(37), + [anon_sym_not] = ACTIONS(37), + [anon_sym_greater] = ACTIONS(37), + [anon_sym_lesser] = ACTIONS(37), + [anon_sym_stoi] = ACTIONS(37), + [anon_sym_stod] = ACTIONS(37), + [anon_sym_tostring] = ACTIONS(37), + [anon_sym_return] = ACTIONS(37), + [anon_sym_call] = ACTIONS(37), + [anon_sym_use] = ACTIONS(37), + [anon_sym_extern] = ACTIONS(37), + [anon_sym_getfield] = ACTIONS(37), + [anon_sym_setfield] = ACTIONS(37), + [anon_sym_DOLLAR] = ACTIONS(117), + [anon_sym_AMP] = ACTIONS(120), + [anon_sym_PERCENT] = ACTIONS(123), + [anon_sym_BANG] = ACTIONS(126), + [anon_sym_DASH] = ACTIONS(129), + [sym_string] = ACTIONS(132), + [sym_int] = ACTIONS(135), + [sym_double] = ACTIONS(132), + [sym_char] = ACTIONS(132), + [anon_sym_true] = ACTIONS(138), + [anon_sym_false] = ACTIONS(138), + }, + [STATE(9)] = { + [sym__argument] = STATE(10), + [sym_value_reference] = STATE(10), + [sym_direct_reference] = STATE(10), + [sym_line_reference] = STATE(10), + [sym_function_reference] = STATE(10), + [sym_type_reference] = STATE(10), + [sym_bool] = STATE(10), + [aux_sym_instruction_repeat1] = STATE(10), + [sym_comment] = ACTIONS(3), + [anon_sym_AT] = ACTIONS(17), + [anon_sym_fun] = ACTIONS(17), + [anon_sym_endfun] = ACTIONS(17), + [anon_sym_struct] = ACTIONS(17), + [anon_sym_if] = ACTIONS(17), + [anon_sym_jump] = ACTIONS(17), + [anon_sym_end] = ACTIONS(19), + [anon_sym_input] = ACTIONS(17), + [anon_sym_print] = ACTIONS(19), + [anon_sym_println] = ACTIONS(17), + [anon_sym_set] = ACTIONS(19), + [anon_sym_init] = ACTIONS(17), + [anon_sym_gettype] = ACTIONS(17), + [anon_sym_exists] = ACTIONS(17), + [anon_sym_setlist] = ACTIONS(19), + [anon_sym_setlistat] = ACTIONS(17), + [anon_sym_getlistat] = ACTIONS(17), + [anon_sym_getlistsize] = ACTIONS(17), + [anon_sym_listappend] = ACTIONS(17), + [anon_sym_getstrsize] = ACTIONS(17), + [anon_sym_getstrcharat] = ACTIONS(17), + [anon_sym_add] = ACTIONS(17), + [anon_sym_subtract] = ACTIONS(17), + [anon_sym_multiply] = ACTIONS(17), + [anon_sym_divide] = ACTIONS(17), + [anon_sym_equal] = ACTIONS(17), + [anon_sym_inequal] = ACTIONS(17), + [anon_sym_not] = ACTIONS(17), + [anon_sym_greater] = ACTIONS(17), + [anon_sym_lesser] = ACTIONS(17), + [anon_sym_stoi] = ACTIONS(17), + [anon_sym_stod] = ACTIONS(17), + [anon_sym_tostring] = ACTIONS(17), + [anon_sym_return] = ACTIONS(17), + [anon_sym_call] = ACTIONS(17), + [anon_sym_use] = ACTIONS(17), + [anon_sym_extern] = ACTIONS(17), + [anon_sym_getfield] = ACTIONS(17), + [anon_sym_setfield] = ACTIONS(17), + [anon_sym_DOLLAR] = ACTIONS(141), + [anon_sym_AMP] = ACTIONS(143), + [anon_sym_PERCENT] = ACTIONS(145), + [anon_sym_BANG] = ACTIONS(147), + [anon_sym_DASH] = ACTIONS(149), + [sym_string] = ACTIONS(151), + [sym_int] = ACTIONS(153), + [sym_double] = ACTIONS(151), + [sym_char] = ACTIONS(151), + [anon_sym_true] = ACTIONS(155), + [anon_sym_false] = ACTIONS(155), + }, + [STATE(10)] = { + [sym__argument] = STATE(3), + [sym_value_reference] = STATE(3), + [sym_direct_reference] = STATE(3), + [sym_line_reference] = STATE(3), + [sym_function_reference] = STATE(3), + [sym_type_reference] = STATE(3), + [sym_bool] = STATE(3), + [aux_sym_instruction_repeat1] = STATE(3), + [sym_comment] = ACTIONS(3), + [anon_sym_AT] = ACTIONS(65), + [anon_sym_fun] = ACTIONS(65), + [anon_sym_endfun] = ACTIONS(65), + [anon_sym_struct] = ACTIONS(65), + [anon_sym_if] = ACTIONS(65), + [anon_sym_jump] = ACTIONS(65), + [anon_sym_end] = ACTIONS(67), + [anon_sym_input] = ACTIONS(65), + [anon_sym_print] = ACTIONS(67), + [anon_sym_println] = ACTIONS(65), + [anon_sym_set] = ACTIONS(67), + [anon_sym_init] = ACTIONS(65), + [anon_sym_gettype] = ACTIONS(65), + [anon_sym_exists] = ACTIONS(65), + [anon_sym_setlist] = ACTIONS(67), + [anon_sym_setlistat] = ACTIONS(65), + [anon_sym_getlistat] = ACTIONS(65), + [anon_sym_getlistsize] = ACTIONS(65), + [anon_sym_listappend] = ACTIONS(65), + [anon_sym_getstrsize] = ACTIONS(65), + [anon_sym_getstrcharat] = ACTIONS(65), + [anon_sym_add] = ACTIONS(65), + [anon_sym_subtract] = ACTIONS(65), + [anon_sym_multiply] = ACTIONS(65), + [anon_sym_divide] = ACTIONS(65), + [anon_sym_equal] = ACTIONS(65), + [anon_sym_inequal] = ACTIONS(65), + [anon_sym_not] = ACTIONS(65), + [anon_sym_greater] = ACTIONS(65), + [anon_sym_lesser] = ACTIONS(65), + [anon_sym_stoi] = ACTIONS(65), + [anon_sym_stod] = ACTIONS(65), + [anon_sym_tostring] = ACTIONS(65), + [anon_sym_return] = ACTIONS(65), + [anon_sym_call] = ACTIONS(65), + [anon_sym_use] = ACTIONS(65), + [anon_sym_extern] = ACTIONS(65), + [anon_sym_getfield] = ACTIONS(65), + [anon_sym_setfield] = ACTIONS(65), + [anon_sym_DOLLAR] = ACTIONS(141), + [anon_sym_AMP] = ACTIONS(143), + [anon_sym_PERCENT] = ACTIONS(145), + [anon_sym_BANG] = ACTIONS(147), + [anon_sym_DASH] = ACTIONS(149), + [sym_string] = ACTIONS(157), + [sym_int] = ACTIONS(159), + [sym_double] = ACTIONS(157), + [sym_char] = ACTIONS(157), + [anon_sym_true] = ACTIONS(155), + [anon_sym_false] = ACTIONS(155), + }, + [STATE(11)] = { + [sym_comment] = ACTIONS(3), + [anon_sym_AT] = ACTIONS(161), + [anon_sym_fun] = ACTIONS(161), + [anon_sym_struct] = ACTIONS(161), + [anon_sym_endstruct] = ACTIONS(161), + [anon_sym_if] = ACTIONS(161), + [anon_sym_jump] = ACTIONS(161), + [anon_sym_end] = ACTIONS(163), + [anon_sym_input] = ACTIONS(161), + [anon_sym_print] = ACTIONS(163), + [anon_sym_println] = ACTIONS(161), + [anon_sym_set] = ACTIONS(163), + [anon_sym_init] = ACTIONS(161), + [anon_sym_gettype] = ACTIONS(161), + [anon_sym_exists] = ACTIONS(161), + [anon_sym_setlist] = ACTIONS(163), + [anon_sym_setlistat] = ACTIONS(161), + [anon_sym_getlistat] = ACTIONS(161), + [anon_sym_getlistsize] = ACTIONS(161), + [anon_sym_listappend] = ACTIONS(161), + [anon_sym_getstrsize] = ACTIONS(161), + [anon_sym_getstrcharat] = ACTIONS(161), + [anon_sym_add] = ACTIONS(161), + [anon_sym_subtract] = ACTIONS(161), + [anon_sym_multiply] = ACTIONS(161), + [anon_sym_divide] = ACTIONS(161), + [anon_sym_equal] = ACTIONS(161), + [anon_sym_inequal] = ACTIONS(161), + [anon_sym_not] = ACTIONS(161), + [anon_sym_greater] = ACTIONS(161), + [anon_sym_lesser] = ACTIONS(161), + [anon_sym_stoi] = ACTIONS(161), + [anon_sym_stod] = ACTIONS(161), + [anon_sym_tostring] = ACTIONS(161), + [anon_sym_return] = ACTIONS(161), + [anon_sym_call] = ACTIONS(161), + [anon_sym_use] = ACTIONS(161), + [anon_sym_extern] = ACTIONS(161), + [anon_sym_getfield] = ACTIONS(161), + [anon_sym_setfield] = ACTIONS(161), + [anon_sym_DOLLAR] = ACTIONS(161), + [anon_sym_AMP] = ACTIONS(161), + [anon_sym_PERCENT] = ACTIONS(161), + [anon_sym_BANG] = ACTIONS(161), + [anon_sym_DASH] = ACTIONS(163), + [sym_string] = ACTIONS(161), + [sym_int] = ACTIONS(163), + [sym_double] = ACTIONS(161), + [sym_char] = ACTIONS(161), + [anon_sym_true] = ACTIONS(161), + [anon_sym_false] = ACTIONS(161), + }, + [STATE(12)] = { + [ts_builtin_sym_end] = ACTIONS(165), + [sym_comment] = ACTIONS(3), + [anon_sym_AT] = ACTIONS(165), + [anon_sym_fun] = ACTIONS(165), + [anon_sym_struct] = ACTIONS(165), + [anon_sym_if] = ACTIONS(165), + [anon_sym_jump] = ACTIONS(165), + [anon_sym_end] = ACTIONS(165), + [anon_sym_input] = ACTIONS(165), + [anon_sym_print] = ACTIONS(167), + [anon_sym_println] = ACTIONS(165), + [anon_sym_set] = ACTIONS(167), + [anon_sym_init] = ACTIONS(165), + [anon_sym_gettype] = ACTIONS(165), + [anon_sym_exists] = ACTIONS(165), + [anon_sym_setlist] = ACTIONS(167), + [anon_sym_setlistat] = ACTIONS(165), + [anon_sym_getlistat] = ACTIONS(165), + [anon_sym_getlistsize] = ACTIONS(165), + [anon_sym_listappend] = ACTIONS(165), + [anon_sym_getstrsize] = ACTIONS(165), + [anon_sym_getstrcharat] = ACTIONS(165), + [anon_sym_add] = ACTIONS(165), + [anon_sym_subtract] = ACTIONS(165), + [anon_sym_multiply] = ACTIONS(165), + [anon_sym_divide] = ACTIONS(165), + [anon_sym_equal] = ACTIONS(165), + [anon_sym_inequal] = ACTIONS(165), + [anon_sym_not] = ACTIONS(165), + [anon_sym_greater] = ACTIONS(165), + [anon_sym_lesser] = ACTIONS(165), + [anon_sym_stoi] = ACTIONS(165), + [anon_sym_stod] = ACTIONS(165), + [anon_sym_tostring] = ACTIONS(165), + [anon_sym_return] = ACTIONS(165), + [anon_sym_call] = ACTIONS(165), + [anon_sym_use] = ACTIONS(165), + [anon_sym_extern] = ACTIONS(165), + [anon_sym_getfield] = ACTIONS(165), + [anon_sym_setfield] = ACTIONS(165), + [anon_sym_DOLLAR] = ACTIONS(165), + [anon_sym_AMP] = ACTIONS(165), + [anon_sym_PERCENT] = ACTIONS(165), + [anon_sym_BANG] = ACTIONS(165), + [anon_sym_DASH] = ACTIONS(167), + [sym_string] = ACTIONS(165), + [sym_int] = ACTIONS(167), + [sym_double] = ACTIONS(165), + [sym_char] = ACTIONS(165), + [anon_sym_true] = ACTIONS(165), + [anon_sym_false] = ACTIONS(165), + }, + [STATE(13)] = { + [ts_builtin_sym_end] = ACTIONS(169), + [sym_comment] = ACTIONS(3), + [anon_sym_AT] = ACTIONS(169), + [anon_sym_fun] = ACTIONS(169), + [anon_sym_struct] = ACTIONS(169), + [anon_sym_if] = ACTIONS(169), + [anon_sym_jump] = ACTIONS(169), + [anon_sym_end] = ACTIONS(169), + [anon_sym_input] = ACTIONS(169), + [anon_sym_print] = ACTIONS(171), + [anon_sym_println] = ACTIONS(169), + [anon_sym_set] = ACTIONS(171), + [anon_sym_init] = ACTIONS(169), + [anon_sym_gettype] = ACTIONS(169), + [anon_sym_exists] = ACTIONS(169), + [anon_sym_setlist] = ACTIONS(171), + [anon_sym_setlistat] = ACTIONS(169), + [anon_sym_getlistat] = ACTIONS(169), + [anon_sym_getlistsize] = ACTIONS(169), + [anon_sym_listappend] = ACTIONS(169), + [anon_sym_getstrsize] = ACTIONS(169), + [anon_sym_getstrcharat] = ACTIONS(169), + [anon_sym_add] = ACTIONS(169), + [anon_sym_subtract] = ACTIONS(169), + [anon_sym_multiply] = ACTIONS(169), + [anon_sym_divide] = ACTIONS(169), + [anon_sym_equal] = ACTIONS(169), + [anon_sym_inequal] = ACTIONS(169), + [anon_sym_not] = ACTIONS(169), + [anon_sym_greater] = ACTIONS(169), + [anon_sym_lesser] = ACTIONS(169), + [anon_sym_stoi] = ACTIONS(169), + [anon_sym_stod] = ACTIONS(169), + [anon_sym_tostring] = ACTIONS(169), + [anon_sym_return] = ACTIONS(169), + [anon_sym_call] = ACTIONS(169), + [anon_sym_use] = ACTIONS(169), + [anon_sym_extern] = ACTIONS(169), + [anon_sym_getfield] = ACTIONS(169), + [anon_sym_setfield] = ACTIONS(169), + [anon_sym_DOLLAR] = ACTIONS(169), + [anon_sym_AMP] = ACTIONS(169), + [anon_sym_PERCENT] = ACTIONS(169), + [anon_sym_BANG] = ACTIONS(169), + [anon_sym_DASH] = ACTIONS(171), + [sym_string] = ACTIONS(169), + [sym_int] = ACTIONS(171), + [sym_double] = ACTIONS(169), + [sym_char] = ACTIONS(169), + [anon_sym_true] = ACTIONS(169), + [anon_sym_false] = ACTIONS(169), + }, + [STATE(14)] = { + [sym_comment] = ACTIONS(3), + [anon_sym_AT] = ACTIONS(173), + [anon_sym_fun] = ACTIONS(173), + [anon_sym_struct] = ACTIONS(173), + [anon_sym_endstruct] = ACTIONS(173), + [anon_sym_if] = ACTIONS(173), + [anon_sym_jump] = ACTIONS(173), + [anon_sym_end] = ACTIONS(175), + [anon_sym_input] = ACTIONS(173), + [anon_sym_print] = ACTIONS(175), + [anon_sym_println] = ACTIONS(173), + [anon_sym_set] = ACTIONS(175), + [anon_sym_init] = ACTIONS(173), + [anon_sym_gettype] = ACTIONS(173), + [anon_sym_exists] = ACTIONS(173), + [anon_sym_setlist] = ACTIONS(175), + [anon_sym_setlistat] = ACTIONS(173), + [anon_sym_getlistat] = ACTIONS(173), + [anon_sym_getlistsize] = ACTIONS(173), + [anon_sym_listappend] = ACTIONS(173), + [anon_sym_getstrsize] = ACTIONS(173), + [anon_sym_getstrcharat] = ACTIONS(173), + [anon_sym_add] = ACTIONS(173), + [anon_sym_subtract] = ACTIONS(173), + [anon_sym_multiply] = ACTIONS(173), + [anon_sym_divide] = ACTIONS(173), + [anon_sym_equal] = ACTIONS(173), + [anon_sym_inequal] = ACTIONS(173), + [anon_sym_not] = ACTIONS(173), + [anon_sym_greater] = ACTIONS(173), + [anon_sym_lesser] = ACTIONS(173), + [anon_sym_stoi] = ACTIONS(173), + [anon_sym_stod] = ACTIONS(173), + [anon_sym_tostring] = ACTIONS(173), + [anon_sym_return] = ACTIONS(173), + [anon_sym_call] = ACTIONS(173), + [anon_sym_use] = ACTIONS(173), + [anon_sym_extern] = ACTIONS(173), + [anon_sym_getfield] = ACTIONS(173), + [anon_sym_setfield] = ACTIONS(173), + [anon_sym_DOLLAR] = ACTIONS(173), + [anon_sym_AMP] = ACTIONS(173), + [anon_sym_PERCENT] = ACTIONS(173), + [anon_sym_BANG] = ACTIONS(173), + [anon_sym_DASH] = ACTIONS(175), + [sym_string] = ACTIONS(173), + [sym_int] = ACTIONS(175), + [sym_double] = ACTIONS(173), + [sym_char] = ACTIONS(173), + [anon_sym_true] = ACTIONS(173), + [anon_sym_false] = ACTIONS(173), + }, + [STATE(15)] = { + [sym_comment] = ACTIONS(3), + [anon_sym_AT] = ACTIONS(165), + [anon_sym_fun] = ACTIONS(165), + [anon_sym_struct] = ACTIONS(165), + [anon_sym_endstruct] = ACTIONS(165), + [anon_sym_if] = ACTIONS(165), + [anon_sym_jump] = ACTIONS(165), + [anon_sym_end] = ACTIONS(167), + [anon_sym_input] = ACTIONS(165), + [anon_sym_print] = ACTIONS(167), + [anon_sym_println] = ACTIONS(165), + [anon_sym_set] = ACTIONS(167), + [anon_sym_init] = ACTIONS(165), + [anon_sym_gettype] = ACTIONS(165), + [anon_sym_exists] = ACTIONS(165), + [anon_sym_setlist] = ACTIONS(167), + [anon_sym_setlistat] = ACTIONS(165), + [anon_sym_getlistat] = ACTIONS(165), + [anon_sym_getlistsize] = ACTIONS(165), + [anon_sym_listappend] = ACTIONS(165), + [anon_sym_getstrsize] = ACTIONS(165), + [anon_sym_getstrcharat] = ACTIONS(165), + [anon_sym_add] = ACTIONS(165), + [anon_sym_subtract] = ACTIONS(165), + [anon_sym_multiply] = ACTIONS(165), + [anon_sym_divide] = ACTIONS(165), + [anon_sym_equal] = ACTIONS(165), + [anon_sym_inequal] = ACTIONS(165), + [anon_sym_not] = ACTIONS(165), + [anon_sym_greater] = ACTIONS(165), + [anon_sym_lesser] = ACTIONS(165), + [anon_sym_stoi] = ACTIONS(165), + [anon_sym_stod] = ACTIONS(165), + [anon_sym_tostring] = ACTIONS(165), + [anon_sym_return] = ACTIONS(165), + [anon_sym_call] = ACTIONS(165), + [anon_sym_use] = ACTIONS(165), + [anon_sym_extern] = ACTIONS(165), + [anon_sym_getfield] = ACTIONS(165), + [anon_sym_setfield] = ACTIONS(165), + [anon_sym_DOLLAR] = ACTIONS(165), + [anon_sym_AMP] = ACTIONS(165), + [anon_sym_PERCENT] = ACTIONS(165), + [anon_sym_BANG] = ACTIONS(165), + [anon_sym_DASH] = ACTIONS(167), + [sym_string] = ACTIONS(165), + [sym_int] = ACTIONS(167), + [sym_double] = ACTIONS(165), + [sym_char] = ACTIONS(165), + [anon_sym_true] = ACTIONS(165), + [anon_sym_false] = ACTIONS(165), + }, + [STATE(16)] = { + [ts_builtin_sym_end] = ACTIONS(161), + [sym_comment] = ACTIONS(3), + [anon_sym_AT] = ACTIONS(161), + [anon_sym_fun] = ACTIONS(161), + [anon_sym_struct] = ACTIONS(161), + [anon_sym_if] = ACTIONS(161), + [anon_sym_jump] = ACTIONS(161), + [anon_sym_end] = ACTIONS(161), + [anon_sym_input] = ACTIONS(161), + [anon_sym_print] = ACTIONS(163), + [anon_sym_println] = ACTIONS(161), + [anon_sym_set] = ACTIONS(163), + [anon_sym_init] = ACTIONS(161), + [anon_sym_gettype] = ACTIONS(161), + [anon_sym_exists] = ACTIONS(161), + [anon_sym_setlist] = ACTIONS(163), + [anon_sym_setlistat] = ACTIONS(161), + [anon_sym_getlistat] = ACTIONS(161), + [anon_sym_getlistsize] = ACTIONS(161), + [anon_sym_listappend] = ACTIONS(161), + [anon_sym_getstrsize] = ACTIONS(161), + [anon_sym_getstrcharat] = ACTIONS(161), + [anon_sym_add] = ACTIONS(161), + [anon_sym_subtract] = ACTIONS(161), + [anon_sym_multiply] = ACTIONS(161), + [anon_sym_divide] = ACTIONS(161), + [anon_sym_equal] = ACTIONS(161), + [anon_sym_inequal] = ACTIONS(161), + [anon_sym_not] = ACTIONS(161), + [anon_sym_greater] = ACTIONS(161), + [anon_sym_lesser] = ACTIONS(161), + [anon_sym_stoi] = ACTIONS(161), + [anon_sym_stod] = ACTIONS(161), + [anon_sym_tostring] = ACTIONS(161), + [anon_sym_return] = ACTIONS(161), + [anon_sym_call] = ACTIONS(161), + [anon_sym_use] = ACTIONS(161), + [anon_sym_extern] = ACTIONS(161), + [anon_sym_getfield] = ACTIONS(161), + [anon_sym_setfield] = ACTIONS(161), + [anon_sym_DOLLAR] = ACTIONS(161), + [anon_sym_AMP] = ACTIONS(161), + [anon_sym_PERCENT] = ACTIONS(161), + [anon_sym_BANG] = ACTIONS(161), + [anon_sym_DASH] = ACTIONS(163), + [sym_string] = ACTIONS(161), + [sym_int] = ACTIONS(163), + [sym_double] = ACTIONS(161), + [sym_char] = ACTIONS(161), + [anon_sym_true] = ACTIONS(161), + [anon_sym_false] = ACTIONS(161), + }, + [STATE(17)] = { + [sym_comment] = ACTIONS(3), + [anon_sym_AT] = ACTIONS(169), + [anon_sym_fun] = ACTIONS(169), + [anon_sym_struct] = ACTIONS(169), + [anon_sym_endstruct] = ACTIONS(169), + [anon_sym_if] = ACTIONS(169), + [anon_sym_jump] = ACTIONS(169), + [anon_sym_end] = ACTIONS(171), + [anon_sym_input] = ACTIONS(169), + [anon_sym_print] = ACTIONS(171), + [anon_sym_println] = ACTIONS(169), + [anon_sym_set] = ACTIONS(171), + [anon_sym_init] = ACTIONS(169), + [anon_sym_gettype] = ACTIONS(169), + [anon_sym_exists] = ACTIONS(169), + [anon_sym_setlist] = ACTIONS(171), + [anon_sym_setlistat] = ACTIONS(169), + [anon_sym_getlistat] = ACTIONS(169), + [anon_sym_getlistsize] = ACTIONS(169), + [anon_sym_listappend] = ACTIONS(169), + [anon_sym_getstrsize] = ACTIONS(169), + [anon_sym_getstrcharat] = ACTIONS(169), + [anon_sym_add] = ACTIONS(169), + [anon_sym_subtract] = ACTIONS(169), + [anon_sym_multiply] = ACTIONS(169), + [anon_sym_divide] = ACTIONS(169), + [anon_sym_equal] = ACTIONS(169), + [anon_sym_inequal] = ACTIONS(169), + [anon_sym_not] = ACTIONS(169), + [anon_sym_greater] = ACTIONS(169), + [anon_sym_lesser] = ACTIONS(169), + [anon_sym_stoi] = ACTIONS(169), + [anon_sym_stod] = ACTIONS(169), + [anon_sym_tostring] = ACTIONS(169), + [anon_sym_return] = ACTIONS(169), + [anon_sym_call] = ACTIONS(169), + [anon_sym_use] = ACTIONS(169), + [anon_sym_extern] = ACTIONS(169), + [anon_sym_getfield] = ACTIONS(169), + [anon_sym_setfield] = ACTIONS(169), + [anon_sym_DOLLAR] = ACTIONS(169), + [anon_sym_AMP] = ACTIONS(169), + [anon_sym_PERCENT] = ACTIONS(169), + [anon_sym_BANG] = ACTIONS(169), + [anon_sym_DASH] = ACTIONS(171), + [sym_string] = ACTIONS(169), + [sym_int] = ACTIONS(171), + [sym_double] = ACTIONS(169), + [sym_char] = ACTIONS(169), + [anon_sym_true] = ACTIONS(169), + [anon_sym_false] = ACTIONS(169), + }, + [STATE(18)] = { + [ts_builtin_sym_end] = ACTIONS(177), + [sym_comment] = ACTIONS(3), + [anon_sym_AT] = ACTIONS(177), + [anon_sym_fun] = ACTIONS(177), + [anon_sym_struct] = ACTIONS(177), + [anon_sym_if] = ACTIONS(177), + [anon_sym_jump] = ACTIONS(177), + [anon_sym_end] = ACTIONS(177), + [anon_sym_input] = ACTIONS(177), + [anon_sym_print] = ACTIONS(179), + [anon_sym_println] = ACTIONS(177), + [anon_sym_set] = ACTIONS(179), + [anon_sym_init] = ACTIONS(177), + [anon_sym_gettype] = ACTIONS(177), + [anon_sym_exists] = ACTIONS(177), + [anon_sym_setlist] = ACTIONS(179), + [anon_sym_setlistat] = ACTIONS(177), + [anon_sym_getlistat] = ACTIONS(177), + [anon_sym_getlistsize] = ACTIONS(177), + [anon_sym_listappend] = ACTIONS(177), + [anon_sym_getstrsize] = ACTIONS(177), + [anon_sym_getstrcharat] = ACTIONS(177), + [anon_sym_add] = ACTIONS(177), + [anon_sym_subtract] = ACTIONS(177), + [anon_sym_multiply] = ACTIONS(177), + [anon_sym_divide] = ACTIONS(177), + [anon_sym_equal] = ACTIONS(177), + [anon_sym_inequal] = ACTIONS(177), + [anon_sym_not] = ACTIONS(177), + [anon_sym_greater] = ACTIONS(177), + [anon_sym_lesser] = ACTIONS(177), + [anon_sym_stoi] = ACTIONS(177), + [anon_sym_stod] = ACTIONS(177), + [anon_sym_tostring] = ACTIONS(177), + [anon_sym_return] = ACTIONS(177), + [anon_sym_call] = ACTIONS(177), + [anon_sym_use] = ACTIONS(177), + [anon_sym_extern] = ACTIONS(177), + [anon_sym_getfield] = ACTIONS(177), + [anon_sym_setfield] = ACTIONS(177), + [anon_sym_DOLLAR] = ACTIONS(177), + [anon_sym_AMP] = ACTIONS(177), + [anon_sym_PERCENT] = ACTIONS(177), + [anon_sym_BANG] = ACTIONS(177), + [anon_sym_DASH] = ACTIONS(179), + [sym_string] = ACTIONS(177), + [sym_int] = ACTIONS(179), + [sym_double] = ACTIONS(177), + [sym_char] = ACTIONS(177), + [anon_sym_true] = ACTIONS(177), + [anon_sym_false] = ACTIONS(177), + }, + [STATE(19)] = { + [sym_comment] = ACTIONS(3), + [anon_sym_AT] = ACTIONS(181), + [anon_sym_fun] = ACTIONS(181), + [anon_sym_struct] = ACTIONS(181), + [anon_sym_endstruct] = ACTIONS(181), + [anon_sym_if] = ACTIONS(181), + [anon_sym_jump] = ACTIONS(181), + [anon_sym_end] = ACTIONS(183), + [anon_sym_input] = ACTIONS(181), + [anon_sym_print] = ACTIONS(183), + [anon_sym_println] = ACTIONS(181), + [anon_sym_set] = ACTIONS(183), + [anon_sym_init] = ACTIONS(181), + [anon_sym_gettype] = ACTIONS(181), + [anon_sym_exists] = ACTIONS(181), + [anon_sym_setlist] = ACTIONS(183), + [anon_sym_setlistat] = ACTIONS(181), + [anon_sym_getlistat] = ACTIONS(181), + [anon_sym_getlistsize] = ACTIONS(181), + [anon_sym_listappend] = ACTIONS(181), + [anon_sym_getstrsize] = ACTIONS(181), + [anon_sym_getstrcharat] = ACTIONS(181), + [anon_sym_add] = ACTIONS(181), + [anon_sym_subtract] = ACTIONS(181), + [anon_sym_multiply] = ACTIONS(181), + [anon_sym_divide] = ACTIONS(181), + [anon_sym_equal] = ACTIONS(181), + [anon_sym_inequal] = ACTIONS(181), + [anon_sym_not] = ACTIONS(181), + [anon_sym_greater] = ACTIONS(181), + [anon_sym_lesser] = ACTIONS(181), + [anon_sym_stoi] = ACTIONS(181), + [anon_sym_stod] = ACTIONS(181), + [anon_sym_tostring] = ACTIONS(181), + [anon_sym_return] = ACTIONS(181), + [anon_sym_call] = ACTIONS(181), + [anon_sym_use] = ACTIONS(181), + [anon_sym_extern] = ACTIONS(181), + [anon_sym_getfield] = ACTIONS(181), + [anon_sym_setfield] = ACTIONS(181), + [anon_sym_DOLLAR] = ACTIONS(181), + [anon_sym_AMP] = ACTIONS(181), + [anon_sym_PERCENT] = ACTIONS(181), + [anon_sym_BANG] = ACTIONS(181), + [anon_sym_DASH] = ACTIONS(183), + [sym_string] = ACTIONS(181), + [sym_int] = ACTIONS(183), + [sym_double] = ACTIONS(181), + [sym_char] = ACTIONS(181), + [anon_sym_true] = ACTIONS(181), + [anon_sym_false] = ACTIONS(181), + }, + [STATE(20)] = { + [sym_comment] = ACTIONS(3), + [anon_sym_AT] = ACTIONS(185), + [anon_sym_fun] = ACTIONS(185), + [anon_sym_struct] = ACTIONS(185), + [anon_sym_endstruct] = ACTIONS(185), + [anon_sym_if] = ACTIONS(185), + [anon_sym_jump] = ACTIONS(185), + [anon_sym_end] = ACTIONS(187), + [anon_sym_input] = ACTIONS(185), + [anon_sym_print] = ACTIONS(187), + [anon_sym_println] = ACTIONS(185), + [anon_sym_set] = ACTIONS(187), + [anon_sym_init] = ACTIONS(185), + [anon_sym_gettype] = ACTIONS(185), + [anon_sym_exists] = ACTIONS(185), + [anon_sym_setlist] = ACTIONS(187), + [anon_sym_setlistat] = ACTIONS(185), + [anon_sym_getlistat] = ACTIONS(185), + [anon_sym_getlistsize] = ACTIONS(185), + [anon_sym_listappend] = ACTIONS(185), + [anon_sym_getstrsize] = ACTIONS(185), + [anon_sym_getstrcharat] = ACTIONS(185), + [anon_sym_add] = ACTIONS(185), + [anon_sym_subtract] = ACTIONS(185), + [anon_sym_multiply] = ACTIONS(185), + [anon_sym_divide] = ACTIONS(185), + [anon_sym_equal] = ACTIONS(185), + [anon_sym_inequal] = ACTIONS(185), + [anon_sym_not] = ACTIONS(185), + [anon_sym_greater] = ACTIONS(185), + [anon_sym_lesser] = ACTIONS(185), + [anon_sym_stoi] = ACTIONS(185), + [anon_sym_stod] = ACTIONS(185), + [anon_sym_tostring] = ACTIONS(185), + [anon_sym_return] = ACTIONS(185), + [anon_sym_call] = ACTIONS(185), + [anon_sym_use] = ACTIONS(185), + [anon_sym_extern] = ACTIONS(185), + [anon_sym_getfield] = ACTIONS(185), + [anon_sym_setfield] = ACTIONS(185), + [anon_sym_DOLLAR] = ACTIONS(185), + [anon_sym_AMP] = ACTIONS(185), + [anon_sym_PERCENT] = ACTIONS(185), + [anon_sym_BANG] = ACTIONS(185), + [anon_sym_DASH] = ACTIONS(187), + [sym_string] = ACTIONS(185), + [sym_int] = ACTIONS(187), + [sym_double] = ACTIONS(185), + [sym_char] = ACTIONS(185), + [anon_sym_true] = ACTIONS(185), + [anon_sym_false] = ACTIONS(185), + }, + [STATE(21)] = { + [sym_comment] = ACTIONS(3), + [anon_sym_AT] = ACTIONS(177), + [anon_sym_fun] = ACTIONS(177), + [anon_sym_struct] = ACTIONS(177), + [anon_sym_endstruct] = ACTIONS(177), + [anon_sym_if] = ACTIONS(177), + [anon_sym_jump] = ACTIONS(177), + [anon_sym_end] = ACTIONS(179), + [anon_sym_input] = ACTIONS(177), + [anon_sym_print] = ACTIONS(179), + [anon_sym_println] = ACTIONS(177), + [anon_sym_set] = ACTIONS(179), + [anon_sym_init] = ACTIONS(177), + [anon_sym_gettype] = ACTIONS(177), + [anon_sym_exists] = ACTIONS(177), + [anon_sym_setlist] = ACTIONS(179), + [anon_sym_setlistat] = ACTIONS(177), + [anon_sym_getlistat] = ACTIONS(177), + [anon_sym_getlistsize] = ACTIONS(177), + [anon_sym_listappend] = ACTIONS(177), + [anon_sym_getstrsize] = ACTIONS(177), + [anon_sym_getstrcharat] = ACTIONS(177), + [anon_sym_add] = ACTIONS(177), + [anon_sym_subtract] = ACTIONS(177), + [anon_sym_multiply] = ACTIONS(177), + [anon_sym_divide] = ACTIONS(177), + [anon_sym_equal] = ACTIONS(177), + [anon_sym_inequal] = ACTIONS(177), + [anon_sym_not] = ACTIONS(177), + [anon_sym_greater] = ACTIONS(177), + [anon_sym_lesser] = ACTIONS(177), + [anon_sym_stoi] = ACTIONS(177), + [anon_sym_stod] = ACTIONS(177), + [anon_sym_tostring] = ACTIONS(177), + [anon_sym_return] = ACTIONS(177), + [anon_sym_call] = ACTIONS(177), + [anon_sym_use] = ACTIONS(177), + [anon_sym_extern] = ACTIONS(177), + [anon_sym_getfield] = ACTIONS(177), + [anon_sym_setfield] = ACTIONS(177), + [anon_sym_DOLLAR] = ACTIONS(177), + [anon_sym_AMP] = ACTIONS(177), + [anon_sym_PERCENT] = ACTIONS(177), + [anon_sym_BANG] = ACTIONS(177), + [anon_sym_DASH] = ACTIONS(179), + [sym_string] = ACTIONS(177), + [sym_int] = ACTIONS(179), + [sym_double] = ACTIONS(177), + [sym_char] = ACTIONS(177), + [anon_sym_true] = ACTIONS(177), + [anon_sym_false] = ACTIONS(177), + }, + [STATE(22)] = { + [sym_comment] = ACTIONS(3), + [anon_sym_AT] = ACTIONS(165), + [anon_sym_fun] = ACTIONS(165), + [anon_sym_endfun] = ACTIONS(165), + [anon_sym_struct] = ACTIONS(165), + [anon_sym_if] = ACTIONS(165), + [anon_sym_jump] = ACTIONS(165), + [anon_sym_end] = ACTIONS(167), + [anon_sym_input] = ACTIONS(165), + [anon_sym_print] = ACTIONS(167), + [anon_sym_println] = ACTIONS(165), + [anon_sym_set] = ACTIONS(167), + [anon_sym_init] = ACTIONS(165), + [anon_sym_gettype] = ACTIONS(165), + [anon_sym_exists] = ACTIONS(165), + [anon_sym_setlist] = ACTIONS(167), + [anon_sym_setlistat] = ACTIONS(165), + [anon_sym_getlistat] = ACTIONS(165), + [anon_sym_getlistsize] = ACTIONS(165), + [anon_sym_listappend] = ACTIONS(165), + [anon_sym_getstrsize] = ACTIONS(165), + [anon_sym_getstrcharat] = ACTIONS(165), + [anon_sym_add] = ACTIONS(165), + [anon_sym_subtract] = ACTIONS(165), + [anon_sym_multiply] = ACTIONS(165), + [anon_sym_divide] = ACTIONS(165), + [anon_sym_equal] = ACTIONS(165), + [anon_sym_inequal] = ACTIONS(165), + [anon_sym_not] = ACTIONS(165), + [anon_sym_greater] = ACTIONS(165), + [anon_sym_lesser] = ACTIONS(165), + [anon_sym_stoi] = ACTIONS(165), + [anon_sym_stod] = ACTIONS(165), + [anon_sym_tostring] = ACTIONS(165), + [anon_sym_return] = ACTIONS(165), + [anon_sym_call] = ACTIONS(165), + [anon_sym_use] = ACTIONS(165), + [anon_sym_extern] = ACTIONS(165), + [anon_sym_getfield] = ACTIONS(165), + [anon_sym_setfield] = ACTIONS(165), + [anon_sym_DOLLAR] = ACTIONS(165), + [anon_sym_AMP] = ACTIONS(165), + [anon_sym_PERCENT] = ACTIONS(165), + [anon_sym_BANG] = ACTIONS(165), + [anon_sym_DASH] = ACTIONS(167), + [sym_string] = ACTIONS(165), + [sym_int] = ACTIONS(167), + [sym_double] = ACTIONS(165), + [sym_char] = ACTIONS(165), + [anon_sym_true] = ACTIONS(165), + [anon_sym_false] = ACTIONS(165), + }, + [STATE(23)] = { + [ts_builtin_sym_end] = ACTIONS(173), + [sym_comment] = ACTIONS(3), + [anon_sym_AT] = ACTIONS(173), + [anon_sym_fun] = ACTIONS(173), + [anon_sym_struct] = ACTIONS(173), + [anon_sym_if] = ACTIONS(173), + [anon_sym_jump] = ACTIONS(173), + [anon_sym_end] = ACTIONS(173), + [anon_sym_input] = ACTIONS(173), + [anon_sym_print] = ACTIONS(175), + [anon_sym_println] = ACTIONS(173), + [anon_sym_set] = ACTIONS(175), + [anon_sym_init] = ACTIONS(173), + [anon_sym_gettype] = ACTIONS(173), + [anon_sym_exists] = ACTIONS(173), + [anon_sym_setlist] = ACTIONS(175), + [anon_sym_setlistat] = ACTIONS(173), + [anon_sym_getlistat] = ACTIONS(173), + [anon_sym_getlistsize] = ACTIONS(173), + [anon_sym_listappend] = ACTIONS(173), + [anon_sym_getstrsize] = ACTIONS(173), + [anon_sym_getstrcharat] = ACTIONS(173), + [anon_sym_add] = ACTIONS(173), + [anon_sym_subtract] = ACTIONS(173), + [anon_sym_multiply] = ACTIONS(173), + [anon_sym_divide] = ACTIONS(173), + [anon_sym_equal] = ACTIONS(173), + [anon_sym_inequal] = ACTIONS(173), + [anon_sym_not] = ACTIONS(173), + [anon_sym_greater] = ACTIONS(173), + [anon_sym_lesser] = ACTIONS(173), + [anon_sym_stoi] = ACTIONS(173), + [anon_sym_stod] = ACTIONS(173), + [anon_sym_tostring] = ACTIONS(173), + [anon_sym_return] = ACTIONS(173), + [anon_sym_call] = ACTIONS(173), + [anon_sym_use] = ACTIONS(173), + [anon_sym_extern] = ACTIONS(173), + [anon_sym_getfield] = ACTIONS(173), + [anon_sym_setfield] = ACTIONS(173), + [anon_sym_DOLLAR] = ACTIONS(173), + [anon_sym_AMP] = ACTIONS(173), + [anon_sym_PERCENT] = ACTIONS(173), + [anon_sym_BANG] = ACTIONS(173), + [anon_sym_DASH] = ACTIONS(175), + [sym_string] = ACTIONS(173), + [sym_int] = ACTIONS(175), + [sym_double] = ACTIONS(173), + [sym_char] = ACTIONS(173), + [anon_sym_true] = ACTIONS(173), + [anon_sym_false] = ACTIONS(173), + }, + [STATE(24)] = { + [sym_comment] = ACTIONS(3), + [anon_sym_AT] = ACTIONS(169), + [anon_sym_fun] = ACTIONS(169), + [anon_sym_endfun] = ACTIONS(169), + [anon_sym_struct] = ACTIONS(169), + [anon_sym_if] = ACTIONS(169), + [anon_sym_jump] = ACTIONS(169), + [anon_sym_end] = ACTIONS(171), + [anon_sym_input] = ACTIONS(169), + [anon_sym_print] = ACTIONS(171), + [anon_sym_println] = ACTIONS(169), + [anon_sym_set] = ACTIONS(171), + [anon_sym_init] = ACTIONS(169), + [anon_sym_gettype] = ACTIONS(169), + [anon_sym_exists] = ACTIONS(169), + [anon_sym_setlist] = ACTIONS(171), + [anon_sym_setlistat] = ACTIONS(169), + [anon_sym_getlistat] = ACTIONS(169), + [anon_sym_getlistsize] = ACTIONS(169), + [anon_sym_listappend] = ACTIONS(169), + [anon_sym_getstrsize] = ACTIONS(169), + [anon_sym_getstrcharat] = ACTIONS(169), + [anon_sym_add] = ACTIONS(169), + [anon_sym_subtract] = ACTIONS(169), + [anon_sym_multiply] = ACTIONS(169), + [anon_sym_divide] = ACTIONS(169), + [anon_sym_equal] = ACTIONS(169), + [anon_sym_inequal] = ACTIONS(169), + [anon_sym_not] = ACTIONS(169), + [anon_sym_greater] = ACTIONS(169), + [anon_sym_lesser] = ACTIONS(169), + [anon_sym_stoi] = ACTIONS(169), + [anon_sym_stod] = ACTIONS(169), + [anon_sym_tostring] = ACTIONS(169), + [anon_sym_return] = ACTIONS(169), + [anon_sym_call] = ACTIONS(169), + [anon_sym_use] = ACTIONS(169), + [anon_sym_extern] = ACTIONS(169), + [anon_sym_getfield] = ACTIONS(169), + [anon_sym_setfield] = ACTIONS(169), + [anon_sym_DOLLAR] = ACTIONS(169), + [anon_sym_AMP] = ACTIONS(169), + [anon_sym_PERCENT] = ACTIONS(169), + [anon_sym_BANG] = ACTIONS(169), + [anon_sym_DASH] = ACTIONS(171), + [sym_string] = ACTIONS(169), + [sym_int] = ACTIONS(171), + [sym_double] = ACTIONS(169), + [sym_char] = ACTIONS(169), + [anon_sym_true] = ACTIONS(169), + [anon_sym_false] = ACTIONS(169), + }, + [STATE(25)] = { + [ts_builtin_sym_end] = ACTIONS(181), + [sym_comment] = ACTIONS(3), + [anon_sym_AT] = ACTIONS(181), + [anon_sym_fun] = ACTIONS(181), + [anon_sym_struct] = ACTIONS(181), + [anon_sym_if] = ACTIONS(181), + [anon_sym_jump] = ACTIONS(181), + [anon_sym_end] = ACTIONS(181), + [anon_sym_input] = ACTIONS(181), + [anon_sym_print] = ACTIONS(183), + [anon_sym_println] = ACTIONS(181), + [anon_sym_set] = ACTIONS(183), + [anon_sym_init] = ACTIONS(181), + [anon_sym_gettype] = ACTIONS(181), + [anon_sym_exists] = ACTIONS(181), + [anon_sym_setlist] = ACTIONS(183), + [anon_sym_setlistat] = ACTIONS(181), + [anon_sym_getlistat] = ACTIONS(181), + [anon_sym_getlistsize] = ACTIONS(181), + [anon_sym_listappend] = ACTIONS(181), + [anon_sym_getstrsize] = ACTIONS(181), + [anon_sym_getstrcharat] = ACTIONS(181), + [anon_sym_add] = ACTIONS(181), + [anon_sym_subtract] = ACTIONS(181), + [anon_sym_multiply] = ACTIONS(181), + [anon_sym_divide] = ACTIONS(181), + [anon_sym_equal] = ACTIONS(181), + [anon_sym_inequal] = ACTIONS(181), + [anon_sym_not] = ACTIONS(181), + [anon_sym_greater] = ACTIONS(181), + [anon_sym_lesser] = ACTIONS(181), + [anon_sym_stoi] = ACTIONS(181), + [anon_sym_stod] = ACTIONS(181), + [anon_sym_tostring] = ACTIONS(181), + [anon_sym_return] = ACTIONS(181), + [anon_sym_call] = ACTIONS(181), + [anon_sym_use] = ACTIONS(181), + [anon_sym_extern] = ACTIONS(181), + [anon_sym_getfield] = ACTIONS(181), + [anon_sym_setfield] = ACTIONS(181), + [anon_sym_DOLLAR] = ACTIONS(181), + [anon_sym_AMP] = ACTIONS(181), + [anon_sym_PERCENT] = ACTIONS(181), + [anon_sym_BANG] = ACTIONS(181), + [anon_sym_DASH] = ACTIONS(183), + [sym_string] = ACTIONS(181), + [sym_int] = ACTIONS(183), + [sym_double] = ACTIONS(181), + [sym_char] = ACTIONS(181), + [anon_sym_true] = ACTIONS(181), + [anon_sym_false] = ACTIONS(181), + }, + [STATE(26)] = { + [sym_comment] = ACTIONS(3), + [anon_sym_AT] = ACTIONS(161), + [anon_sym_fun] = ACTIONS(161), + [anon_sym_endfun] = ACTIONS(161), + [anon_sym_struct] = ACTIONS(161), + [anon_sym_if] = ACTIONS(161), + [anon_sym_jump] = ACTIONS(161), + [anon_sym_end] = ACTIONS(163), + [anon_sym_input] = ACTIONS(161), + [anon_sym_print] = ACTIONS(163), + [anon_sym_println] = ACTIONS(161), + [anon_sym_set] = ACTIONS(163), + [anon_sym_init] = ACTIONS(161), + [anon_sym_gettype] = ACTIONS(161), + [anon_sym_exists] = ACTIONS(161), + [anon_sym_setlist] = ACTIONS(163), + [anon_sym_setlistat] = ACTIONS(161), + [anon_sym_getlistat] = ACTIONS(161), + [anon_sym_getlistsize] = ACTIONS(161), + [anon_sym_listappend] = ACTIONS(161), + [anon_sym_getstrsize] = ACTIONS(161), + [anon_sym_getstrcharat] = ACTIONS(161), + [anon_sym_add] = ACTIONS(161), + [anon_sym_subtract] = ACTIONS(161), + [anon_sym_multiply] = ACTIONS(161), + [anon_sym_divide] = ACTIONS(161), + [anon_sym_equal] = ACTIONS(161), + [anon_sym_inequal] = ACTIONS(161), + [anon_sym_not] = ACTIONS(161), + [anon_sym_greater] = ACTIONS(161), + [anon_sym_lesser] = ACTIONS(161), + [anon_sym_stoi] = ACTIONS(161), + [anon_sym_stod] = ACTIONS(161), + [anon_sym_tostring] = ACTIONS(161), + [anon_sym_return] = ACTIONS(161), + [anon_sym_call] = ACTIONS(161), + [anon_sym_use] = ACTIONS(161), + [anon_sym_extern] = ACTIONS(161), + [anon_sym_getfield] = ACTIONS(161), + [anon_sym_setfield] = ACTIONS(161), + [anon_sym_DOLLAR] = ACTIONS(161), + [anon_sym_AMP] = ACTIONS(161), + [anon_sym_PERCENT] = ACTIONS(161), + [anon_sym_BANG] = ACTIONS(161), + [anon_sym_DASH] = ACTIONS(163), + [sym_string] = ACTIONS(161), + [sym_int] = ACTIONS(163), + [sym_double] = ACTIONS(161), + [sym_char] = ACTIONS(161), + [anon_sym_true] = ACTIONS(161), + [anon_sym_false] = ACTIONS(161), + }, + [STATE(27)] = { + [sym_comment] = ACTIONS(3), + [anon_sym_AT] = ACTIONS(177), + [anon_sym_fun] = ACTIONS(177), + [anon_sym_endfun] = ACTIONS(177), + [anon_sym_struct] = ACTIONS(177), + [anon_sym_if] = ACTIONS(177), + [anon_sym_jump] = ACTIONS(177), + [anon_sym_end] = ACTIONS(179), + [anon_sym_input] = ACTIONS(177), + [anon_sym_print] = ACTIONS(179), + [anon_sym_println] = ACTIONS(177), + [anon_sym_set] = ACTIONS(179), + [anon_sym_init] = ACTIONS(177), + [anon_sym_gettype] = ACTIONS(177), + [anon_sym_exists] = ACTIONS(177), + [anon_sym_setlist] = ACTIONS(179), + [anon_sym_setlistat] = ACTIONS(177), + [anon_sym_getlistat] = ACTIONS(177), + [anon_sym_getlistsize] = ACTIONS(177), + [anon_sym_listappend] = ACTIONS(177), + [anon_sym_getstrsize] = ACTIONS(177), + [anon_sym_getstrcharat] = ACTIONS(177), + [anon_sym_add] = ACTIONS(177), + [anon_sym_subtract] = ACTIONS(177), + [anon_sym_multiply] = ACTIONS(177), + [anon_sym_divide] = ACTIONS(177), + [anon_sym_equal] = ACTIONS(177), + [anon_sym_inequal] = ACTIONS(177), + [anon_sym_not] = ACTIONS(177), + [anon_sym_greater] = ACTIONS(177), + [anon_sym_lesser] = ACTIONS(177), + [anon_sym_stoi] = ACTIONS(177), + [anon_sym_stod] = ACTIONS(177), + [anon_sym_tostring] = ACTIONS(177), + [anon_sym_return] = ACTIONS(177), + [anon_sym_call] = ACTIONS(177), + [anon_sym_use] = ACTIONS(177), + [anon_sym_extern] = ACTIONS(177), + [anon_sym_getfield] = ACTIONS(177), + [anon_sym_setfield] = ACTIONS(177), + [anon_sym_DOLLAR] = ACTIONS(177), + [anon_sym_AMP] = ACTIONS(177), + [anon_sym_PERCENT] = ACTIONS(177), + [anon_sym_BANG] = ACTIONS(177), + [anon_sym_DASH] = ACTIONS(179), + [sym_string] = ACTIONS(177), + [sym_int] = ACTIONS(179), + [sym_double] = ACTIONS(177), + [sym_char] = ACTIONS(177), + [anon_sym_true] = ACTIONS(177), + [anon_sym_false] = ACTIONS(177), + }, + [STATE(28)] = { + [sym_comment] = ACTIONS(3), + [anon_sym_AT] = ACTIONS(173), + [anon_sym_fun] = ACTIONS(173), + [anon_sym_endfun] = ACTIONS(173), + [anon_sym_struct] = ACTIONS(173), + [anon_sym_if] = ACTIONS(173), + [anon_sym_jump] = ACTIONS(173), + [anon_sym_end] = ACTIONS(175), + [anon_sym_input] = ACTIONS(173), + [anon_sym_print] = ACTIONS(175), + [anon_sym_println] = ACTIONS(173), + [anon_sym_set] = ACTIONS(175), + [anon_sym_init] = ACTIONS(173), + [anon_sym_gettype] = ACTIONS(173), + [anon_sym_exists] = ACTIONS(173), + [anon_sym_setlist] = ACTIONS(175), + [anon_sym_setlistat] = ACTIONS(173), + [anon_sym_getlistat] = ACTIONS(173), + [anon_sym_getlistsize] = ACTIONS(173), + [anon_sym_listappend] = ACTIONS(173), + [anon_sym_getstrsize] = ACTIONS(173), + [anon_sym_getstrcharat] = ACTIONS(173), + [anon_sym_add] = ACTIONS(173), + [anon_sym_subtract] = ACTIONS(173), + [anon_sym_multiply] = ACTIONS(173), + [anon_sym_divide] = ACTIONS(173), + [anon_sym_equal] = ACTIONS(173), + [anon_sym_inequal] = ACTIONS(173), + [anon_sym_not] = ACTIONS(173), + [anon_sym_greater] = ACTIONS(173), + [anon_sym_lesser] = ACTIONS(173), + [anon_sym_stoi] = ACTIONS(173), + [anon_sym_stod] = ACTIONS(173), + [anon_sym_tostring] = ACTIONS(173), + [anon_sym_return] = ACTIONS(173), + [anon_sym_call] = ACTIONS(173), + [anon_sym_use] = ACTIONS(173), + [anon_sym_extern] = ACTIONS(173), + [anon_sym_getfield] = ACTIONS(173), + [anon_sym_setfield] = ACTIONS(173), + [anon_sym_DOLLAR] = ACTIONS(173), + [anon_sym_AMP] = ACTIONS(173), + [anon_sym_PERCENT] = ACTIONS(173), + [anon_sym_BANG] = ACTIONS(173), + [anon_sym_DASH] = ACTIONS(175), + [sym_string] = ACTIONS(173), + [sym_int] = ACTIONS(175), + [sym_double] = ACTIONS(173), + [sym_char] = ACTIONS(173), + [anon_sym_true] = ACTIONS(173), + [anon_sym_false] = ACTIONS(173), + }, + [STATE(29)] = { + [sym_comment] = ACTIONS(3), + [anon_sym_AT] = ACTIONS(181), + [anon_sym_fun] = ACTIONS(181), + [anon_sym_endfun] = ACTIONS(181), + [anon_sym_struct] = ACTIONS(181), + [anon_sym_if] = ACTIONS(181), + [anon_sym_jump] = ACTIONS(181), + [anon_sym_end] = ACTIONS(183), + [anon_sym_input] = ACTIONS(181), + [anon_sym_print] = ACTIONS(183), + [anon_sym_println] = ACTIONS(181), + [anon_sym_set] = ACTIONS(183), + [anon_sym_init] = ACTIONS(181), + [anon_sym_gettype] = ACTIONS(181), + [anon_sym_exists] = ACTIONS(181), + [anon_sym_setlist] = ACTIONS(183), + [anon_sym_setlistat] = ACTIONS(181), + [anon_sym_getlistat] = ACTIONS(181), + [anon_sym_getlistsize] = ACTIONS(181), + [anon_sym_listappend] = ACTIONS(181), + [anon_sym_getstrsize] = ACTIONS(181), + [anon_sym_getstrcharat] = ACTIONS(181), + [anon_sym_add] = ACTIONS(181), + [anon_sym_subtract] = ACTIONS(181), + [anon_sym_multiply] = ACTIONS(181), + [anon_sym_divide] = ACTIONS(181), + [anon_sym_equal] = ACTIONS(181), + [anon_sym_inequal] = ACTIONS(181), + [anon_sym_not] = ACTIONS(181), + [anon_sym_greater] = ACTIONS(181), + [anon_sym_lesser] = ACTIONS(181), + [anon_sym_stoi] = ACTIONS(181), + [anon_sym_stod] = ACTIONS(181), + [anon_sym_tostring] = ACTIONS(181), + [anon_sym_return] = ACTIONS(181), + [anon_sym_call] = ACTIONS(181), + [anon_sym_use] = ACTIONS(181), + [anon_sym_extern] = ACTIONS(181), + [anon_sym_getfield] = ACTIONS(181), + [anon_sym_setfield] = ACTIONS(181), + [anon_sym_DOLLAR] = ACTIONS(181), + [anon_sym_AMP] = ACTIONS(181), + [anon_sym_PERCENT] = ACTIONS(181), + [anon_sym_BANG] = ACTIONS(181), + [anon_sym_DASH] = ACTIONS(183), + [sym_string] = ACTIONS(181), + [sym_int] = ACTIONS(183), + [sym_double] = ACTIONS(181), + [sym_char] = ACTIONS(181), + [anon_sym_true] = ACTIONS(181), + [anon_sym_false] = ACTIONS(181), + }, + [STATE(30)] = { + [sym_comment] = ACTIONS(3), + [anon_sym_AT] = ACTIONS(185), + [anon_sym_fun] = ACTIONS(185), + [anon_sym_endfun] = ACTIONS(185), + [anon_sym_struct] = ACTIONS(185), + [anon_sym_if] = ACTIONS(185), + [anon_sym_jump] = ACTIONS(185), + [anon_sym_end] = ACTIONS(187), + [anon_sym_input] = ACTIONS(185), + [anon_sym_print] = ACTIONS(187), + [anon_sym_println] = ACTIONS(185), + [anon_sym_set] = ACTIONS(187), + [anon_sym_init] = ACTIONS(185), + [anon_sym_gettype] = ACTIONS(185), + [anon_sym_exists] = ACTIONS(185), + [anon_sym_setlist] = ACTIONS(187), + [anon_sym_setlistat] = ACTIONS(185), + [anon_sym_getlistat] = ACTIONS(185), + [anon_sym_getlistsize] = ACTIONS(185), + [anon_sym_listappend] = ACTIONS(185), + [anon_sym_getstrsize] = ACTIONS(185), + [anon_sym_getstrcharat] = ACTIONS(185), + [anon_sym_add] = ACTIONS(185), + [anon_sym_subtract] = ACTIONS(185), + [anon_sym_multiply] = ACTIONS(185), + [anon_sym_divide] = ACTIONS(185), + [anon_sym_equal] = ACTIONS(185), + [anon_sym_inequal] = ACTIONS(185), + [anon_sym_not] = ACTIONS(185), + [anon_sym_greater] = ACTIONS(185), + [anon_sym_lesser] = ACTIONS(185), + [anon_sym_stoi] = ACTIONS(185), + [anon_sym_stod] = ACTIONS(185), + [anon_sym_tostring] = ACTIONS(185), + [anon_sym_return] = ACTIONS(185), + [anon_sym_call] = ACTIONS(185), + [anon_sym_use] = ACTIONS(185), + [anon_sym_extern] = ACTIONS(185), + [anon_sym_getfield] = ACTIONS(185), + [anon_sym_setfield] = ACTIONS(185), + [anon_sym_DOLLAR] = ACTIONS(185), + [anon_sym_AMP] = ACTIONS(185), + [anon_sym_PERCENT] = ACTIONS(185), + [anon_sym_BANG] = ACTIONS(185), + [anon_sym_DASH] = ACTIONS(187), + [sym_string] = ACTIONS(185), + [sym_int] = ACTIONS(187), + [sym_double] = ACTIONS(185), + [sym_char] = ACTIONS(185), + [anon_sym_true] = ACTIONS(185), + [anon_sym_false] = ACTIONS(185), + }, + [STATE(31)] = { + [ts_builtin_sym_end] = ACTIONS(185), + [sym_comment] = ACTIONS(3), + [anon_sym_AT] = ACTIONS(185), + [anon_sym_fun] = ACTIONS(185), + [anon_sym_struct] = ACTIONS(185), + [anon_sym_if] = ACTIONS(185), + [anon_sym_jump] = ACTIONS(185), + [anon_sym_end] = ACTIONS(185), + [anon_sym_input] = ACTIONS(185), + [anon_sym_print] = ACTIONS(187), + [anon_sym_println] = ACTIONS(185), + [anon_sym_set] = ACTIONS(187), + [anon_sym_init] = ACTIONS(185), + [anon_sym_gettype] = ACTIONS(185), + [anon_sym_exists] = ACTIONS(185), + [anon_sym_setlist] = ACTIONS(187), + [anon_sym_setlistat] = ACTIONS(185), + [anon_sym_getlistat] = ACTIONS(185), + [anon_sym_getlistsize] = ACTIONS(185), + [anon_sym_listappend] = ACTIONS(185), + [anon_sym_getstrsize] = ACTIONS(185), + [anon_sym_getstrcharat] = ACTIONS(185), + [anon_sym_add] = ACTIONS(185), + [anon_sym_subtract] = ACTIONS(185), + [anon_sym_multiply] = ACTIONS(185), + [anon_sym_divide] = ACTIONS(185), + [anon_sym_equal] = ACTIONS(185), + [anon_sym_inequal] = ACTIONS(185), + [anon_sym_not] = ACTIONS(185), + [anon_sym_greater] = ACTIONS(185), + [anon_sym_lesser] = ACTIONS(185), + [anon_sym_stoi] = ACTIONS(185), + [anon_sym_stod] = ACTIONS(185), + [anon_sym_tostring] = ACTIONS(185), + [anon_sym_return] = ACTIONS(185), + [anon_sym_call] = ACTIONS(185), + [anon_sym_use] = ACTIONS(185), + [anon_sym_extern] = ACTIONS(185), + [anon_sym_getfield] = ACTIONS(185), + [anon_sym_setfield] = ACTIONS(185), + [anon_sym_DOLLAR] = ACTIONS(185), + [anon_sym_AMP] = ACTIONS(185), + [anon_sym_PERCENT] = ACTIONS(185), + [anon_sym_BANG] = ACTIONS(185), + [anon_sym_DASH] = ACTIONS(187), + [sym_string] = ACTIONS(185), + [sym_int] = ACTIONS(187), + [sym_double] = ACTIONS(185), + [sym_char] = ACTIONS(185), + [anon_sym_true] = ACTIONS(185), + [anon_sym_false] = ACTIONS(185), + }, + [STATE(32)] = { + [sym__statement] = STATE(49), + [sym_label_definition] = STATE(49), + [sym_function_definition] = STATE(49), + [sym_struct_definition] = STATE(49), + [sym_instruction] = STATE(49), + [sym_keyword] = STATE(9), + [sym_type_reference] = STATE(78), + [aux_sym_source_file_repeat1] = STATE(49), + [aux_sym_function_definition_repeat1] = STATE(54), + [sym_comment] = ACTIONS(3), + [anon_sym_AT] = ACTIONS(189), + [anon_sym_fun] = ACTIONS(191), + [anon_sym_endfun] = ACTIONS(193), + [anon_sym_struct] = ACTIONS(195), + [anon_sym_if] = ACTIONS(197), + [anon_sym_jump] = ACTIONS(197), + [anon_sym_end] = ACTIONS(199), + [anon_sym_input] = ACTIONS(197), + [anon_sym_print] = ACTIONS(199), + [anon_sym_println] = ACTIONS(197), + [anon_sym_set] = ACTIONS(199), + [anon_sym_init] = ACTIONS(197), + [anon_sym_gettype] = ACTIONS(197), + [anon_sym_exists] = ACTIONS(197), + [anon_sym_setlist] = ACTIONS(199), + [anon_sym_setlistat] = ACTIONS(197), + [anon_sym_getlistat] = ACTIONS(197), + [anon_sym_getlistsize] = ACTIONS(197), + [anon_sym_listappend] = ACTIONS(197), + [anon_sym_getstrsize] = ACTIONS(197), + [anon_sym_getstrcharat] = ACTIONS(197), + [anon_sym_add] = ACTIONS(197), + [anon_sym_subtract] = ACTIONS(197), + [anon_sym_multiply] = ACTIONS(197), + [anon_sym_divide] = ACTIONS(197), + [anon_sym_equal] = ACTIONS(197), + [anon_sym_inequal] = ACTIONS(197), + [anon_sym_not] = ACTIONS(197), + [anon_sym_greater] = ACTIONS(197), + [anon_sym_lesser] = ACTIONS(197), + [anon_sym_stoi] = ACTIONS(197), + [anon_sym_stod] = ACTIONS(197), + [anon_sym_tostring] = ACTIONS(197), + [anon_sym_return] = ACTIONS(197), + [anon_sym_call] = ACTIONS(197), + [anon_sym_use] = ACTIONS(197), + [anon_sym_extern] = ACTIONS(197), + [anon_sym_getfield] = ACTIONS(197), + [anon_sym_setfield] = ACTIONS(197), + [anon_sym_DASH] = ACTIONS(201), + }, + [STATE(33)] = { + [sym__statement] = STATE(39), + [sym_label_definition] = STATE(39), + [sym_function_definition] = STATE(39), + [sym_struct_definition] = STATE(39), + [sym_instruction] = STATE(39), + [sym_keyword] = STATE(9), + [sym_type_reference] = STATE(78), + [aux_sym_source_file_repeat1] = STATE(39), + [aux_sym_function_definition_repeat1] = STATE(54), + [sym_comment] = ACTIONS(3), + [anon_sym_AT] = ACTIONS(189), + [anon_sym_fun] = ACTIONS(191), + [anon_sym_endfun] = ACTIONS(203), + [anon_sym_struct] = ACTIONS(195), + [anon_sym_if] = ACTIONS(197), + [anon_sym_jump] = ACTIONS(197), + [anon_sym_end] = ACTIONS(199), + [anon_sym_input] = ACTIONS(197), + [anon_sym_print] = ACTIONS(199), + [anon_sym_println] = ACTIONS(197), + [anon_sym_set] = ACTIONS(199), + [anon_sym_init] = ACTIONS(197), + [anon_sym_gettype] = ACTIONS(197), + [anon_sym_exists] = ACTIONS(197), + [anon_sym_setlist] = ACTIONS(199), + [anon_sym_setlistat] = ACTIONS(197), + [anon_sym_getlistat] = ACTIONS(197), + [anon_sym_getlistsize] = ACTIONS(197), + [anon_sym_listappend] = ACTIONS(197), + [anon_sym_getstrsize] = ACTIONS(197), + [anon_sym_getstrcharat] = ACTIONS(197), + [anon_sym_add] = ACTIONS(197), + [anon_sym_subtract] = ACTIONS(197), + [anon_sym_multiply] = ACTIONS(197), + [anon_sym_divide] = ACTIONS(197), + [anon_sym_equal] = ACTIONS(197), + [anon_sym_inequal] = ACTIONS(197), + [anon_sym_not] = ACTIONS(197), + [anon_sym_greater] = ACTIONS(197), + [anon_sym_lesser] = ACTIONS(197), + [anon_sym_stoi] = ACTIONS(197), + [anon_sym_stod] = ACTIONS(197), + [anon_sym_tostring] = ACTIONS(197), + [anon_sym_return] = ACTIONS(197), + [anon_sym_call] = ACTIONS(197), + [anon_sym_use] = ACTIONS(197), + [anon_sym_extern] = ACTIONS(197), + [anon_sym_getfield] = ACTIONS(197), + [anon_sym_setfield] = ACTIONS(197), + [anon_sym_DASH] = ACTIONS(201), + }, + [STATE(34)] = { + [sym__statement] = STATE(46), + [sym_label_definition] = STATE(46), + [sym_function_definition] = STATE(46), + [sym_struct_definition] = STATE(46), + [sym_instruction] = STATE(46), + [sym_keyword] = STATE(9), + [sym_type_reference] = STATE(78), + [aux_sym_source_file_repeat1] = STATE(46), + [aux_sym_function_definition_repeat1] = STATE(32), + [sym_comment] = ACTIONS(3), + [anon_sym_AT] = ACTIONS(189), + [anon_sym_fun] = ACTIONS(191), + [anon_sym_endfun] = ACTIONS(205), + [anon_sym_struct] = ACTIONS(195), + [anon_sym_if] = ACTIONS(197), + [anon_sym_jump] = ACTIONS(197), + [anon_sym_end] = ACTIONS(199), + [anon_sym_input] = ACTIONS(197), + [anon_sym_print] = ACTIONS(199), + [anon_sym_println] = ACTIONS(197), + [anon_sym_set] = ACTIONS(199), + [anon_sym_init] = ACTIONS(197), + [anon_sym_gettype] = ACTIONS(197), + [anon_sym_exists] = ACTIONS(197), + [anon_sym_setlist] = ACTIONS(199), + [anon_sym_setlistat] = ACTIONS(197), + [anon_sym_getlistat] = ACTIONS(197), + [anon_sym_getlistsize] = ACTIONS(197), + [anon_sym_listappend] = ACTIONS(197), + [anon_sym_getstrsize] = ACTIONS(197), + [anon_sym_getstrcharat] = ACTIONS(197), + [anon_sym_add] = ACTIONS(197), + [anon_sym_subtract] = ACTIONS(197), + [anon_sym_multiply] = ACTIONS(197), + [anon_sym_divide] = ACTIONS(197), + [anon_sym_equal] = ACTIONS(197), + [anon_sym_inequal] = ACTIONS(197), + [anon_sym_not] = ACTIONS(197), + [anon_sym_greater] = ACTIONS(197), + [anon_sym_lesser] = ACTIONS(197), + [anon_sym_stoi] = ACTIONS(197), + [anon_sym_stod] = ACTIONS(197), + [anon_sym_tostring] = ACTIONS(197), + [anon_sym_return] = ACTIONS(197), + [anon_sym_call] = ACTIONS(197), + [anon_sym_use] = ACTIONS(197), + [anon_sym_extern] = ACTIONS(197), + [anon_sym_getfield] = ACTIONS(197), + [anon_sym_setfield] = ACTIONS(197), + [anon_sym_DASH] = ACTIONS(201), + }, + [STATE(35)] = { + [sym__statement] = STATE(50), + [sym_label_definition] = STATE(50), + [sym_function_definition] = STATE(50), + [sym_struct_definition] = STATE(50), + [sym_instruction] = STATE(50), + [sym_keyword] = STATE(9), + [sym_type_reference] = STATE(78), + [aux_sym_source_file_repeat1] = STATE(50), + [aux_sym_function_definition_repeat1] = STATE(36), + [sym_comment] = ACTIONS(3), + [anon_sym_AT] = ACTIONS(189), + [anon_sym_fun] = ACTIONS(191), + [anon_sym_endfun] = ACTIONS(207), + [anon_sym_struct] = ACTIONS(195), + [anon_sym_if] = ACTIONS(197), + [anon_sym_jump] = ACTIONS(197), + [anon_sym_end] = ACTIONS(199), + [anon_sym_input] = ACTIONS(197), + [anon_sym_print] = ACTIONS(199), + [anon_sym_println] = ACTIONS(197), + [anon_sym_set] = ACTIONS(199), + [anon_sym_init] = ACTIONS(197), + [anon_sym_gettype] = ACTIONS(197), + [anon_sym_exists] = ACTIONS(197), + [anon_sym_setlist] = ACTIONS(199), + [anon_sym_setlistat] = ACTIONS(197), + [anon_sym_getlistat] = ACTIONS(197), + [anon_sym_getlistsize] = ACTIONS(197), + [anon_sym_listappend] = ACTIONS(197), + [anon_sym_getstrsize] = ACTIONS(197), + [anon_sym_getstrcharat] = ACTIONS(197), + [anon_sym_add] = ACTIONS(197), + [anon_sym_subtract] = ACTIONS(197), + [anon_sym_multiply] = ACTIONS(197), + [anon_sym_divide] = ACTIONS(197), + [anon_sym_equal] = ACTIONS(197), + [anon_sym_inequal] = ACTIONS(197), + [anon_sym_not] = ACTIONS(197), + [anon_sym_greater] = ACTIONS(197), + [anon_sym_lesser] = ACTIONS(197), + [anon_sym_stoi] = ACTIONS(197), + [anon_sym_stod] = ACTIONS(197), + [anon_sym_tostring] = ACTIONS(197), + [anon_sym_return] = ACTIONS(197), + [anon_sym_call] = ACTIONS(197), + [anon_sym_use] = ACTIONS(197), + [anon_sym_extern] = ACTIONS(197), + [anon_sym_getfield] = ACTIONS(197), + [anon_sym_setfield] = ACTIONS(197), + [anon_sym_DASH] = ACTIONS(201), + }, + [STATE(36)] = { + [sym__statement] = STATE(38), + [sym_label_definition] = STATE(38), + [sym_function_definition] = STATE(38), + [sym_struct_definition] = STATE(38), + [sym_instruction] = STATE(38), + [sym_keyword] = STATE(9), + [sym_type_reference] = STATE(78), + [aux_sym_source_file_repeat1] = STATE(38), + [aux_sym_function_definition_repeat1] = STATE(54), + [sym_comment] = ACTIONS(3), + [anon_sym_AT] = ACTIONS(189), + [anon_sym_fun] = ACTIONS(191), + [anon_sym_endfun] = ACTIONS(209), + [anon_sym_struct] = ACTIONS(195), + [anon_sym_if] = ACTIONS(197), + [anon_sym_jump] = ACTIONS(197), + [anon_sym_end] = ACTIONS(199), + [anon_sym_input] = ACTIONS(197), + [anon_sym_print] = ACTIONS(199), + [anon_sym_println] = ACTIONS(197), + [anon_sym_set] = ACTIONS(199), + [anon_sym_init] = ACTIONS(197), + [anon_sym_gettype] = ACTIONS(197), + [anon_sym_exists] = ACTIONS(197), + [anon_sym_setlist] = ACTIONS(199), + [anon_sym_setlistat] = ACTIONS(197), + [anon_sym_getlistat] = ACTIONS(197), + [anon_sym_getlistsize] = ACTIONS(197), + [anon_sym_listappend] = ACTIONS(197), + [anon_sym_getstrsize] = ACTIONS(197), + [anon_sym_getstrcharat] = ACTIONS(197), + [anon_sym_add] = ACTIONS(197), + [anon_sym_subtract] = ACTIONS(197), + [anon_sym_multiply] = ACTIONS(197), + [anon_sym_divide] = ACTIONS(197), + [anon_sym_equal] = ACTIONS(197), + [anon_sym_inequal] = ACTIONS(197), + [anon_sym_not] = ACTIONS(197), + [anon_sym_greater] = ACTIONS(197), + [anon_sym_lesser] = ACTIONS(197), + [anon_sym_stoi] = ACTIONS(197), + [anon_sym_stod] = ACTIONS(197), + [anon_sym_tostring] = ACTIONS(197), + [anon_sym_return] = ACTIONS(197), + [anon_sym_call] = ACTIONS(197), + [anon_sym_use] = ACTIONS(197), + [anon_sym_extern] = ACTIONS(197), + [anon_sym_getfield] = ACTIONS(197), + [anon_sym_setfield] = ACTIONS(197), + [anon_sym_DASH] = ACTIONS(201), + }, + [STATE(37)] = { + [sym__statement] = STATE(53), + [sym_label_definition] = STATE(53), + [sym_function_definition] = STATE(53), + [sym_struct_definition] = STATE(53), + [sym_instruction] = STATE(53), + [sym_keyword] = STATE(9), + [sym_type_reference] = STATE(78), + [aux_sym_source_file_repeat1] = STATE(53), + [aux_sym_function_definition_repeat1] = STATE(33), + [sym_comment] = ACTIONS(3), + [anon_sym_AT] = ACTIONS(189), + [anon_sym_fun] = ACTIONS(191), + [anon_sym_endfun] = ACTIONS(211), + [anon_sym_struct] = ACTIONS(195), + [anon_sym_if] = ACTIONS(197), + [anon_sym_jump] = ACTIONS(197), + [anon_sym_end] = ACTIONS(199), + [anon_sym_input] = ACTIONS(197), + [anon_sym_print] = ACTIONS(199), + [anon_sym_println] = ACTIONS(197), + [anon_sym_set] = ACTIONS(199), + [anon_sym_init] = ACTIONS(197), + [anon_sym_gettype] = ACTIONS(197), + [anon_sym_exists] = ACTIONS(197), + [anon_sym_setlist] = ACTIONS(199), + [anon_sym_setlistat] = ACTIONS(197), + [anon_sym_getlistat] = ACTIONS(197), + [anon_sym_getlistsize] = ACTIONS(197), + [anon_sym_listappend] = ACTIONS(197), + [anon_sym_getstrsize] = ACTIONS(197), + [anon_sym_getstrcharat] = ACTIONS(197), + [anon_sym_add] = ACTIONS(197), + [anon_sym_subtract] = ACTIONS(197), + [anon_sym_multiply] = ACTIONS(197), + [anon_sym_divide] = ACTIONS(197), + [anon_sym_equal] = ACTIONS(197), + [anon_sym_inequal] = ACTIONS(197), + [anon_sym_not] = ACTIONS(197), + [anon_sym_greater] = ACTIONS(197), + [anon_sym_lesser] = ACTIONS(197), + [anon_sym_stoi] = ACTIONS(197), + [anon_sym_stod] = ACTIONS(197), + [anon_sym_tostring] = ACTIONS(197), + [anon_sym_return] = ACTIONS(197), + [anon_sym_call] = ACTIONS(197), + [anon_sym_use] = ACTIONS(197), + [anon_sym_extern] = ACTIONS(197), + [anon_sym_getfield] = ACTIONS(197), + [anon_sym_setfield] = ACTIONS(197), + [anon_sym_DASH] = ACTIONS(201), + }, + [STATE(38)] = { + [sym__statement] = STATE(45), + [sym_label_definition] = STATE(45), + [sym_function_definition] = STATE(45), + [sym_struct_definition] = STATE(45), + [sym_instruction] = STATE(45), + [sym_keyword] = STATE(9), + [aux_sym_source_file_repeat1] = STATE(45), + [sym_comment] = ACTIONS(3), + [anon_sym_AT] = ACTIONS(189), + [anon_sym_fun] = ACTIONS(191), + [anon_sym_endfun] = ACTIONS(213), + [anon_sym_struct] = ACTIONS(195), + [anon_sym_if] = ACTIONS(197), + [anon_sym_jump] = ACTIONS(197), + [anon_sym_end] = ACTIONS(199), + [anon_sym_input] = ACTIONS(197), + [anon_sym_print] = ACTIONS(199), + [anon_sym_println] = ACTIONS(197), + [anon_sym_set] = ACTIONS(199), + [anon_sym_init] = ACTIONS(197), + [anon_sym_gettype] = ACTIONS(197), + [anon_sym_exists] = ACTIONS(197), + [anon_sym_setlist] = ACTIONS(199), + [anon_sym_setlistat] = ACTIONS(197), + [anon_sym_getlistat] = ACTIONS(197), + [anon_sym_getlistsize] = ACTIONS(197), + [anon_sym_listappend] = ACTIONS(197), + [anon_sym_getstrsize] = ACTIONS(197), + [anon_sym_getstrcharat] = ACTIONS(197), + [anon_sym_add] = ACTIONS(197), + [anon_sym_subtract] = ACTIONS(197), + [anon_sym_multiply] = ACTIONS(197), + [anon_sym_divide] = ACTIONS(197), + [anon_sym_equal] = ACTIONS(197), + [anon_sym_inequal] = ACTIONS(197), + [anon_sym_not] = ACTIONS(197), + [anon_sym_greater] = ACTIONS(197), + [anon_sym_lesser] = ACTIONS(197), + [anon_sym_stoi] = ACTIONS(197), + [anon_sym_stod] = ACTIONS(197), + [anon_sym_tostring] = ACTIONS(197), + [anon_sym_return] = ACTIONS(197), + [anon_sym_call] = ACTIONS(197), + [anon_sym_use] = ACTIONS(197), + [anon_sym_extern] = ACTIONS(197), + [anon_sym_getfield] = ACTIONS(197), + [anon_sym_setfield] = ACTIONS(197), + }, + [STATE(39)] = { + [sym__statement] = STATE(45), + [sym_label_definition] = STATE(45), + [sym_function_definition] = STATE(45), + [sym_struct_definition] = STATE(45), + [sym_instruction] = STATE(45), + [sym_keyword] = STATE(9), + [aux_sym_source_file_repeat1] = STATE(45), + [sym_comment] = ACTIONS(3), + [anon_sym_AT] = ACTIONS(189), + [anon_sym_fun] = ACTIONS(191), + [anon_sym_endfun] = ACTIONS(215), + [anon_sym_struct] = ACTIONS(195), + [anon_sym_if] = ACTIONS(197), + [anon_sym_jump] = ACTIONS(197), + [anon_sym_end] = ACTIONS(199), + [anon_sym_input] = ACTIONS(197), + [anon_sym_print] = ACTIONS(199), + [anon_sym_println] = ACTIONS(197), + [anon_sym_set] = ACTIONS(199), + [anon_sym_init] = ACTIONS(197), + [anon_sym_gettype] = ACTIONS(197), + [anon_sym_exists] = ACTIONS(197), + [anon_sym_setlist] = ACTIONS(199), + [anon_sym_setlistat] = ACTIONS(197), + [anon_sym_getlistat] = ACTIONS(197), + [anon_sym_getlistsize] = ACTIONS(197), + [anon_sym_listappend] = ACTIONS(197), + [anon_sym_getstrsize] = ACTIONS(197), + [anon_sym_getstrcharat] = ACTIONS(197), + [anon_sym_add] = ACTIONS(197), + [anon_sym_subtract] = ACTIONS(197), + [anon_sym_multiply] = ACTIONS(197), + [anon_sym_divide] = ACTIONS(197), + [anon_sym_equal] = ACTIONS(197), + [anon_sym_inequal] = ACTIONS(197), + [anon_sym_not] = ACTIONS(197), + [anon_sym_greater] = ACTIONS(197), + [anon_sym_lesser] = ACTIONS(197), + [anon_sym_stoi] = ACTIONS(197), + [anon_sym_stod] = ACTIONS(197), + [anon_sym_tostring] = ACTIONS(197), + [anon_sym_return] = ACTIONS(197), + [anon_sym_call] = ACTIONS(197), + [anon_sym_use] = ACTIONS(197), + [anon_sym_extern] = ACTIONS(197), + [anon_sym_getfield] = ACTIONS(197), + [anon_sym_setfield] = ACTIONS(197), + }, + [STATE(40)] = { + [sym__statement] = STATE(40), + [sym_label_definition] = STATE(40), + [sym_function_definition] = STATE(40), + [sym_struct_definition] = STATE(40), + [sym_instruction] = STATE(40), + [sym_keyword] = STATE(2), + [aux_sym_source_file_repeat1] = STATE(40), + [ts_builtin_sym_end] = ACTIONS(217), + [sym_comment] = ACTIONS(3), + [anon_sym_AT] = ACTIONS(219), + [anon_sym_fun] = ACTIONS(222), + [anon_sym_struct] = ACTIONS(225), + [anon_sym_if] = ACTIONS(228), + [anon_sym_jump] = ACTIONS(228), + [anon_sym_end] = ACTIONS(228), + [anon_sym_input] = ACTIONS(228), + [anon_sym_print] = ACTIONS(231), + [anon_sym_println] = ACTIONS(228), + [anon_sym_set] = ACTIONS(231), + [anon_sym_init] = ACTIONS(228), + [anon_sym_gettype] = ACTIONS(228), + [anon_sym_exists] = ACTIONS(228), + [anon_sym_setlist] = ACTIONS(231), + [anon_sym_setlistat] = ACTIONS(228), + [anon_sym_getlistat] = ACTIONS(228), + [anon_sym_getlistsize] = ACTIONS(228), + [anon_sym_listappend] = ACTIONS(228), + [anon_sym_getstrsize] = ACTIONS(228), + [anon_sym_getstrcharat] = ACTIONS(228), + [anon_sym_add] = ACTIONS(228), + [anon_sym_subtract] = ACTIONS(228), + [anon_sym_multiply] = ACTIONS(228), + [anon_sym_divide] = ACTIONS(228), + [anon_sym_equal] = ACTIONS(228), + [anon_sym_inequal] = ACTIONS(228), + [anon_sym_not] = ACTIONS(228), + [anon_sym_greater] = ACTIONS(228), + [anon_sym_lesser] = ACTIONS(228), + [anon_sym_stoi] = ACTIONS(228), + [anon_sym_stod] = ACTIONS(228), + [anon_sym_tostring] = ACTIONS(228), + [anon_sym_return] = ACTIONS(228), + [anon_sym_call] = ACTIONS(228), + [anon_sym_use] = ACTIONS(228), + [anon_sym_extern] = ACTIONS(228), + [anon_sym_getfield] = ACTIONS(228), + [anon_sym_setfield] = ACTIONS(228), + }, + [STATE(41)] = { + [sym__statement] = STATE(41), + [sym_label_definition] = STATE(41), + [sym_function_definition] = STATE(41), + [sym_struct_definition] = STATE(41), + [sym_instruction] = STATE(41), + [sym_keyword] = STATE(6), + [aux_sym_source_file_repeat1] = STATE(41), + [sym_comment] = ACTIONS(3), + [anon_sym_AT] = ACTIONS(234), + [anon_sym_fun] = ACTIONS(237), + [anon_sym_struct] = ACTIONS(240), + [anon_sym_endstruct] = ACTIONS(217), + [anon_sym_if] = ACTIONS(243), + [anon_sym_jump] = ACTIONS(243), + [anon_sym_end] = ACTIONS(246), + [anon_sym_input] = ACTIONS(243), + [anon_sym_print] = ACTIONS(246), + [anon_sym_println] = ACTIONS(243), + [anon_sym_set] = ACTIONS(246), + [anon_sym_init] = ACTIONS(243), + [anon_sym_gettype] = ACTIONS(243), + [anon_sym_exists] = ACTIONS(243), + [anon_sym_setlist] = ACTIONS(246), + [anon_sym_setlistat] = ACTIONS(243), + [anon_sym_getlistat] = ACTIONS(243), + [anon_sym_getlistsize] = ACTIONS(243), + [anon_sym_listappend] = ACTIONS(243), + [anon_sym_getstrsize] = ACTIONS(243), + [anon_sym_getstrcharat] = ACTIONS(243), + [anon_sym_add] = ACTIONS(243), + [anon_sym_subtract] = ACTIONS(243), + [anon_sym_multiply] = ACTIONS(243), + [anon_sym_divide] = ACTIONS(243), + [anon_sym_equal] = ACTIONS(243), + [anon_sym_inequal] = ACTIONS(243), + [anon_sym_not] = ACTIONS(243), + [anon_sym_greater] = ACTIONS(243), + [anon_sym_lesser] = ACTIONS(243), + [anon_sym_stoi] = ACTIONS(243), + [anon_sym_stod] = ACTIONS(243), + [anon_sym_tostring] = ACTIONS(243), + [anon_sym_return] = ACTIONS(243), + [anon_sym_call] = ACTIONS(243), + [anon_sym_use] = ACTIONS(243), + [anon_sym_extern] = ACTIONS(243), + [anon_sym_getfield] = ACTIONS(243), + [anon_sym_setfield] = ACTIONS(243), + }, + [STATE(42)] = { + [sym__statement] = STATE(40), + [sym_label_definition] = STATE(40), + [sym_function_definition] = STATE(40), + [sym_struct_definition] = STATE(40), + [sym_instruction] = STATE(40), + [sym_keyword] = STATE(2), + [aux_sym_source_file_repeat1] = STATE(40), + [ts_builtin_sym_end] = ACTIONS(249), + [sym_comment] = ACTIONS(3), + [anon_sym_AT] = ACTIONS(7), + [anon_sym_fun] = ACTIONS(9), + [anon_sym_struct] = ACTIONS(11), + [anon_sym_if] = ACTIONS(13), + [anon_sym_jump] = ACTIONS(13), + [anon_sym_end] = ACTIONS(13), + [anon_sym_input] = ACTIONS(13), + [anon_sym_print] = ACTIONS(15), + [anon_sym_println] = ACTIONS(13), + [anon_sym_set] = ACTIONS(15), + [anon_sym_init] = ACTIONS(13), + [anon_sym_gettype] = ACTIONS(13), + [anon_sym_exists] = ACTIONS(13), + [anon_sym_setlist] = ACTIONS(15), + [anon_sym_setlistat] = ACTIONS(13), + [anon_sym_getlistat] = ACTIONS(13), + [anon_sym_getlistsize] = ACTIONS(13), + [anon_sym_listappend] = ACTIONS(13), + [anon_sym_getstrsize] = ACTIONS(13), + [anon_sym_getstrcharat] = ACTIONS(13), + [anon_sym_add] = ACTIONS(13), + [anon_sym_subtract] = ACTIONS(13), + [anon_sym_multiply] = ACTIONS(13), + [anon_sym_divide] = ACTIONS(13), + [anon_sym_equal] = ACTIONS(13), + [anon_sym_inequal] = ACTIONS(13), + [anon_sym_not] = ACTIONS(13), + [anon_sym_greater] = ACTIONS(13), + [anon_sym_lesser] = ACTIONS(13), + [anon_sym_stoi] = ACTIONS(13), + [anon_sym_stod] = ACTIONS(13), + [anon_sym_tostring] = ACTIONS(13), + [anon_sym_return] = ACTIONS(13), + [anon_sym_call] = ACTIONS(13), + [anon_sym_use] = ACTIONS(13), + [anon_sym_extern] = ACTIONS(13), + [anon_sym_getfield] = ACTIONS(13), + [anon_sym_setfield] = ACTIONS(13), + }, + [STATE(43)] = { + [sym__statement] = STATE(41), + [sym_label_definition] = STATE(41), + [sym_function_definition] = STATE(41), + [sym_struct_definition] = STATE(41), + [sym_instruction] = STATE(41), + [sym_keyword] = STATE(6), + [aux_sym_source_file_repeat1] = STATE(41), + [sym_comment] = ACTIONS(3), + [anon_sym_AT] = ACTIONS(251), + [anon_sym_fun] = ACTIONS(253), + [anon_sym_struct] = ACTIONS(255), + [anon_sym_endstruct] = ACTIONS(257), + [anon_sym_if] = ACTIONS(259), + [anon_sym_jump] = ACTIONS(259), + [anon_sym_end] = ACTIONS(261), + [anon_sym_input] = ACTIONS(259), + [anon_sym_print] = ACTIONS(261), + [anon_sym_println] = ACTIONS(259), + [anon_sym_set] = ACTIONS(261), + [anon_sym_init] = ACTIONS(259), + [anon_sym_gettype] = ACTIONS(259), + [anon_sym_exists] = ACTIONS(259), + [anon_sym_setlist] = ACTIONS(261), + [anon_sym_setlistat] = ACTIONS(259), + [anon_sym_getlistat] = ACTIONS(259), + [anon_sym_getlistsize] = ACTIONS(259), + [anon_sym_listappend] = ACTIONS(259), + [anon_sym_getstrsize] = ACTIONS(259), + [anon_sym_getstrcharat] = ACTIONS(259), + [anon_sym_add] = ACTIONS(259), + [anon_sym_subtract] = ACTIONS(259), + [anon_sym_multiply] = ACTIONS(259), + [anon_sym_divide] = ACTIONS(259), + [anon_sym_equal] = ACTIONS(259), + [anon_sym_inequal] = ACTIONS(259), + [anon_sym_not] = ACTIONS(259), + [anon_sym_greater] = ACTIONS(259), + [anon_sym_lesser] = ACTIONS(259), + [anon_sym_stoi] = ACTIONS(259), + [anon_sym_stod] = ACTIONS(259), + [anon_sym_tostring] = ACTIONS(259), + [anon_sym_return] = ACTIONS(259), + [anon_sym_call] = ACTIONS(259), + [anon_sym_use] = ACTIONS(259), + [anon_sym_extern] = ACTIONS(259), + [anon_sym_getfield] = ACTIONS(259), + [anon_sym_setfield] = ACTIONS(259), + }, + [STATE(44)] = { + [sym__statement] = STATE(43), + [sym_label_definition] = STATE(43), + [sym_function_definition] = STATE(43), + [sym_struct_definition] = STATE(43), + [sym_instruction] = STATE(43), + [sym_keyword] = STATE(6), + [aux_sym_source_file_repeat1] = STATE(43), + [sym_comment] = ACTIONS(3), + [anon_sym_AT] = ACTIONS(251), + [anon_sym_fun] = ACTIONS(253), + [anon_sym_struct] = ACTIONS(255), + [anon_sym_endstruct] = ACTIONS(263), + [anon_sym_if] = ACTIONS(259), + [anon_sym_jump] = ACTIONS(259), + [anon_sym_end] = ACTIONS(261), + [anon_sym_input] = ACTIONS(259), + [anon_sym_print] = ACTIONS(261), + [anon_sym_println] = ACTIONS(259), + [anon_sym_set] = ACTIONS(261), + [anon_sym_init] = ACTIONS(259), + [anon_sym_gettype] = ACTIONS(259), + [anon_sym_exists] = ACTIONS(259), + [anon_sym_setlist] = ACTIONS(261), + [anon_sym_setlistat] = ACTIONS(259), + [anon_sym_getlistat] = ACTIONS(259), + [anon_sym_getlistsize] = ACTIONS(259), + [anon_sym_listappend] = ACTIONS(259), + [anon_sym_getstrsize] = ACTIONS(259), + [anon_sym_getstrcharat] = ACTIONS(259), + [anon_sym_add] = ACTIONS(259), + [anon_sym_subtract] = ACTIONS(259), + [anon_sym_multiply] = ACTIONS(259), + [anon_sym_divide] = ACTIONS(259), + [anon_sym_equal] = ACTIONS(259), + [anon_sym_inequal] = ACTIONS(259), + [anon_sym_not] = ACTIONS(259), + [anon_sym_greater] = ACTIONS(259), + [anon_sym_lesser] = ACTIONS(259), + [anon_sym_stoi] = ACTIONS(259), + [anon_sym_stod] = ACTIONS(259), + [anon_sym_tostring] = ACTIONS(259), + [anon_sym_return] = ACTIONS(259), + [anon_sym_call] = ACTIONS(259), + [anon_sym_use] = ACTIONS(259), + [anon_sym_extern] = ACTIONS(259), + [anon_sym_getfield] = ACTIONS(259), + [anon_sym_setfield] = ACTIONS(259), + }, + [STATE(45)] = { + [sym__statement] = STATE(45), + [sym_label_definition] = STATE(45), + [sym_function_definition] = STATE(45), + [sym_struct_definition] = STATE(45), + [sym_instruction] = STATE(45), + [sym_keyword] = STATE(9), + [aux_sym_source_file_repeat1] = STATE(45), + [sym_comment] = ACTIONS(3), + [anon_sym_AT] = ACTIONS(265), + [anon_sym_fun] = ACTIONS(268), + [anon_sym_endfun] = ACTIONS(217), + [anon_sym_struct] = ACTIONS(271), + [anon_sym_if] = ACTIONS(274), + [anon_sym_jump] = ACTIONS(274), + [anon_sym_end] = ACTIONS(277), + [anon_sym_input] = ACTIONS(274), + [anon_sym_print] = ACTIONS(277), + [anon_sym_println] = ACTIONS(274), + [anon_sym_set] = ACTIONS(277), + [anon_sym_init] = ACTIONS(274), + [anon_sym_gettype] = ACTIONS(274), + [anon_sym_exists] = ACTIONS(274), + [anon_sym_setlist] = ACTIONS(277), + [anon_sym_setlistat] = ACTIONS(274), + [anon_sym_getlistat] = ACTIONS(274), + [anon_sym_getlistsize] = ACTIONS(274), + [anon_sym_listappend] = ACTIONS(274), + [anon_sym_getstrsize] = ACTIONS(274), + [anon_sym_getstrcharat] = ACTIONS(274), + [anon_sym_add] = ACTIONS(274), + [anon_sym_subtract] = ACTIONS(274), + [anon_sym_multiply] = ACTIONS(274), + [anon_sym_divide] = ACTIONS(274), + [anon_sym_equal] = ACTIONS(274), + [anon_sym_inequal] = ACTIONS(274), + [anon_sym_not] = ACTIONS(274), + [anon_sym_greater] = ACTIONS(274), + [anon_sym_lesser] = ACTIONS(274), + [anon_sym_stoi] = ACTIONS(274), + [anon_sym_stod] = ACTIONS(274), + [anon_sym_tostring] = ACTIONS(274), + [anon_sym_return] = ACTIONS(274), + [anon_sym_call] = ACTIONS(274), + [anon_sym_use] = ACTIONS(274), + [anon_sym_extern] = ACTIONS(274), + [anon_sym_getfield] = ACTIONS(274), + [anon_sym_setfield] = ACTIONS(274), + }, + [STATE(46)] = { + [sym__statement] = STATE(45), + [sym_label_definition] = STATE(45), + [sym_function_definition] = STATE(45), + [sym_struct_definition] = STATE(45), + [sym_instruction] = STATE(45), + [sym_keyword] = STATE(9), + [aux_sym_source_file_repeat1] = STATE(45), + [sym_comment] = ACTIONS(3), + [anon_sym_AT] = ACTIONS(189), + [anon_sym_fun] = ACTIONS(191), + [anon_sym_endfun] = ACTIONS(280), + [anon_sym_struct] = ACTIONS(195), + [anon_sym_if] = ACTIONS(197), + [anon_sym_jump] = ACTIONS(197), + [anon_sym_end] = ACTIONS(199), + [anon_sym_input] = ACTIONS(197), + [anon_sym_print] = ACTIONS(199), + [anon_sym_println] = ACTIONS(197), + [anon_sym_set] = ACTIONS(199), + [anon_sym_init] = ACTIONS(197), + [anon_sym_gettype] = ACTIONS(197), + [anon_sym_exists] = ACTIONS(197), + [anon_sym_setlist] = ACTIONS(199), + [anon_sym_setlistat] = ACTIONS(197), + [anon_sym_getlistat] = ACTIONS(197), + [anon_sym_getlistsize] = ACTIONS(197), + [anon_sym_listappend] = ACTIONS(197), + [anon_sym_getstrsize] = ACTIONS(197), + [anon_sym_getstrcharat] = ACTIONS(197), + [anon_sym_add] = ACTIONS(197), + [anon_sym_subtract] = ACTIONS(197), + [anon_sym_multiply] = ACTIONS(197), + [anon_sym_divide] = ACTIONS(197), + [anon_sym_equal] = ACTIONS(197), + [anon_sym_inequal] = ACTIONS(197), + [anon_sym_not] = ACTIONS(197), + [anon_sym_greater] = ACTIONS(197), + [anon_sym_lesser] = ACTIONS(197), + [anon_sym_stoi] = ACTIONS(197), + [anon_sym_stod] = ACTIONS(197), + [anon_sym_tostring] = ACTIONS(197), + [anon_sym_return] = ACTIONS(197), + [anon_sym_call] = ACTIONS(197), + [anon_sym_use] = ACTIONS(197), + [anon_sym_extern] = ACTIONS(197), + [anon_sym_getfield] = ACTIONS(197), + [anon_sym_setfield] = ACTIONS(197), + }, + [STATE(47)] = { + [sym__statement] = STATE(41), + [sym_label_definition] = STATE(41), + [sym_function_definition] = STATE(41), + [sym_struct_definition] = STATE(41), + [sym_instruction] = STATE(41), + [sym_keyword] = STATE(6), + [aux_sym_source_file_repeat1] = STATE(41), + [sym_comment] = ACTIONS(3), + [anon_sym_AT] = ACTIONS(251), + [anon_sym_fun] = ACTIONS(253), + [anon_sym_struct] = ACTIONS(255), + [anon_sym_endstruct] = ACTIONS(282), + [anon_sym_if] = ACTIONS(259), + [anon_sym_jump] = ACTIONS(259), + [anon_sym_end] = ACTIONS(261), + [anon_sym_input] = ACTIONS(259), + [anon_sym_print] = ACTIONS(261), + [anon_sym_println] = ACTIONS(259), + [anon_sym_set] = ACTIONS(261), + [anon_sym_init] = ACTIONS(259), + [anon_sym_gettype] = ACTIONS(259), + [anon_sym_exists] = ACTIONS(259), + [anon_sym_setlist] = ACTIONS(261), + [anon_sym_setlistat] = ACTIONS(259), + [anon_sym_getlistat] = ACTIONS(259), + [anon_sym_getlistsize] = ACTIONS(259), + [anon_sym_listappend] = ACTIONS(259), + [anon_sym_getstrsize] = ACTIONS(259), + [anon_sym_getstrcharat] = ACTIONS(259), + [anon_sym_add] = ACTIONS(259), + [anon_sym_subtract] = ACTIONS(259), + [anon_sym_multiply] = ACTIONS(259), + [anon_sym_divide] = ACTIONS(259), + [anon_sym_equal] = ACTIONS(259), + [anon_sym_inequal] = ACTIONS(259), + [anon_sym_not] = ACTIONS(259), + [anon_sym_greater] = ACTIONS(259), + [anon_sym_lesser] = ACTIONS(259), + [anon_sym_stoi] = ACTIONS(259), + [anon_sym_stod] = ACTIONS(259), + [anon_sym_tostring] = ACTIONS(259), + [anon_sym_return] = ACTIONS(259), + [anon_sym_call] = ACTIONS(259), + [anon_sym_use] = ACTIONS(259), + [anon_sym_extern] = ACTIONS(259), + [anon_sym_getfield] = ACTIONS(259), + [anon_sym_setfield] = ACTIONS(259), + }, + [STATE(48)] = { + [sym__statement] = STATE(47), + [sym_label_definition] = STATE(47), + [sym_function_definition] = STATE(47), + [sym_struct_definition] = STATE(47), + [sym_instruction] = STATE(47), + [sym_keyword] = STATE(6), + [aux_sym_source_file_repeat1] = STATE(47), + [sym_comment] = ACTIONS(3), + [anon_sym_AT] = ACTIONS(251), + [anon_sym_fun] = ACTIONS(253), + [anon_sym_struct] = ACTIONS(255), + [anon_sym_endstruct] = ACTIONS(284), + [anon_sym_if] = ACTIONS(259), + [anon_sym_jump] = ACTIONS(259), + [anon_sym_end] = ACTIONS(261), + [anon_sym_input] = ACTIONS(259), + [anon_sym_print] = ACTIONS(261), + [anon_sym_println] = ACTIONS(259), + [anon_sym_set] = ACTIONS(261), + [anon_sym_init] = ACTIONS(259), + [anon_sym_gettype] = ACTIONS(259), + [anon_sym_exists] = ACTIONS(259), + [anon_sym_setlist] = ACTIONS(261), + [anon_sym_setlistat] = ACTIONS(259), + [anon_sym_getlistat] = ACTIONS(259), + [anon_sym_getlistsize] = ACTIONS(259), + [anon_sym_listappend] = ACTIONS(259), + [anon_sym_getstrsize] = ACTIONS(259), + [anon_sym_getstrcharat] = ACTIONS(259), + [anon_sym_add] = ACTIONS(259), + [anon_sym_subtract] = ACTIONS(259), + [anon_sym_multiply] = ACTIONS(259), + [anon_sym_divide] = ACTIONS(259), + [anon_sym_equal] = ACTIONS(259), + [anon_sym_inequal] = ACTIONS(259), + [anon_sym_not] = ACTIONS(259), + [anon_sym_greater] = ACTIONS(259), + [anon_sym_lesser] = ACTIONS(259), + [anon_sym_stoi] = ACTIONS(259), + [anon_sym_stod] = ACTIONS(259), + [anon_sym_tostring] = ACTIONS(259), + [anon_sym_return] = ACTIONS(259), + [anon_sym_call] = ACTIONS(259), + [anon_sym_use] = ACTIONS(259), + [anon_sym_extern] = ACTIONS(259), + [anon_sym_getfield] = ACTIONS(259), + [anon_sym_setfield] = ACTIONS(259), + }, + [STATE(49)] = { + [sym__statement] = STATE(45), + [sym_label_definition] = STATE(45), + [sym_function_definition] = STATE(45), + [sym_struct_definition] = STATE(45), + [sym_instruction] = STATE(45), + [sym_keyword] = STATE(9), + [aux_sym_source_file_repeat1] = STATE(45), + [sym_comment] = ACTIONS(3), + [anon_sym_AT] = ACTIONS(189), + [anon_sym_fun] = ACTIONS(191), + [anon_sym_endfun] = ACTIONS(286), + [anon_sym_struct] = ACTIONS(195), + [anon_sym_if] = ACTIONS(197), + [anon_sym_jump] = ACTIONS(197), + [anon_sym_end] = ACTIONS(199), + [anon_sym_input] = ACTIONS(197), + [anon_sym_print] = ACTIONS(199), + [anon_sym_println] = ACTIONS(197), + [anon_sym_set] = ACTIONS(199), + [anon_sym_init] = ACTIONS(197), + [anon_sym_gettype] = ACTIONS(197), + [anon_sym_exists] = ACTIONS(197), + [anon_sym_setlist] = ACTIONS(199), + [anon_sym_setlistat] = ACTIONS(197), + [anon_sym_getlistat] = ACTIONS(197), + [anon_sym_getlistsize] = ACTIONS(197), + [anon_sym_listappend] = ACTIONS(197), + [anon_sym_getstrsize] = ACTIONS(197), + [anon_sym_getstrcharat] = ACTIONS(197), + [anon_sym_add] = ACTIONS(197), + [anon_sym_subtract] = ACTIONS(197), + [anon_sym_multiply] = ACTIONS(197), + [anon_sym_divide] = ACTIONS(197), + [anon_sym_equal] = ACTIONS(197), + [anon_sym_inequal] = ACTIONS(197), + [anon_sym_not] = ACTIONS(197), + [anon_sym_greater] = ACTIONS(197), + [anon_sym_lesser] = ACTIONS(197), + [anon_sym_stoi] = ACTIONS(197), + [anon_sym_stod] = ACTIONS(197), + [anon_sym_tostring] = ACTIONS(197), + [anon_sym_return] = ACTIONS(197), + [anon_sym_call] = ACTIONS(197), + [anon_sym_use] = ACTIONS(197), + [anon_sym_extern] = ACTIONS(197), + [anon_sym_getfield] = ACTIONS(197), + [anon_sym_setfield] = ACTIONS(197), + }, + [STATE(50)] = { + [sym__statement] = STATE(45), + [sym_label_definition] = STATE(45), + [sym_function_definition] = STATE(45), + [sym_struct_definition] = STATE(45), + [sym_instruction] = STATE(45), + [sym_keyword] = STATE(9), + [aux_sym_source_file_repeat1] = STATE(45), + [sym_comment] = ACTIONS(3), + [anon_sym_AT] = ACTIONS(189), + [anon_sym_fun] = ACTIONS(191), + [anon_sym_endfun] = ACTIONS(288), + [anon_sym_struct] = ACTIONS(195), + [anon_sym_if] = ACTIONS(197), + [anon_sym_jump] = ACTIONS(197), + [anon_sym_end] = ACTIONS(199), + [anon_sym_input] = ACTIONS(197), + [anon_sym_print] = ACTIONS(199), + [anon_sym_println] = ACTIONS(197), + [anon_sym_set] = ACTIONS(199), + [anon_sym_init] = ACTIONS(197), + [anon_sym_gettype] = ACTIONS(197), + [anon_sym_exists] = ACTIONS(197), + [anon_sym_setlist] = ACTIONS(199), + [anon_sym_setlistat] = ACTIONS(197), + [anon_sym_getlistat] = ACTIONS(197), + [anon_sym_getlistsize] = ACTIONS(197), + [anon_sym_listappend] = ACTIONS(197), + [anon_sym_getstrsize] = ACTIONS(197), + [anon_sym_getstrcharat] = ACTIONS(197), + [anon_sym_add] = ACTIONS(197), + [anon_sym_subtract] = ACTIONS(197), + [anon_sym_multiply] = ACTIONS(197), + [anon_sym_divide] = ACTIONS(197), + [anon_sym_equal] = ACTIONS(197), + [anon_sym_inequal] = ACTIONS(197), + [anon_sym_not] = ACTIONS(197), + [anon_sym_greater] = ACTIONS(197), + [anon_sym_lesser] = ACTIONS(197), + [anon_sym_stoi] = ACTIONS(197), + [anon_sym_stod] = ACTIONS(197), + [anon_sym_tostring] = ACTIONS(197), + [anon_sym_return] = ACTIONS(197), + [anon_sym_call] = ACTIONS(197), + [anon_sym_use] = ACTIONS(197), + [anon_sym_extern] = ACTIONS(197), + [anon_sym_getfield] = ACTIONS(197), + [anon_sym_setfield] = ACTIONS(197), + }, + [STATE(51)] = { + [sym__statement] = STATE(52), + [sym_label_definition] = STATE(52), + [sym_function_definition] = STATE(52), + [sym_struct_definition] = STATE(52), + [sym_instruction] = STATE(52), + [sym_keyword] = STATE(6), + [aux_sym_source_file_repeat1] = STATE(52), + [sym_comment] = ACTIONS(3), + [anon_sym_AT] = ACTIONS(251), + [anon_sym_fun] = ACTIONS(253), + [anon_sym_struct] = ACTIONS(255), + [anon_sym_endstruct] = ACTIONS(290), + [anon_sym_if] = ACTIONS(259), + [anon_sym_jump] = ACTIONS(259), + [anon_sym_end] = ACTIONS(261), + [anon_sym_input] = ACTIONS(259), + [anon_sym_print] = ACTIONS(261), + [anon_sym_println] = ACTIONS(259), + [anon_sym_set] = ACTIONS(261), + [anon_sym_init] = ACTIONS(259), + [anon_sym_gettype] = ACTIONS(259), + [anon_sym_exists] = ACTIONS(259), + [anon_sym_setlist] = ACTIONS(261), + [anon_sym_setlistat] = ACTIONS(259), + [anon_sym_getlistat] = ACTIONS(259), + [anon_sym_getlistsize] = ACTIONS(259), + [anon_sym_listappend] = ACTIONS(259), + [anon_sym_getstrsize] = ACTIONS(259), + [anon_sym_getstrcharat] = ACTIONS(259), + [anon_sym_add] = ACTIONS(259), + [anon_sym_subtract] = ACTIONS(259), + [anon_sym_multiply] = ACTIONS(259), + [anon_sym_divide] = ACTIONS(259), + [anon_sym_equal] = ACTIONS(259), + [anon_sym_inequal] = ACTIONS(259), + [anon_sym_not] = ACTIONS(259), + [anon_sym_greater] = ACTIONS(259), + [anon_sym_lesser] = ACTIONS(259), + [anon_sym_stoi] = ACTIONS(259), + [anon_sym_stod] = ACTIONS(259), + [anon_sym_tostring] = ACTIONS(259), + [anon_sym_return] = ACTIONS(259), + [anon_sym_call] = ACTIONS(259), + [anon_sym_use] = ACTIONS(259), + [anon_sym_extern] = ACTIONS(259), + [anon_sym_getfield] = ACTIONS(259), + [anon_sym_setfield] = ACTIONS(259), + }, + [STATE(52)] = { + [sym__statement] = STATE(41), + [sym_label_definition] = STATE(41), + [sym_function_definition] = STATE(41), + [sym_struct_definition] = STATE(41), + [sym_instruction] = STATE(41), + [sym_keyword] = STATE(6), + [aux_sym_source_file_repeat1] = STATE(41), + [sym_comment] = ACTIONS(3), + [anon_sym_AT] = ACTIONS(251), + [anon_sym_fun] = ACTIONS(253), + [anon_sym_struct] = ACTIONS(255), + [anon_sym_endstruct] = ACTIONS(292), + [anon_sym_if] = ACTIONS(259), + [anon_sym_jump] = ACTIONS(259), + [anon_sym_end] = ACTIONS(261), + [anon_sym_input] = ACTIONS(259), + [anon_sym_print] = ACTIONS(261), + [anon_sym_println] = ACTIONS(259), + [anon_sym_set] = ACTIONS(261), + [anon_sym_init] = ACTIONS(259), + [anon_sym_gettype] = ACTIONS(259), + [anon_sym_exists] = ACTIONS(259), + [anon_sym_setlist] = ACTIONS(261), + [anon_sym_setlistat] = ACTIONS(259), + [anon_sym_getlistat] = ACTIONS(259), + [anon_sym_getlistsize] = ACTIONS(259), + [anon_sym_listappend] = ACTIONS(259), + [anon_sym_getstrsize] = ACTIONS(259), + [anon_sym_getstrcharat] = ACTIONS(259), + [anon_sym_add] = ACTIONS(259), + [anon_sym_subtract] = ACTIONS(259), + [anon_sym_multiply] = ACTIONS(259), + [anon_sym_divide] = ACTIONS(259), + [anon_sym_equal] = ACTIONS(259), + [anon_sym_inequal] = ACTIONS(259), + [anon_sym_not] = ACTIONS(259), + [anon_sym_greater] = ACTIONS(259), + [anon_sym_lesser] = ACTIONS(259), + [anon_sym_stoi] = ACTIONS(259), + [anon_sym_stod] = ACTIONS(259), + [anon_sym_tostring] = ACTIONS(259), + [anon_sym_return] = ACTIONS(259), + [anon_sym_call] = ACTIONS(259), + [anon_sym_use] = ACTIONS(259), + [anon_sym_extern] = ACTIONS(259), + [anon_sym_getfield] = ACTIONS(259), + [anon_sym_setfield] = ACTIONS(259), + }, + [STATE(53)] = { + [sym__statement] = STATE(45), + [sym_label_definition] = STATE(45), + [sym_function_definition] = STATE(45), + [sym_struct_definition] = STATE(45), + [sym_instruction] = STATE(45), + [sym_keyword] = STATE(9), + [aux_sym_source_file_repeat1] = STATE(45), + [sym_comment] = ACTIONS(3), + [anon_sym_AT] = ACTIONS(189), + [anon_sym_fun] = ACTIONS(191), + [anon_sym_endfun] = ACTIONS(294), + [anon_sym_struct] = ACTIONS(195), + [anon_sym_if] = ACTIONS(197), + [anon_sym_jump] = ACTIONS(197), + [anon_sym_end] = ACTIONS(199), + [anon_sym_input] = ACTIONS(197), + [anon_sym_print] = ACTIONS(199), + [anon_sym_println] = ACTIONS(197), + [anon_sym_set] = ACTIONS(199), + [anon_sym_init] = ACTIONS(197), + [anon_sym_gettype] = ACTIONS(197), + [anon_sym_exists] = ACTIONS(197), + [anon_sym_setlist] = ACTIONS(199), + [anon_sym_setlistat] = ACTIONS(197), + [anon_sym_getlistat] = ACTIONS(197), + [anon_sym_getlistsize] = ACTIONS(197), + [anon_sym_listappend] = ACTIONS(197), + [anon_sym_getstrsize] = ACTIONS(197), + [anon_sym_getstrcharat] = ACTIONS(197), + [anon_sym_add] = ACTIONS(197), + [anon_sym_subtract] = ACTIONS(197), + [anon_sym_multiply] = ACTIONS(197), + [anon_sym_divide] = ACTIONS(197), + [anon_sym_equal] = ACTIONS(197), + [anon_sym_inequal] = ACTIONS(197), + [anon_sym_not] = ACTIONS(197), + [anon_sym_greater] = ACTIONS(197), + [anon_sym_lesser] = ACTIONS(197), + [anon_sym_stoi] = ACTIONS(197), + [anon_sym_stod] = ACTIONS(197), + [anon_sym_tostring] = ACTIONS(197), + [anon_sym_return] = ACTIONS(197), + [anon_sym_call] = ACTIONS(197), + [anon_sym_use] = ACTIONS(197), + [anon_sym_extern] = ACTIONS(197), + [anon_sym_getfield] = ACTIONS(197), + [anon_sym_setfield] = ACTIONS(197), + }, + [STATE(54)] = { + [sym_type_reference] = STATE(78), + [aux_sym_function_definition_repeat1] = STATE(54), + [sym_comment] = ACTIONS(3), + [anon_sym_AT] = ACTIONS(296), + [anon_sym_fun] = ACTIONS(296), + [anon_sym_endfun] = ACTIONS(296), + [anon_sym_struct] = ACTIONS(296), + [anon_sym_if] = ACTIONS(296), + [anon_sym_jump] = ACTIONS(296), + [anon_sym_end] = ACTIONS(298), + [anon_sym_input] = ACTIONS(296), + [anon_sym_print] = ACTIONS(298), + [anon_sym_println] = ACTIONS(296), + [anon_sym_set] = ACTIONS(298), + [anon_sym_init] = ACTIONS(296), + [anon_sym_gettype] = ACTIONS(296), + [anon_sym_exists] = ACTIONS(296), + [anon_sym_setlist] = ACTIONS(298), + [anon_sym_setlistat] = ACTIONS(296), + [anon_sym_getlistat] = ACTIONS(296), + [anon_sym_getlistsize] = ACTIONS(296), + [anon_sym_listappend] = ACTIONS(296), + [anon_sym_getstrsize] = ACTIONS(296), + [anon_sym_getstrcharat] = ACTIONS(296), + [anon_sym_add] = ACTIONS(296), + [anon_sym_subtract] = ACTIONS(296), + [anon_sym_multiply] = ACTIONS(296), + [anon_sym_divide] = ACTIONS(296), + [anon_sym_equal] = ACTIONS(296), + [anon_sym_inequal] = ACTIONS(296), + [anon_sym_not] = ACTIONS(296), + [anon_sym_greater] = ACTIONS(296), + [anon_sym_lesser] = ACTIONS(296), + [anon_sym_stoi] = ACTIONS(296), + [anon_sym_stod] = ACTIONS(296), + [anon_sym_tostring] = ACTIONS(296), + [anon_sym_return] = ACTIONS(296), + [anon_sym_call] = ACTIONS(296), + [anon_sym_use] = ACTIONS(296), + [anon_sym_extern] = ACTIONS(296), + [anon_sym_getfield] = ACTIONS(296), + [anon_sym_setfield] = ACTIONS(296), + [anon_sym_DASH] = ACTIONS(300), + }, + [STATE(55)] = { + [sym_comment] = ACTIONS(3), + [anon_sym_AT] = ACTIONS(303), + [anon_sym_fun] = ACTIONS(303), + [anon_sym_endfun] = ACTIONS(303), + [anon_sym_struct] = ACTIONS(303), + [anon_sym_if] = ACTIONS(303), + [anon_sym_jump] = ACTIONS(303), + [anon_sym_end] = ACTIONS(305), + [anon_sym_input] = ACTIONS(303), + [anon_sym_print] = ACTIONS(305), + [anon_sym_println] = ACTIONS(303), + [anon_sym_set] = ACTIONS(305), + [anon_sym_init] = ACTIONS(303), + [anon_sym_gettype] = ACTIONS(303), + [anon_sym_exists] = ACTIONS(303), + [anon_sym_setlist] = ACTIONS(305), + [anon_sym_setlistat] = ACTIONS(303), + [anon_sym_getlistat] = ACTIONS(303), + [anon_sym_getlistsize] = ACTIONS(303), + [anon_sym_listappend] = ACTIONS(303), + [anon_sym_getstrsize] = ACTIONS(303), + [anon_sym_getstrcharat] = ACTIONS(303), + [anon_sym_add] = ACTIONS(303), + [anon_sym_subtract] = ACTIONS(303), + [anon_sym_multiply] = ACTIONS(303), + [anon_sym_divide] = ACTIONS(303), + [anon_sym_equal] = ACTIONS(303), + [anon_sym_inequal] = ACTIONS(303), + [anon_sym_not] = ACTIONS(303), + [anon_sym_greater] = ACTIONS(303), + [anon_sym_lesser] = ACTIONS(303), + [anon_sym_stoi] = ACTIONS(303), + [anon_sym_stod] = ACTIONS(303), + [anon_sym_tostring] = ACTIONS(303), + [anon_sym_return] = ACTIONS(303), + [anon_sym_call] = ACTIONS(303), + [anon_sym_use] = ACTIONS(303), + [anon_sym_extern] = ACTIONS(303), + [anon_sym_getfield] = ACTIONS(303), + [anon_sym_setfield] = ACTIONS(303), + [anon_sym_DASH] = ACTIONS(303), + }, + [STATE(56)] = { + [sym_comment] = ACTIONS(3), + [anon_sym_AT] = ACTIONS(307), + [anon_sym_fun] = ACTIONS(307), + [anon_sym_endfun] = ACTIONS(307), + [anon_sym_struct] = ACTIONS(307), + [anon_sym_if] = ACTIONS(307), + [anon_sym_jump] = ACTIONS(307), + [anon_sym_end] = ACTIONS(309), + [anon_sym_input] = ACTIONS(307), + [anon_sym_print] = ACTIONS(309), + [anon_sym_println] = ACTIONS(307), + [anon_sym_set] = ACTIONS(309), + [anon_sym_init] = ACTIONS(307), + [anon_sym_gettype] = ACTIONS(307), + [anon_sym_exists] = ACTIONS(307), + [anon_sym_setlist] = ACTIONS(309), + [anon_sym_setlistat] = ACTIONS(307), + [anon_sym_getlistat] = ACTIONS(307), + [anon_sym_getlistsize] = ACTIONS(307), + [anon_sym_listappend] = ACTIONS(307), + [anon_sym_getstrsize] = ACTIONS(307), + [anon_sym_getstrcharat] = ACTIONS(307), + [anon_sym_add] = ACTIONS(307), + [anon_sym_subtract] = ACTIONS(307), + [anon_sym_multiply] = ACTIONS(307), + [anon_sym_divide] = ACTIONS(307), + [anon_sym_equal] = ACTIONS(307), + [anon_sym_inequal] = ACTIONS(307), + [anon_sym_not] = ACTIONS(307), + [anon_sym_greater] = ACTIONS(307), + [anon_sym_lesser] = ACTIONS(307), + [anon_sym_stoi] = ACTIONS(307), + [anon_sym_stod] = ACTIONS(307), + [anon_sym_tostring] = ACTIONS(307), + [anon_sym_return] = ACTIONS(307), + [anon_sym_call] = ACTIONS(307), + [anon_sym_use] = ACTIONS(307), + [anon_sym_extern] = ACTIONS(307), + [anon_sym_getfield] = ACTIONS(307), + [anon_sym_setfield] = ACTIONS(307), + }, + [STATE(57)] = { + [sym_comment] = ACTIONS(3), + [anon_sym_AT] = ACTIONS(311), + [anon_sym_fun] = ACTIONS(311), + [anon_sym_endfun] = ACTIONS(311), + [anon_sym_struct] = ACTIONS(311), + [anon_sym_if] = ACTIONS(311), + [anon_sym_jump] = ACTIONS(311), + [anon_sym_end] = ACTIONS(313), + [anon_sym_input] = ACTIONS(311), + [anon_sym_print] = ACTIONS(313), + [anon_sym_println] = ACTIONS(311), + [anon_sym_set] = ACTIONS(313), + [anon_sym_init] = ACTIONS(311), + [anon_sym_gettype] = ACTIONS(311), + [anon_sym_exists] = ACTIONS(311), + [anon_sym_setlist] = ACTIONS(313), + [anon_sym_setlistat] = ACTIONS(311), + [anon_sym_getlistat] = ACTIONS(311), + [anon_sym_getlistsize] = ACTIONS(311), + [anon_sym_listappend] = ACTIONS(311), + [anon_sym_getstrsize] = ACTIONS(311), + [anon_sym_getstrcharat] = ACTIONS(311), + [anon_sym_add] = ACTIONS(311), + [anon_sym_subtract] = ACTIONS(311), + [anon_sym_multiply] = ACTIONS(311), + [anon_sym_divide] = ACTIONS(311), + [anon_sym_equal] = ACTIONS(311), + [anon_sym_inequal] = ACTIONS(311), + [anon_sym_not] = ACTIONS(311), + [anon_sym_greater] = ACTIONS(311), + [anon_sym_lesser] = ACTIONS(311), + [anon_sym_stoi] = ACTIONS(311), + [anon_sym_stod] = ACTIONS(311), + [anon_sym_tostring] = ACTIONS(311), + [anon_sym_return] = ACTIONS(311), + [anon_sym_call] = ACTIONS(311), + [anon_sym_use] = ACTIONS(311), + [anon_sym_extern] = ACTIONS(311), + [anon_sym_getfield] = ACTIONS(311), + [anon_sym_setfield] = ACTIONS(311), + }, + [STATE(58)] = { + [sym_comment] = ACTIONS(3), + [anon_sym_AT] = ACTIONS(315), + [anon_sym_fun] = ACTIONS(315), + [anon_sym_struct] = ACTIONS(315), + [anon_sym_endstruct] = ACTIONS(315), + [anon_sym_if] = ACTIONS(315), + [anon_sym_jump] = ACTIONS(315), + [anon_sym_end] = ACTIONS(317), + [anon_sym_input] = ACTIONS(315), + [anon_sym_print] = ACTIONS(317), + [anon_sym_println] = ACTIONS(315), + [anon_sym_set] = ACTIONS(317), + [anon_sym_init] = ACTIONS(315), + [anon_sym_gettype] = ACTIONS(315), + [anon_sym_exists] = ACTIONS(315), + [anon_sym_setlist] = ACTIONS(317), + [anon_sym_setlistat] = ACTIONS(315), + [anon_sym_getlistat] = ACTIONS(315), + [anon_sym_getlistsize] = ACTIONS(315), + [anon_sym_listappend] = ACTIONS(315), + [anon_sym_getstrsize] = ACTIONS(315), + [anon_sym_getstrcharat] = ACTIONS(315), + [anon_sym_add] = ACTIONS(315), + [anon_sym_subtract] = ACTIONS(315), + [anon_sym_multiply] = ACTIONS(315), + [anon_sym_divide] = ACTIONS(315), + [anon_sym_equal] = ACTIONS(315), + [anon_sym_inequal] = ACTIONS(315), + [anon_sym_not] = ACTIONS(315), + [anon_sym_greater] = ACTIONS(315), + [anon_sym_lesser] = ACTIONS(315), + [anon_sym_stoi] = ACTIONS(315), + [anon_sym_stod] = ACTIONS(315), + [anon_sym_tostring] = ACTIONS(315), + [anon_sym_return] = ACTIONS(315), + [anon_sym_call] = ACTIONS(315), + [anon_sym_use] = ACTIONS(315), + [anon_sym_extern] = ACTIONS(315), + [anon_sym_getfield] = ACTIONS(315), + [anon_sym_setfield] = ACTIONS(315), + }, + [STATE(59)] = { + [sym_comment] = ACTIONS(3), + [anon_sym_AT] = ACTIONS(315), + [anon_sym_fun] = ACTIONS(315), + [anon_sym_endfun] = ACTIONS(315), + [anon_sym_struct] = ACTIONS(315), + [anon_sym_if] = ACTIONS(315), + [anon_sym_jump] = ACTIONS(315), + [anon_sym_end] = ACTIONS(317), + [anon_sym_input] = ACTIONS(315), + [anon_sym_print] = ACTIONS(317), + [anon_sym_println] = ACTIONS(315), + [anon_sym_set] = ACTIONS(317), + [anon_sym_init] = ACTIONS(315), + [anon_sym_gettype] = ACTIONS(315), + [anon_sym_exists] = ACTIONS(315), + [anon_sym_setlist] = ACTIONS(317), + [anon_sym_setlistat] = ACTIONS(315), + [anon_sym_getlistat] = ACTIONS(315), + [anon_sym_getlistsize] = ACTIONS(315), + [anon_sym_listappend] = ACTIONS(315), + [anon_sym_getstrsize] = ACTIONS(315), + [anon_sym_getstrcharat] = ACTIONS(315), + [anon_sym_add] = ACTIONS(315), + [anon_sym_subtract] = ACTIONS(315), + [anon_sym_multiply] = ACTIONS(315), + [anon_sym_divide] = ACTIONS(315), + [anon_sym_equal] = ACTIONS(315), + [anon_sym_inequal] = ACTIONS(315), + [anon_sym_not] = ACTIONS(315), + [anon_sym_greater] = ACTIONS(315), + [anon_sym_lesser] = ACTIONS(315), + [anon_sym_stoi] = ACTIONS(315), + [anon_sym_stod] = ACTIONS(315), + [anon_sym_tostring] = ACTIONS(315), + [anon_sym_return] = ACTIONS(315), + [anon_sym_call] = ACTIONS(315), + [anon_sym_use] = ACTIONS(315), + [anon_sym_extern] = ACTIONS(315), + [anon_sym_getfield] = ACTIONS(315), + [anon_sym_setfield] = ACTIONS(315), + }, + [STATE(60)] = { + [ts_builtin_sym_end] = ACTIONS(307), + [sym_comment] = ACTIONS(3), + [anon_sym_AT] = ACTIONS(307), + [anon_sym_fun] = ACTIONS(307), + [anon_sym_struct] = ACTIONS(307), + [anon_sym_if] = ACTIONS(307), + [anon_sym_jump] = ACTIONS(307), + [anon_sym_end] = ACTIONS(307), + [anon_sym_input] = ACTIONS(307), + [anon_sym_print] = ACTIONS(309), + [anon_sym_println] = ACTIONS(307), + [anon_sym_set] = ACTIONS(309), + [anon_sym_init] = ACTIONS(307), + [anon_sym_gettype] = ACTIONS(307), + [anon_sym_exists] = ACTIONS(307), + [anon_sym_setlist] = ACTIONS(309), + [anon_sym_setlistat] = ACTIONS(307), + [anon_sym_getlistat] = ACTIONS(307), + [anon_sym_getlistsize] = ACTIONS(307), + [anon_sym_listappend] = ACTIONS(307), + [anon_sym_getstrsize] = ACTIONS(307), + [anon_sym_getstrcharat] = ACTIONS(307), + [anon_sym_add] = ACTIONS(307), + [anon_sym_subtract] = ACTIONS(307), + [anon_sym_multiply] = ACTIONS(307), + [anon_sym_divide] = ACTIONS(307), + [anon_sym_equal] = ACTIONS(307), + [anon_sym_inequal] = ACTIONS(307), + [anon_sym_not] = ACTIONS(307), + [anon_sym_greater] = ACTIONS(307), + [anon_sym_lesser] = ACTIONS(307), + [anon_sym_stoi] = ACTIONS(307), + [anon_sym_stod] = ACTIONS(307), + [anon_sym_tostring] = ACTIONS(307), + [anon_sym_return] = ACTIONS(307), + [anon_sym_call] = ACTIONS(307), + [anon_sym_use] = ACTIONS(307), + [anon_sym_extern] = ACTIONS(307), + [anon_sym_getfield] = ACTIONS(307), + [anon_sym_setfield] = ACTIONS(307), + }, + [STATE(61)] = { + [sym_comment] = ACTIONS(3), + [anon_sym_AT] = ACTIONS(319), + [anon_sym_fun] = ACTIONS(319), + [anon_sym_endfun] = ACTIONS(319), + [anon_sym_struct] = ACTIONS(319), + [anon_sym_if] = ACTIONS(319), + [anon_sym_jump] = ACTIONS(319), + [anon_sym_end] = ACTIONS(321), + [anon_sym_input] = ACTIONS(319), + [anon_sym_print] = ACTIONS(321), + [anon_sym_println] = ACTIONS(319), + [anon_sym_set] = ACTIONS(321), + [anon_sym_init] = ACTIONS(319), + [anon_sym_gettype] = ACTIONS(319), + [anon_sym_exists] = ACTIONS(319), + [anon_sym_setlist] = ACTIONS(321), + [anon_sym_setlistat] = ACTIONS(319), + [anon_sym_getlistat] = ACTIONS(319), + [anon_sym_getlistsize] = ACTIONS(319), + [anon_sym_listappend] = ACTIONS(319), + [anon_sym_getstrsize] = ACTIONS(319), + [anon_sym_getstrcharat] = ACTIONS(319), + [anon_sym_add] = ACTIONS(319), + [anon_sym_subtract] = ACTIONS(319), + [anon_sym_multiply] = ACTIONS(319), + [anon_sym_divide] = ACTIONS(319), + [anon_sym_equal] = ACTIONS(319), + [anon_sym_inequal] = ACTIONS(319), + [anon_sym_not] = ACTIONS(319), + [anon_sym_greater] = ACTIONS(319), + [anon_sym_lesser] = ACTIONS(319), + [anon_sym_stoi] = ACTIONS(319), + [anon_sym_stod] = ACTIONS(319), + [anon_sym_tostring] = ACTIONS(319), + [anon_sym_return] = ACTIONS(319), + [anon_sym_call] = ACTIONS(319), + [anon_sym_use] = ACTIONS(319), + [anon_sym_extern] = ACTIONS(319), + [anon_sym_getfield] = ACTIONS(319), + [anon_sym_setfield] = ACTIONS(319), + }, + [STATE(62)] = { + [ts_builtin_sym_end] = ACTIONS(315), + [sym_comment] = ACTIONS(3), + [anon_sym_AT] = ACTIONS(315), + [anon_sym_fun] = ACTIONS(315), + [anon_sym_struct] = ACTIONS(315), + [anon_sym_if] = ACTIONS(315), + [anon_sym_jump] = ACTIONS(315), + [anon_sym_end] = ACTIONS(315), + [anon_sym_input] = ACTIONS(315), + [anon_sym_print] = ACTIONS(317), + [anon_sym_println] = ACTIONS(315), + [anon_sym_set] = ACTIONS(317), + [anon_sym_init] = ACTIONS(315), + [anon_sym_gettype] = ACTIONS(315), + [anon_sym_exists] = ACTIONS(315), + [anon_sym_setlist] = ACTIONS(317), + [anon_sym_setlistat] = ACTIONS(315), + [anon_sym_getlistat] = ACTIONS(315), + [anon_sym_getlistsize] = ACTIONS(315), + [anon_sym_listappend] = ACTIONS(315), + [anon_sym_getstrsize] = ACTIONS(315), + [anon_sym_getstrcharat] = ACTIONS(315), + [anon_sym_add] = ACTIONS(315), + [anon_sym_subtract] = ACTIONS(315), + [anon_sym_multiply] = ACTIONS(315), + [anon_sym_divide] = ACTIONS(315), + [anon_sym_equal] = ACTIONS(315), + [anon_sym_inequal] = ACTIONS(315), + [anon_sym_not] = ACTIONS(315), + [anon_sym_greater] = ACTIONS(315), + [anon_sym_lesser] = ACTIONS(315), + [anon_sym_stoi] = ACTIONS(315), + [anon_sym_stod] = ACTIONS(315), + [anon_sym_tostring] = ACTIONS(315), + [anon_sym_return] = ACTIONS(315), + [anon_sym_call] = ACTIONS(315), + [anon_sym_use] = ACTIONS(315), + [anon_sym_extern] = ACTIONS(315), + [anon_sym_getfield] = ACTIONS(315), + [anon_sym_setfield] = ACTIONS(315), + }, + [STATE(63)] = { + [sym_comment] = ACTIONS(3), + [anon_sym_AT] = ACTIONS(323), + [anon_sym_fun] = ACTIONS(323), + [anon_sym_endfun] = ACTIONS(323), + [anon_sym_struct] = ACTIONS(323), + [anon_sym_if] = ACTIONS(323), + [anon_sym_jump] = ACTIONS(323), + [anon_sym_end] = ACTIONS(325), + [anon_sym_input] = ACTIONS(323), + [anon_sym_print] = ACTIONS(325), + [anon_sym_println] = ACTIONS(323), + [anon_sym_set] = ACTIONS(325), + [anon_sym_init] = ACTIONS(323), + [anon_sym_gettype] = ACTIONS(323), + [anon_sym_exists] = ACTIONS(323), + [anon_sym_setlist] = ACTIONS(325), + [anon_sym_setlistat] = ACTIONS(323), + [anon_sym_getlistat] = ACTIONS(323), + [anon_sym_getlistsize] = ACTIONS(323), + [anon_sym_listappend] = ACTIONS(323), + [anon_sym_getstrsize] = ACTIONS(323), + [anon_sym_getstrcharat] = ACTIONS(323), + [anon_sym_add] = ACTIONS(323), + [anon_sym_subtract] = ACTIONS(323), + [anon_sym_multiply] = ACTIONS(323), + [anon_sym_divide] = ACTIONS(323), + [anon_sym_equal] = ACTIONS(323), + [anon_sym_inequal] = ACTIONS(323), + [anon_sym_not] = ACTIONS(323), + [anon_sym_greater] = ACTIONS(323), + [anon_sym_lesser] = ACTIONS(323), + [anon_sym_stoi] = ACTIONS(323), + [anon_sym_stod] = ACTIONS(323), + [anon_sym_tostring] = ACTIONS(323), + [anon_sym_return] = ACTIONS(323), + [anon_sym_call] = ACTIONS(323), + [anon_sym_use] = ACTIONS(323), + [anon_sym_extern] = ACTIONS(323), + [anon_sym_getfield] = ACTIONS(323), + [anon_sym_setfield] = ACTIONS(323), + }, + [STATE(64)] = { + [ts_builtin_sym_end] = ACTIONS(319), + [sym_comment] = ACTIONS(3), + [anon_sym_AT] = ACTIONS(319), + [anon_sym_fun] = ACTIONS(319), + [anon_sym_struct] = ACTIONS(319), + [anon_sym_if] = ACTIONS(319), + [anon_sym_jump] = ACTIONS(319), + [anon_sym_end] = ACTIONS(319), + [anon_sym_input] = ACTIONS(319), + [anon_sym_print] = ACTIONS(321), + [anon_sym_println] = ACTIONS(319), + [anon_sym_set] = ACTIONS(321), + [anon_sym_init] = ACTIONS(319), + [anon_sym_gettype] = ACTIONS(319), + [anon_sym_exists] = ACTIONS(319), + [anon_sym_setlist] = ACTIONS(321), + [anon_sym_setlistat] = ACTIONS(319), + [anon_sym_getlistat] = ACTIONS(319), + [anon_sym_getlistsize] = ACTIONS(319), + [anon_sym_listappend] = ACTIONS(319), + [anon_sym_getstrsize] = ACTIONS(319), + [anon_sym_getstrcharat] = ACTIONS(319), + [anon_sym_add] = ACTIONS(319), + [anon_sym_subtract] = ACTIONS(319), + [anon_sym_multiply] = ACTIONS(319), + [anon_sym_divide] = ACTIONS(319), + [anon_sym_equal] = ACTIONS(319), + [anon_sym_inequal] = ACTIONS(319), + [anon_sym_not] = ACTIONS(319), + [anon_sym_greater] = ACTIONS(319), + [anon_sym_lesser] = ACTIONS(319), + [anon_sym_stoi] = ACTIONS(319), + [anon_sym_stod] = ACTIONS(319), + [anon_sym_tostring] = ACTIONS(319), + [anon_sym_return] = ACTIONS(319), + [anon_sym_call] = ACTIONS(319), + [anon_sym_use] = ACTIONS(319), + [anon_sym_extern] = ACTIONS(319), + [anon_sym_getfield] = ACTIONS(319), + [anon_sym_setfield] = ACTIONS(319), + }, + [STATE(65)] = { + [sym_comment] = ACTIONS(3), + [anon_sym_AT] = ACTIONS(323), + [anon_sym_fun] = ACTIONS(323), + [anon_sym_struct] = ACTIONS(323), + [anon_sym_endstruct] = ACTIONS(323), + [anon_sym_if] = ACTIONS(323), + [anon_sym_jump] = ACTIONS(323), + [anon_sym_end] = ACTIONS(325), + [anon_sym_input] = ACTIONS(323), + [anon_sym_print] = ACTIONS(325), + [anon_sym_println] = ACTIONS(323), + [anon_sym_set] = ACTIONS(325), + [anon_sym_init] = ACTIONS(323), + [anon_sym_gettype] = ACTIONS(323), + [anon_sym_exists] = ACTIONS(323), + [anon_sym_setlist] = ACTIONS(325), + [anon_sym_setlistat] = ACTIONS(323), + [anon_sym_getlistat] = ACTIONS(323), + [anon_sym_getlistsize] = ACTIONS(323), + [anon_sym_listappend] = ACTIONS(323), + [anon_sym_getstrsize] = ACTIONS(323), + [anon_sym_getstrcharat] = ACTIONS(323), + [anon_sym_add] = ACTIONS(323), + [anon_sym_subtract] = ACTIONS(323), + [anon_sym_multiply] = ACTIONS(323), + [anon_sym_divide] = ACTIONS(323), + [anon_sym_equal] = ACTIONS(323), + [anon_sym_inequal] = ACTIONS(323), + [anon_sym_not] = ACTIONS(323), + [anon_sym_greater] = ACTIONS(323), + [anon_sym_lesser] = ACTIONS(323), + [anon_sym_stoi] = ACTIONS(323), + [anon_sym_stod] = ACTIONS(323), + [anon_sym_tostring] = ACTIONS(323), + [anon_sym_return] = ACTIONS(323), + [anon_sym_call] = ACTIONS(323), + [anon_sym_use] = ACTIONS(323), + [anon_sym_extern] = ACTIONS(323), + [anon_sym_getfield] = ACTIONS(323), + [anon_sym_setfield] = ACTIONS(323), + }, + [STATE(66)] = { + [ts_builtin_sym_end] = ACTIONS(311), + [sym_comment] = ACTIONS(3), + [anon_sym_AT] = ACTIONS(311), + [anon_sym_fun] = ACTIONS(311), + [anon_sym_struct] = ACTIONS(311), + [anon_sym_if] = ACTIONS(311), + [anon_sym_jump] = ACTIONS(311), + [anon_sym_end] = ACTIONS(311), + [anon_sym_input] = ACTIONS(311), + [anon_sym_print] = ACTIONS(313), + [anon_sym_println] = ACTIONS(311), + [anon_sym_set] = ACTIONS(313), + [anon_sym_init] = ACTIONS(311), + [anon_sym_gettype] = ACTIONS(311), + [anon_sym_exists] = ACTIONS(311), + [anon_sym_setlist] = ACTIONS(313), + [anon_sym_setlistat] = ACTIONS(311), + [anon_sym_getlistat] = ACTIONS(311), + [anon_sym_getlistsize] = ACTIONS(311), + [anon_sym_listappend] = ACTIONS(311), + [anon_sym_getstrsize] = ACTIONS(311), + [anon_sym_getstrcharat] = ACTIONS(311), + [anon_sym_add] = ACTIONS(311), + [anon_sym_subtract] = ACTIONS(311), + [anon_sym_multiply] = ACTIONS(311), + [anon_sym_divide] = ACTIONS(311), + [anon_sym_equal] = ACTIONS(311), + [anon_sym_inequal] = ACTIONS(311), + [anon_sym_not] = ACTIONS(311), + [anon_sym_greater] = ACTIONS(311), + [anon_sym_lesser] = ACTIONS(311), + [anon_sym_stoi] = ACTIONS(311), + [anon_sym_stod] = ACTIONS(311), + [anon_sym_tostring] = ACTIONS(311), + [anon_sym_return] = ACTIONS(311), + [anon_sym_call] = ACTIONS(311), + [anon_sym_use] = ACTIONS(311), + [anon_sym_extern] = ACTIONS(311), + [anon_sym_getfield] = ACTIONS(311), + [anon_sym_setfield] = ACTIONS(311), + }, + [STATE(67)] = { + [sym_comment] = ACTIONS(3), + [anon_sym_AT] = ACTIONS(327), + [anon_sym_fun] = ACTIONS(327), + [anon_sym_endfun] = ACTIONS(327), + [anon_sym_struct] = ACTIONS(327), + [anon_sym_if] = ACTIONS(327), + [anon_sym_jump] = ACTIONS(327), + [anon_sym_end] = ACTIONS(329), + [anon_sym_input] = ACTIONS(327), + [anon_sym_print] = ACTIONS(329), + [anon_sym_println] = ACTIONS(327), + [anon_sym_set] = ACTIONS(329), + [anon_sym_init] = ACTIONS(327), + [anon_sym_gettype] = ACTIONS(327), + [anon_sym_exists] = ACTIONS(327), + [anon_sym_setlist] = ACTIONS(329), + [anon_sym_setlistat] = ACTIONS(327), + [anon_sym_getlistat] = ACTIONS(327), + [anon_sym_getlistsize] = ACTIONS(327), + [anon_sym_listappend] = ACTIONS(327), + [anon_sym_getstrsize] = ACTIONS(327), + [anon_sym_getstrcharat] = ACTIONS(327), + [anon_sym_add] = ACTIONS(327), + [anon_sym_subtract] = ACTIONS(327), + [anon_sym_multiply] = ACTIONS(327), + [anon_sym_divide] = ACTIONS(327), + [anon_sym_equal] = ACTIONS(327), + [anon_sym_inequal] = ACTIONS(327), + [anon_sym_not] = ACTIONS(327), + [anon_sym_greater] = ACTIONS(327), + [anon_sym_lesser] = ACTIONS(327), + [anon_sym_stoi] = ACTIONS(327), + [anon_sym_stod] = ACTIONS(327), + [anon_sym_tostring] = ACTIONS(327), + [anon_sym_return] = ACTIONS(327), + [anon_sym_call] = ACTIONS(327), + [anon_sym_use] = ACTIONS(327), + [anon_sym_extern] = ACTIONS(327), + [anon_sym_getfield] = ACTIONS(327), + [anon_sym_setfield] = ACTIONS(327), + }, + [STATE(68)] = { + [sym_comment] = ACTIONS(3), + [anon_sym_AT] = ACTIONS(331), + [anon_sym_fun] = ACTIONS(331), + [anon_sym_endfun] = ACTIONS(331), + [anon_sym_struct] = ACTIONS(331), + [anon_sym_if] = ACTIONS(331), + [anon_sym_jump] = ACTIONS(331), + [anon_sym_end] = ACTIONS(333), + [anon_sym_input] = ACTIONS(331), + [anon_sym_print] = ACTIONS(333), + [anon_sym_println] = ACTIONS(331), + [anon_sym_set] = ACTIONS(333), + [anon_sym_init] = ACTIONS(331), + [anon_sym_gettype] = ACTIONS(331), + [anon_sym_exists] = ACTIONS(331), + [anon_sym_setlist] = ACTIONS(333), + [anon_sym_setlistat] = ACTIONS(331), + [anon_sym_getlistat] = ACTIONS(331), + [anon_sym_getlistsize] = ACTIONS(331), + [anon_sym_listappend] = ACTIONS(331), + [anon_sym_getstrsize] = ACTIONS(331), + [anon_sym_getstrcharat] = ACTIONS(331), + [anon_sym_add] = ACTIONS(331), + [anon_sym_subtract] = ACTIONS(331), + [anon_sym_multiply] = ACTIONS(331), + [anon_sym_divide] = ACTIONS(331), + [anon_sym_equal] = ACTIONS(331), + [anon_sym_inequal] = ACTIONS(331), + [anon_sym_not] = ACTIONS(331), + [anon_sym_greater] = ACTIONS(331), + [anon_sym_lesser] = ACTIONS(331), + [anon_sym_stoi] = ACTIONS(331), + [anon_sym_stod] = ACTIONS(331), + [anon_sym_tostring] = ACTIONS(331), + [anon_sym_return] = ACTIONS(331), + [anon_sym_call] = ACTIONS(331), + [anon_sym_use] = ACTIONS(331), + [anon_sym_extern] = ACTIONS(331), + [anon_sym_getfield] = ACTIONS(331), + [anon_sym_setfield] = ACTIONS(331), + }, + [STATE(69)] = { + [ts_builtin_sym_end] = ACTIONS(327), + [sym_comment] = ACTIONS(3), + [anon_sym_AT] = ACTIONS(327), + [anon_sym_fun] = ACTIONS(327), + [anon_sym_struct] = ACTIONS(327), + [anon_sym_if] = ACTIONS(327), + [anon_sym_jump] = ACTIONS(327), + [anon_sym_end] = ACTIONS(327), + [anon_sym_input] = ACTIONS(327), + [anon_sym_print] = ACTIONS(329), + [anon_sym_println] = ACTIONS(327), + [anon_sym_set] = ACTIONS(329), + [anon_sym_init] = ACTIONS(327), + [anon_sym_gettype] = ACTIONS(327), + [anon_sym_exists] = ACTIONS(327), + [anon_sym_setlist] = ACTIONS(329), + [anon_sym_setlistat] = ACTIONS(327), + [anon_sym_getlistat] = ACTIONS(327), + [anon_sym_getlistsize] = ACTIONS(327), + [anon_sym_listappend] = ACTIONS(327), + [anon_sym_getstrsize] = ACTIONS(327), + [anon_sym_getstrcharat] = ACTIONS(327), + [anon_sym_add] = ACTIONS(327), + [anon_sym_subtract] = ACTIONS(327), + [anon_sym_multiply] = ACTIONS(327), + [anon_sym_divide] = ACTIONS(327), + [anon_sym_equal] = ACTIONS(327), + [anon_sym_inequal] = ACTIONS(327), + [anon_sym_not] = ACTIONS(327), + [anon_sym_greater] = ACTIONS(327), + [anon_sym_lesser] = ACTIONS(327), + [anon_sym_stoi] = ACTIONS(327), + [anon_sym_stod] = ACTIONS(327), + [anon_sym_tostring] = ACTIONS(327), + [anon_sym_return] = ACTIONS(327), + [anon_sym_call] = ACTIONS(327), + [anon_sym_use] = ACTIONS(327), + [anon_sym_extern] = ACTIONS(327), + [anon_sym_getfield] = ACTIONS(327), + [anon_sym_setfield] = ACTIONS(327), + }, + [STATE(70)] = { + [ts_builtin_sym_end] = ACTIONS(323), + [sym_comment] = ACTIONS(3), + [anon_sym_AT] = ACTIONS(323), + [anon_sym_fun] = ACTIONS(323), + [anon_sym_struct] = ACTIONS(323), + [anon_sym_if] = ACTIONS(323), + [anon_sym_jump] = ACTIONS(323), + [anon_sym_end] = ACTIONS(323), + [anon_sym_input] = ACTIONS(323), + [anon_sym_print] = ACTIONS(325), + [anon_sym_println] = ACTIONS(323), + [anon_sym_set] = ACTIONS(325), + [anon_sym_init] = ACTIONS(323), + [anon_sym_gettype] = ACTIONS(323), + [anon_sym_exists] = ACTIONS(323), + [anon_sym_setlist] = ACTIONS(325), + [anon_sym_setlistat] = ACTIONS(323), + [anon_sym_getlistat] = ACTIONS(323), + [anon_sym_getlistsize] = ACTIONS(323), + [anon_sym_listappend] = ACTIONS(323), + [anon_sym_getstrsize] = ACTIONS(323), + [anon_sym_getstrcharat] = ACTIONS(323), + [anon_sym_add] = ACTIONS(323), + [anon_sym_subtract] = ACTIONS(323), + [anon_sym_multiply] = ACTIONS(323), + [anon_sym_divide] = ACTIONS(323), + [anon_sym_equal] = ACTIONS(323), + [anon_sym_inequal] = ACTIONS(323), + [anon_sym_not] = ACTIONS(323), + [anon_sym_greater] = ACTIONS(323), + [anon_sym_lesser] = ACTIONS(323), + [anon_sym_stoi] = ACTIONS(323), + [anon_sym_stod] = ACTIONS(323), + [anon_sym_tostring] = ACTIONS(323), + [anon_sym_return] = ACTIONS(323), + [anon_sym_call] = ACTIONS(323), + [anon_sym_use] = ACTIONS(323), + [anon_sym_extern] = ACTIONS(323), + [anon_sym_getfield] = ACTIONS(323), + [anon_sym_setfield] = ACTIONS(323), + }, + [STATE(71)] = { + [sym_comment] = ACTIONS(3), + [anon_sym_AT] = ACTIONS(331), + [anon_sym_fun] = ACTIONS(331), + [anon_sym_struct] = ACTIONS(331), + [anon_sym_endstruct] = ACTIONS(331), + [anon_sym_if] = ACTIONS(331), + [anon_sym_jump] = ACTIONS(331), + [anon_sym_end] = ACTIONS(333), + [anon_sym_input] = ACTIONS(331), + [anon_sym_print] = ACTIONS(333), + [anon_sym_println] = ACTIONS(331), + [anon_sym_set] = ACTIONS(333), + [anon_sym_init] = ACTIONS(331), + [anon_sym_gettype] = ACTIONS(331), + [anon_sym_exists] = ACTIONS(331), + [anon_sym_setlist] = ACTIONS(333), + [anon_sym_setlistat] = ACTIONS(331), + [anon_sym_getlistat] = ACTIONS(331), + [anon_sym_getlistsize] = ACTIONS(331), + [anon_sym_listappend] = ACTIONS(331), + [anon_sym_getstrsize] = ACTIONS(331), + [anon_sym_getstrcharat] = ACTIONS(331), + [anon_sym_add] = ACTIONS(331), + [anon_sym_subtract] = ACTIONS(331), + [anon_sym_multiply] = ACTIONS(331), + [anon_sym_divide] = ACTIONS(331), + [anon_sym_equal] = ACTIONS(331), + [anon_sym_inequal] = ACTIONS(331), + [anon_sym_not] = ACTIONS(331), + [anon_sym_greater] = ACTIONS(331), + [anon_sym_lesser] = ACTIONS(331), + [anon_sym_stoi] = ACTIONS(331), + [anon_sym_stod] = ACTIONS(331), + [anon_sym_tostring] = ACTIONS(331), + [anon_sym_return] = ACTIONS(331), + [anon_sym_call] = ACTIONS(331), + [anon_sym_use] = ACTIONS(331), + [anon_sym_extern] = ACTIONS(331), + [anon_sym_getfield] = ACTIONS(331), + [anon_sym_setfield] = ACTIONS(331), + }, + [STATE(72)] = { + [sym_comment] = ACTIONS(3), + [anon_sym_AT] = ACTIONS(327), + [anon_sym_fun] = ACTIONS(327), + [anon_sym_struct] = ACTIONS(327), + [anon_sym_endstruct] = ACTIONS(327), + [anon_sym_if] = ACTIONS(327), + [anon_sym_jump] = ACTIONS(327), + [anon_sym_end] = ACTIONS(329), + [anon_sym_input] = ACTIONS(327), + [anon_sym_print] = ACTIONS(329), + [anon_sym_println] = ACTIONS(327), + [anon_sym_set] = ACTIONS(329), + [anon_sym_init] = ACTIONS(327), + [anon_sym_gettype] = ACTIONS(327), + [anon_sym_exists] = ACTIONS(327), + [anon_sym_setlist] = ACTIONS(329), + [anon_sym_setlistat] = ACTIONS(327), + [anon_sym_getlistat] = ACTIONS(327), + [anon_sym_getlistsize] = ACTIONS(327), + [anon_sym_listappend] = ACTIONS(327), + [anon_sym_getstrsize] = ACTIONS(327), + [anon_sym_getstrcharat] = ACTIONS(327), + [anon_sym_add] = ACTIONS(327), + [anon_sym_subtract] = ACTIONS(327), + [anon_sym_multiply] = ACTIONS(327), + [anon_sym_divide] = ACTIONS(327), + [anon_sym_equal] = ACTIONS(327), + [anon_sym_inequal] = ACTIONS(327), + [anon_sym_not] = ACTIONS(327), + [anon_sym_greater] = ACTIONS(327), + [anon_sym_lesser] = ACTIONS(327), + [anon_sym_stoi] = ACTIONS(327), + [anon_sym_stod] = ACTIONS(327), + [anon_sym_tostring] = ACTIONS(327), + [anon_sym_return] = ACTIONS(327), + [anon_sym_call] = ACTIONS(327), + [anon_sym_use] = ACTIONS(327), + [anon_sym_extern] = ACTIONS(327), + [anon_sym_getfield] = ACTIONS(327), + [anon_sym_setfield] = ACTIONS(327), + }, + [STATE(73)] = { + [sym_comment] = ACTIONS(3), + [anon_sym_AT] = ACTIONS(307), + [anon_sym_fun] = ACTIONS(307), + [anon_sym_struct] = ACTIONS(307), + [anon_sym_endstruct] = ACTIONS(307), + [anon_sym_if] = ACTIONS(307), + [anon_sym_jump] = ACTIONS(307), + [anon_sym_end] = ACTIONS(309), + [anon_sym_input] = ACTIONS(307), + [anon_sym_print] = ACTIONS(309), + [anon_sym_println] = ACTIONS(307), + [anon_sym_set] = ACTIONS(309), + [anon_sym_init] = ACTIONS(307), + [anon_sym_gettype] = ACTIONS(307), + [anon_sym_exists] = ACTIONS(307), + [anon_sym_setlist] = ACTIONS(309), + [anon_sym_setlistat] = ACTIONS(307), + [anon_sym_getlistat] = ACTIONS(307), + [anon_sym_getlistsize] = ACTIONS(307), + [anon_sym_listappend] = ACTIONS(307), + [anon_sym_getstrsize] = ACTIONS(307), + [anon_sym_getstrcharat] = ACTIONS(307), + [anon_sym_add] = ACTIONS(307), + [anon_sym_subtract] = ACTIONS(307), + [anon_sym_multiply] = ACTIONS(307), + [anon_sym_divide] = ACTIONS(307), + [anon_sym_equal] = ACTIONS(307), + [anon_sym_inequal] = ACTIONS(307), + [anon_sym_not] = ACTIONS(307), + [anon_sym_greater] = ACTIONS(307), + [anon_sym_lesser] = ACTIONS(307), + [anon_sym_stoi] = ACTIONS(307), + [anon_sym_stod] = ACTIONS(307), + [anon_sym_tostring] = ACTIONS(307), + [anon_sym_return] = ACTIONS(307), + [anon_sym_call] = ACTIONS(307), + [anon_sym_use] = ACTIONS(307), + [anon_sym_extern] = ACTIONS(307), + [anon_sym_getfield] = ACTIONS(307), + [anon_sym_setfield] = ACTIONS(307), + }, + [STATE(74)] = { + [sym_comment] = ACTIONS(3), + [anon_sym_AT] = ACTIONS(319), + [anon_sym_fun] = ACTIONS(319), + [anon_sym_struct] = ACTIONS(319), + [anon_sym_endstruct] = ACTIONS(319), + [anon_sym_if] = ACTIONS(319), + [anon_sym_jump] = ACTIONS(319), + [anon_sym_end] = ACTIONS(321), + [anon_sym_input] = ACTIONS(319), + [anon_sym_print] = ACTIONS(321), + [anon_sym_println] = ACTIONS(319), + [anon_sym_set] = ACTIONS(321), + [anon_sym_init] = ACTIONS(319), + [anon_sym_gettype] = ACTIONS(319), + [anon_sym_exists] = ACTIONS(319), + [anon_sym_setlist] = ACTIONS(321), + [anon_sym_setlistat] = ACTIONS(319), + [anon_sym_getlistat] = ACTIONS(319), + [anon_sym_getlistsize] = ACTIONS(319), + [anon_sym_listappend] = ACTIONS(319), + [anon_sym_getstrsize] = ACTIONS(319), + [anon_sym_getstrcharat] = ACTIONS(319), + [anon_sym_add] = ACTIONS(319), + [anon_sym_subtract] = ACTIONS(319), + [anon_sym_multiply] = ACTIONS(319), + [anon_sym_divide] = ACTIONS(319), + [anon_sym_equal] = ACTIONS(319), + [anon_sym_inequal] = ACTIONS(319), + [anon_sym_not] = ACTIONS(319), + [anon_sym_greater] = ACTIONS(319), + [anon_sym_lesser] = ACTIONS(319), + [anon_sym_stoi] = ACTIONS(319), + [anon_sym_stod] = ACTIONS(319), + [anon_sym_tostring] = ACTIONS(319), + [anon_sym_return] = ACTIONS(319), + [anon_sym_call] = ACTIONS(319), + [anon_sym_use] = ACTIONS(319), + [anon_sym_extern] = ACTIONS(319), + [anon_sym_getfield] = ACTIONS(319), + [anon_sym_setfield] = ACTIONS(319), + }, + [STATE(75)] = { + [sym_comment] = ACTIONS(3), + [anon_sym_AT] = ACTIONS(311), + [anon_sym_fun] = ACTIONS(311), + [anon_sym_struct] = ACTIONS(311), + [anon_sym_endstruct] = ACTIONS(311), + [anon_sym_if] = ACTIONS(311), + [anon_sym_jump] = ACTIONS(311), + [anon_sym_end] = ACTIONS(313), + [anon_sym_input] = ACTIONS(311), + [anon_sym_print] = ACTIONS(313), + [anon_sym_println] = ACTIONS(311), + [anon_sym_set] = ACTIONS(313), + [anon_sym_init] = ACTIONS(311), + [anon_sym_gettype] = ACTIONS(311), + [anon_sym_exists] = ACTIONS(311), + [anon_sym_setlist] = ACTIONS(313), + [anon_sym_setlistat] = ACTIONS(311), + [anon_sym_getlistat] = ACTIONS(311), + [anon_sym_getlistsize] = ACTIONS(311), + [anon_sym_listappend] = ACTIONS(311), + [anon_sym_getstrsize] = ACTIONS(311), + [anon_sym_getstrcharat] = ACTIONS(311), + [anon_sym_add] = ACTIONS(311), + [anon_sym_subtract] = ACTIONS(311), + [anon_sym_multiply] = ACTIONS(311), + [anon_sym_divide] = ACTIONS(311), + [anon_sym_equal] = ACTIONS(311), + [anon_sym_inequal] = ACTIONS(311), + [anon_sym_not] = ACTIONS(311), + [anon_sym_greater] = ACTIONS(311), + [anon_sym_lesser] = ACTIONS(311), + [anon_sym_stoi] = ACTIONS(311), + [anon_sym_stod] = ACTIONS(311), + [anon_sym_tostring] = ACTIONS(311), + [anon_sym_return] = ACTIONS(311), + [anon_sym_call] = ACTIONS(311), + [anon_sym_use] = ACTIONS(311), + [anon_sym_extern] = ACTIONS(311), + [anon_sym_getfield] = ACTIONS(311), + [anon_sym_setfield] = ACTIONS(311), + }, + [STATE(76)] = { + [ts_builtin_sym_end] = ACTIONS(331), + [sym_comment] = ACTIONS(3), + [anon_sym_AT] = ACTIONS(331), + [anon_sym_fun] = ACTIONS(331), + [anon_sym_struct] = ACTIONS(331), + [anon_sym_if] = ACTIONS(331), + [anon_sym_jump] = ACTIONS(331), + [anon_sym_end] = ACTIONS(331), + [anon_sym_input] = ACTIONS(331), + [anon_sym_print] = ACTIONS(333), + [anon_sym_println] = ACTIONS(331), + [anon_sym_set] = ACTIONS(333), + [anon_sym_init] = ACTIONS(331), + [anon_sym_gettype] = ACTIONS(331), + [anon_sym_exists] = ACTIONS(331), + [anon_sym_setlist] = ACTIONS(333), + [anon_sym_setlistat] = ACTIONS(331), + [anon_sym_getlistat] = ACTIONS(331), + [anon_sym_getlistsize] = ACTIONS(331), + [anon_sym_listappend] = ACTIONS(331), + [anon_sym_getstrsize] = ACTIONS(331), + [anon_sym_getstrcharat] = ACTIONS(331), + [anon_sym_add] = ACTIONS(331), + [anon_sym_subtract] = ACTIONS(331), + [anon_sym_multiply] = ACTIONS(331), + [anon_sym_divide] = ACTIONS(331), + [anon_sym_equal] = ACTIONS(331), + [anon_sym_inequal] = ACTIONS(331), + [anon_sym_not] = ACTIONS(331), + [anon_sym_greater] = ACTIONS(331), + [anon_sym_lesser] = ACTIONS(331), + [anon_sym_stoi] = ACTIONS(331), + [anon_sym_stod] = ACTIONS(331), + [anon_sym_tostring] = ACTIONS(331), + [anon_sym_return] = ACTIONS(331), + [anon_sym_call] = ACTIONS(331), + [anon_sym_use] = ACTIONS(331), + [anon_sym_extern] = ACTIONS(331), + [anon_sym_getfield] = ACTIONS(331), + [anon_sym_setfield] = ACTIONS(331), + }, +}; + +static const uint16_t ts_small_parse_table[] = { + [0] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(201), 1, + anon_sym_DASH, + STATE(44), 1, + sym_type_reference, + [10] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(143), 1, + anon_sym_AMP, + STATE(55), 1, + sym_direct_reference, + [20] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(27), 1, + anon_sym_BANG, + STATE(85), 1, + sym_function_reference, + [30] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(27), 1, + anon_sym_BANG, + STATE(81), 1, + sym_function_reference, + [40] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(335), 1, + anon_sym_DASH, + STATE(34), 1, + sym_type_reference, + [50] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(201), 1, + anon_sym_DASH, + STATE(48), 1, + sym_type_reference, + [60] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(335), 1, + anon_sym_DASH, + STATE(35), 1, + sym_type_reference, + [70] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(201), 1, + anon_sym_DASH, + STATE(51), 1, + sym_type_reference, + [80] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(335), 1, + anon_sym_DASH, + STATE(37), 1, + sym_type_reference, + [90] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(27), 1, + anon_sym_BANG, + STATE(83), 1, + sym_function_reference, + [100] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(337), 1, + sym_identifier, + [107] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(339), 1, + sym_identifier, + [114] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(341), 1, + sym_identifier, + [121] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(343), 1, + sym_identifier, + [128] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(345), 1, + sym_identifier, + [135] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(347), 1, + sym_identifier, + [142] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(349), 1, + sym_identifier, + [149] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(351), 1, + sym_identifier, + [156] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(353), 1, + sym_identifier, + [163] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(355), 1, + sym_identifier, + [170] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(357), 1, + sym_identifier, + [177] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(359), 1, + sym_identifier, + [184] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(361), 1, + sym_identifier, + [191] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(363), 1, + sym_identifier, + [198] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(365), 1, + sym_identifier, + [205] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(367), 1, + ts_builtin_sym_end, + [212] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(369), 1, + sym_identifier, + [219] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(371), 1, + sym_identifier, + [226] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(373), 1, + sym_identifier, +}; + +static const uint32_t ts_small_parse_table_map[] = { + [SMALL_STATE(77)] = 0, + [SMALL_STATE(78)] = 10, + [SMALL_STATE(79)] = 20, + [SMALL_STATE(80)] = 30, + [SMALL_STATE(81)] = 40, + [SMALL_STATE(82)] = 50, + [SMALL_STATE(83)] = 60, + [SMALL_STATE(84)] = 70, + [SMALL_STATE(85)] = 80, + [SMALL_STATE(86)] = 90, + [SMALL_STATE(87)] = 100, + [SMALL_STATE(88)] = 107, + [SMALL_STATE(89)] = 114, + [SMALL_STATE(90)] = 121, + [SMALL_STATE(91)] = 128, + [SMALL_STATE(92)] = 135, + [SMALL_STATE(93)] = 142, + [SMALL_STATE(94)] = 149, + [SMALL_STATE(95)] = 156, + [SMALL_STATE(96)] = 163, + [SMALL_STATE(97)] = 170, + [SMALL_STATE(98)] = 177, + [SMALL_STATE(99)] = 184, + [SMALL_STATE(100)] = 191, + [SMALL_STATE(101)] = 198, + [SMALL_STATE(102)] = 205, + [SMALL_STATE(103)] = 212, + [SMALL_STATE(104)] = 219, + [SMALL_STATE(105)] = 226, +}; + +static const TSParseActionEntry ts_parse_actions[] = { + [0] = {.entry = {.count = 0, .reusable = false}}, + [1] = {.entry = {.count = 1, .reusable = false}}, RECOVER(), + [3] = {.entry = {.count = 1, .reusable = true}}, SHIFT_EXTRA(), + [5] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source_file, 0, 0, 0), + [7] = {.entry = {.count = 1, .reusable = true}}, SHIFT(101), + [9] = {.entry = {.count = 1, .reusable = true}}, SHIFT(80), + [11] = {.entry = {.count = 1, .reusable = true}}, SHIFT(77), + [13] = {.entry = {.count = 1, .reusable = true}}, SHIFT(12), + [15] = {.entry = {.count = 1, .reusable = false}}, SHIFT(12), + [17] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_instruction, 1, 0, 1), + [19] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_instruction, 1, 0, 1), + [21] = {.entry = {.count = 1, .reusable = true}}, SHIFT(103), + [23] = {.entry = {.count = 1, .reusable = true}}, SHIFT(100), + [25] = {.entry = {.count = 1, .reusable = true}}, SHIFT(98), + [27] = {.entry = {.count = 1, .reusable = true}}, SHIFT(96), + [29] = {.entry = {.count = 1, .reusable = false}}, SHIFT(95), + [31] = {.entry = {.count = 1, .reusable = true}}, SHIFT(4), + [33] = {.entry = {.count = 1, .reusable = false}}, SHIFT(4), + [35] = {.entry = {.count = 1, .reusable = true}}, SHIFT(13), + [37] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_instruction_repeat1, 2, 0, 0), + [39] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_instruction_repeat1, 2, 0, 0), + [41] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_instruction_repeat1, 2, 0, 0), SHIFT_REPEAT(92), + [44] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_instruction_repeat1, 2, 0, 0), SHIFT_REPEAT(93), + [47] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_instruction_repeat1, 2, 0, 0), SHIFT_REPEAT(94), + [50] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_instruction_repeat1, 2, 0, 0), SHIFT_REPEAT(89), + [53] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_instruction_repeat1, 2, 0, 0), SHIFT_REPEAT(90), + [56] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_instruction_repeat1, 2, 0, 0), SHIFT_REPEAT(3), + [59] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_instruction_repeat1, 2, 0, 0), SHIFT_REPEAT(3), + [62] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_instruction_repeat1, 2, 0, 0), SHIFT_REPEAT(24), + [65] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_instruction, 2, 0, 1), + [67] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_instruction, 2, 0, 1), + [69] = {.entry = {.count = 1, .reusable = true}}, SHIFT(5), + [71] = {.entry = {.count = 1, .reusable = false}}, SHIFT(5), + [73] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_instruction_repeat1, 2, 0, 0), SHIFT_REPEAT(103), + [76] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_instruction_repeat1, 2, 0, 0), SHIFT_REPEAT(100), + [79] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_instruction_repeat1, 2, 0, 0), SHIFT_REPEAT(98), + [82] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_instruction_repeat1, 2, 0, 0), SHIFT_REPEAT(96), + [85] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_instruction_repeat1, 2, 0, 0), SHIFT_REPEAT(95), + [88] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_instruction_repeat1, 2, 0, 0), SHIFT_REPEAT(5), + [91] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_instruction_repeat1, 2, 0, 0), SHIFT_REPEAT(5), + [94] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_instruction_repeat1, 2, 0, 0), SHIFT_REPEAT(13), + [97] = {.entry = {.count = 1, .reusable = true}}, SHIFT(97), + [99] = {.entry = {.count = 1, .reusable = true}}, SHIFT(87), + [101] = {.entry = {.count = 1, .reusable = true}}, SHIFT(99), + [103] = {.entry = {.count = 1, .reusable = true}}, SHIFT(91), + [105] = {.entry = {.count = 1, .reusable = false}}, SHIFT(88), + [107] = {.entry = {.count = 1, .reusable = true}}, SHIFT(7), + [109] = {.entry = {.count = 1, .reusable = false}}, SHIFT(7), + [111] = {.entry = {.count = 1, .reusable = true}}, SHIFT(17), + [113] = {.entry = {.count = 1, .reusable = true}}, SHIFT(8), + [115] = {.entry = {.count = 1, .reusable = false}}, SHIFT(8), + [117] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_instruction_repeat1, 2, 0, 0), SHIFT_REPEAT(97), + [120] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_instruction_repeat1, 2, 0, 0), SHIFT_REPEAT(87), + [123] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_instruction_repeat1, 2, 0, 0), SHIFT_REPEAT(99), + [126] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_instruction_repeat1, 2, 0, 0), SHIFT_REPEAT(91), + [129] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_instruction_repeat1, 2, 0, 0), SHIFT_REPEAT(88), + [132] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_instruction_repeat1, 2, 0, 0), SHIFT_REPEAT(8), + [135] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_instruction_repeat1, 2, 0, 0), SHIFT_REPEAT(8), + [138] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_instruction_repeat1, 2, 0, 0), SHIFT_REPEAT(17), + [141] = {.entry = {.count = 1, .reusable = true}}, SHIFT(92), + [143] = {.entry = {.count = 1, .reusable = true}}, SHIFT(93), + [145] = {.entry = {.count = 1, .reusable = true}}, SHIFT(94), + [147] = {.entry = {.count = 1, .reusable = true}}, SHIFT(89), + [149] = {.entry = {.count = 1, .reusable = false}}, SHIFT(90), + [151] = {.entry = {.count = 1, .reusable = true}}, SHIFT(10), + [153] = {.entry = {.count = 1, .reusable = false}}, SHIFT(10), + [155] = {.entry = {.count = 1, .reusable = true}}, SHIFT(24), + [157] = {.entry = {.count = 1, .reusable = true}}, SHIFT(3), + [159] = {.entry = {.count = 1, .reusable = false}}, SHIFT(3), + [161] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_function_reference, 2, 0, 0), + [163] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_function_reference, 2, 0, 0), + [165] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_keyword, 1, 0, 0), + [167] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_keyword, 1, 0, 0), + [169] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_bool, 1, 0, 0), + [171] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_bool, 1, 0, 0), + [173] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_value_reference, 2, 0, 0), + [175] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_value_reference, 2, 0, 0), + [177] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_type_reference, 2, 0, 0), + [179] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_type_reference, 2, 0, 0), + [181] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_direct_reference, 2, 0, 0), + [183] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_direct_reference, 2, 0, 0), + [185] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_line_reference, 2, 0, 0), + [187] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_line_reference, 2, 0, 0), + [189] = {.entry = {.count = 1, .reusable = true}}, SHIFT(105), + [191] = {.entry = {.count = 1, .reusable = true}}, SHIFT(79), + [193] = {.entry = {.count = 1, .reusable = true}}, SHIFT(69), + [195] = {.entry = {.count = 1, .reusable = true}}, SHIFT(84), + [197] = {.entry = {.count = 1, .reusable = true}}, SHIFT(22), + [199] = {.entry = {.count = 1, .reusable = false}}, SHIFT(22), + [201] = {.entry = {.count = 1, .reusable = true}}, SHIFT(88), + [203] = {.entry = {.count = 1, .reusable = true}}, SHIFT(67), + [205] = {.entry = {.count = 1, .reusable = true}}, SHIFT(60), + [207] = {.entry = {.count = 1, .reusable = true}}, SHIFT(73), + [209] = {.entry = {.count = 1, .reusable = true}}, SHIFT(72), + [211] = {.entry = {.count = 1, .reusable = true}}, SHIFT(56), + [213] = {.entry = {.count = 1, .reusable = true}}, SHIFT(71), + [215] = {.entry = {.count = 1, .reusable = true}}, SHIFT(68), + [217] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), + [219] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(101), + [222] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(80), + [225] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(77), + [228] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(12), + [231] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(12), + [234] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(104), + [237] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(86), + [240] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(82), + [243] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(15), + [246] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(15), + [249] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source_file, 1, 0, 0), + [251] = {.entry = {.count = 1, .reusable = true}}, SHIFT(104), + [253] = {.entry = {.count = 1, .reusable = true}}, SHIFT(86), + [255] = {.entry = {.count = 1, .reusable = true}}, SHIFT(82), + [257] = {.entry = {.count = 1, .reusable = true}}, SHIFT(64), + [259] = {.entry = {.count = 1, .reusable = true}}, SHIFT(15), + [261] = {.entry = {.count = 1, .reusable = false}}, SHIFT(15), + [263] = {.entry = {.count = 1, .reusable = true}}, SHIFT(70), + [265] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(105), + [268] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(79), + [271] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(84), + [274] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(22), + [277] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(22), + [280] = {.entry = {.count = 1, .reusable = true}}, SHIFT(66), + [282] = {.entry = {.count = 1, .reusable = true}}, SHIFT(74), + [284] = {.entry = {.count = 1, .reusable = true}}, SHIFT(65), + [286] = {.entry = {.count = 1, .reusable = true}}, SHIFT(76), + [288] = {.entry = {.count = 1, .reusable = true}}, SHIFT(75), + [290] = {.entry = {.count = 1, .reusable = true}}, SHIFT(63), + [292] = {.entry = {.count = 1, .reusable = true}}, SHIFT(61), + [294] = {.entry = {.count = 1, .reusable = true}}, SHIFT(57), + [296] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_function_definition_repeat1, 2, 0, 6), + [298] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_function_definition_repeat1, 2, 0, 6), + [300] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_function_definition_repeat1, 2, 0, 6), SHIFT_REPEAT(88), + [303] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_function_definition_repeat1, 2, 0, 4), + [305] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_function_definition_repeat1, 2, 0, 4), + [307] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_function_definition, 4, 0, 3), + [309] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_function_definition, 4, 0, 3), + [311] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_function_definition, 5, 0, 3), + [313] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_function_definition, 5, 0, 3), + [315] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_label_definition, 2, 0, 0), + [317] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_label_definition, 2, 0, 0), + [319] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_struct_definition, 4, 0, 2), + [321] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_struct_definition, 4, 0, 2), + [323] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_struct_definition, 3, 0, 2), + [325] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_struct_definition, 3, 0, 2), + [327] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_function_definition, 5, 0, 5), + [329] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_function_definition, 5, 0, 5), + [331] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_function_definition, 6, 0, 5), + [333] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_function_definition, 6, 0, 5), + [335] = {.entry = {.count = 1, .reusable = true}}, SHIFT(90), + [337] = {.entry = {.count = 1, .reusable = true}}, SHIFT(19), + [339] = {.entry = {.count = 1, .reusable = true}}, SHIFT(21), + [341] = {.entry = {.count = 1, .reusable = true}}, SHIFT(26), + [343] = {.entry = {.count = 1, .reusable = true}}, SHIFT(27), + [345] = {.entry = {.count = 1, .reusable = true}}, SHIFT(11), + [347] = {.entry = {.count = 1, .reusable = true}}, SHIFT(28), + [349] = {.entry = {.count = 1, .reusable = true}}, SHIFT(29), + [351] = {.entry = {.count = 1, .reusable = true}}, SHIFT(30), + [353] = {.entry = {.count = 1, .reusable = true}}, SHIFT(18), + [355] = {.entry = {.count = 1, .reusable = true}}, SHIFT(16), + [357] = {.entry = {.count = 1, .reusable = true}}, SHIFT(14), + [359] = {.entry = {.count = 1, .reusable = true}}, SHIFT(31), + [361] = {.entry = {.count = 1, .reusable = true}}, SHIFT(20), + [363] = {.entry = {.count = 1, .reusable = true}}, SHIFT(25), + [365] = {.entry = {.count = 1, .reusable = true}}, SHIFT(62), + [367] = {.entry = {.count = 1, .reusable = true}}, ACCEPT_INPUT(), + [369] = {.entry = {.count = 1, .reusable = true}}, SHIFT(23), + [371] = {.entry = {.count = 1, .reusable = true}}, SHIFT(58), + [373] = {.entry = {.count = 1, .reusable = true}}, SHIFT(59), +}; + +#ifdef __cplusplus +extern "C" { +#endif +#ifdef TREE_SITTER_HIDE_SYMBOLS +#define TS_PUBLIC +#elif defined(_WIN32) +#define TS_PUBLIC __declspec(dllexport) +#else +#define TS_PUBLIC __attribute__((visibility("default"))) +#endif + +TS_PUBLIC const TSLanguage *tree_sitter_ground(void) { + static const TSLanguage language = { + .abi_version = LANGUAGE_VERSION, + .symbol_count = SYMBOL_COUNT, + .alias_count = ALIAS_COUNT, + .token_count = TOKEN_COUNT, + .external_token_count = EXTERNAL_TOKEN_COUNT, + .state_count = STATE_COUNT, + .large_state_count = LARGE_STATE_COUNT, + .production_id_count = PRODUCTION_ID_COUNT, + .supertype_count = SUPERTYPE_COUNT, + .field_count = FIELD_COUNT, + .max_alias_sequence_length = MAX_ALIAS_SEQUENCE_LENGTH, + .parse_table = &ts_parse_table[0][0], + .small_parse_table = ts_small_parse_table, + .small_parse_table_map = ts_small_parse_table_map, + .parse_actions = ts_parse_actions, + .symbol_names = ts_symbol_names, + .field_names = ts_field_names, + .field_map_slices = ts_field_map_slices, + .field_map_entries = ts_field_map_entries, + .symbol_metadata = ts_symbol_metadata, + .public_symbol_map = ts_symbol_map, + .alias_map = ts_non_terminal_alias_map, + .alias_sequences = &ts_alias_sequences[0][0], + .lex_modes = (const void*)ts_lex_modes, + .lex_fn = ts_lex, + .primary_state_ids = ts_primary_state_ids, + .name = "ground", + .max_reserved_word_set_size = 0, + .metadata = { + .major_version = 0, + .minor_version = 1, + .patch_version = 0, + }, + }; + return &language; +} +#ifdef __cplusplus +} +#endif diff --git a/src/tree_sitter/alloc.h b/src/tree_sitter/alloc.h new file mode 100644 index 0000000..1abdd12 --- /dev/null +++ b/src/tree_sitter/alloc.h @@ -0,0 +1,54 @@ +#ifndef TREE_SITTER_ALLOC_H_ +#define TREE_SITTER_ALLOC_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include +#include + +// Allow clients to override allocation functions +#ifdef TREE_SITTER_REUSE_ALLOCATOR + +extern void *(*ts_current_malloc)(size_t size); +extern void *(*ts_current_calloc)(size_t count, size_t size); +extern void *(*ts_current_realloc)(void *ptr, size_t size); +extern void (*ts_current_free)(void *ptr); + +#ifndef ts_malloc +#define ts_malloc ts_current_malloc +#endif +#ifndef ts_calloc +#define ts_calloc ts_current_calloc +#endif +#ifndef ts_realloc +#define ts_realloc ts_current_realloc +#endif +#ifndef ts_free +#define ts_free ts_current_free +#endif + +#else + +#ifndef ts_malloc +#define ts_malloc malloc +#endif +#ifndef ts_calloc +#define ts_calloc calloc +#endif +#ifndef ts_realloc +#define ts_realloc realloc +#endif +#ifndef ts_free +#define ts_free free +#endif + +#endif + +#ifdef __cplusplus +} +#endif + +#endif // TREE_SITTER_ALLOC_H_ diff --git a/src/tree_sitter/array.h b/src/tree_sitter/array.h new file mode 100644 index 0000000..a17a574 --- /dev/null +++ b/src/tree_sitter/array.h @@ -0,0 +1,291 @@ +#ifndef TREE_SITTER_ARRAY_H_ +#define TREE_SITTER_ARRAY_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include "./alloc.h" + +#include +#include +#include +#include +#include + +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable : 4101) +#elif defined(__GNUC__) || defined(__clang__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-variable" +#endif + +#define Array(T) \ + struct { \ + T *contents; \ + uint32_t size; \ + uint32_t capacity; \ + } + +/// Initialize an array. +#define array_init(self) \ + ((self)->size = 0, (self)->capacity = 0, (self)->contents = NULL) + +/// Create an empty array. +#define array_new() \ + { NULL, 0, 0 } + +/// Get a pointer to the element at a given `index` in the array. +#define array_get(self, _index) \ + (assert((uint32_t)(_index) < (self)->size), &(self)->contents[_index]) + +/// Get a pointer to the first element in the array. +#define array_front(self) array_get(self, 0) + +/// Get a pointer to the last element in the array. +#define array_back(self) array_get(self, (self)->size - 1) + +/// Clear the array, setting its size to zero. Note that this does not free any +/// memory allocated for the array's contents. +#define array_clear(self) ((self)->size = 0) + +/// Reserve `new_capacity` elements of space in the array. If `new_capacity` is +/// less than the array's current capacity, this function has no effect. +#define array_reserve(self, new_capacity) \ + _array__reserve((Array *)(self), array_elem_size(self), new_capacity) + +/// Free any memory allocated for this array. Note that this does not free any +/// memory allocated for the array's contents. +#define array_delete(self) _array__delete((Array *)(self)) + +/// Push a new `element` onto the end of the array. +#define array_push(self, element) \ + (_array__grow((Array *)(self), 1, array_elem_size(self)), \ + (self)->contents[(self)->size++] = (element)) + +/// Increase the array's size by `count` elements. +/// New elements are zero-initialized. +#define array_grow_by(self, count) \ + do { \ + if ((count) == 0) break; \ + _array__grow((Array *)(self), count, array_elem_size(self)); \ + memset((self)->contents + (self)->size, 0, (count) * array_elem_size(self)); \ + (self)->size += (count); \ + } while (0) + +/// Append all elements from one array to the end of another. +#define array_push_all(self, other) \ + array_extend((self), (other)->size, (other)->contents) + +/// Append `count` elements to the end of the array, reading their values from the +/// `contents` pointer. +#define array_extend(self, count, contents) \ + _array__splice( \ + (Array *)(self), array_elem_size(self), (self)->size, \ + 0, count, contents \ + ) + +/// Remove `old_count` elements from the array starting at the given `index`. At +/// the same index, insert `new_count` new elements, reading their values from the +/// `new_contents` pointer. +#define array_splice(self, _index, old_count, new_count, new_contents) \ + _array__splice( \ + (Array *)(self), array_elem_size(self), _index, \ + old_count, new_count, new_contents \ + ) + +/// Insert one `element` into the array at the given `index`. +#define array_insert(self, _index, element) \ + _array__splice((Array *)(self), array_elem_size(self), _index, 0, 1, &(element)) + +/// Remove one element from the array at the given `index`. +#define array_erase(self, _index) \ + _array__erase((Array *)(self), array_elem_size(self), _index) + +/// Pop the last element off the array, returning the element by value. +#define array_pop(self) ((self)->contents[--(self)->size]) + +/// Assign the contents of one array to another, reallocating if necessary. +#define array_assign(self, other) \ + _array__assign((Array *)(self), (const Array *)(other), array_elem_size(self)) + +/// Swap one array with another +#define array_swap(self, other) \ + _array__swap((Array *)(self), (Array *)(other)) + +/// Get the size of the array contents +#define array_elem_size(self) (sizeof *(self)->contents) + +/// Search a sorted array for a given `needle` value, using the given `compare` +/// callback to determine the order. +/// +/// If an existing element is found to be equal to `needle`, then the `index` +/// out-parameter is set to the existing value's index, and the `exists` +/// out-parameter is set to true. Otherwise, `index` is set to an index where +/// `needle` should be inserted in order to preserve the sorting, and `exists` +/// is set to false. +#define array_search_sorted_with(self, compare, needle, _index, _exists) \ + _array__search_sorted(self, 0, compare, , needle, _index, _exists) + +/// Search a sorted array for a given `needle` value, using integer comparisons +/// of a given struct field (specified with a leading dot) to determine the order. +/// +/// See also `array_search_sorted_with`. +#define array_search_sorted_by(self, field, needle, _index, _exists) \ + _array__search_sorted(self, 0, _compare_int, field, needle, _index, _exists) + +/// Insert a given `value` into a sorted array, using the given `compare` +/// callback to determine the order. +#define array_insert_sorted_with(self, compare, value) \ + do { \ + unsigned _index, _exists; \ + array_search_sorted_with(self, compare, &(value), &_index, &_exists); \ + if (!_exists) array_insert(self, _index, value); \ + } while (0) + +/// Insert a given `value` into a sorted array, using integer comparisons of +/// a given struct field (specified with a leading dot) to determine the order. +/// +/// See also `array_search_sorted_by`. +#define array_insert_sorted_by(self, field, value) \ + do { \ + unsigned _index, _exists; \ + array_search_sorted_by(self, field, (value) field, &_index, &_exists); \ + if (!_exists) array_insert(self, _index, value); \ + } while (0) + +// Private + +typedef Array(void) Array; + +/// This is not what you're looking for, see `array_delete`. +static inline void _array__delete(Array *self) { + if (self->contents) { + ts_free(self->contents); + self->contents = NULL; + self->size = 0; + self->capacity = 0; + } +} + +/// This is not what you're looking for, see `array_erase`. +static inline void _array__erase(Array *self, size_t element_size, + uint32_t index) { + assert(index < self->size); + char *contents = (char *)self->contents; + memmove(contents + index * element_size, contents + (index + 1) * element_size, + (self->size - index - 1) * element_size); + self->size--; +} + +/// This is not what you're looking for, see `array_reserve`. +static inline void _array__reserve(Array *self, size_t element_size, uint32_t new_capacity) { + if (new_capacity > self->capacity) { + if (self->contents) { + self->contents = ts_realloc(self->contents, new_capacity * element_size); + } else { + self->contents = ts_malloc(new_capacity * element_size); + } + self->capacity = new_capacity; + } +} + +/// This is not what you're looking for, see `array_assign`. +static inline void _array__assign(Array *self, const Array *other, size_t element_size) { + _array__reserve(self, element_size, other->size); + self->size = other->size; + memcpy(self->contents, other->contents, self->size * element_size); +} + +/// This is not what you're looking for, see `array_swap`. +static inline void _array__swap(Array *self, Array *other) { + Array swap = *other; + *other = *self; + *self = swap; +} + +/// This is not what you're looking for, see `array_push` or `array_grow_by`. +static inline void _array__grow(Array *self, uint32_t count, size_t element_size) { + uint32_t new_size = self->size + count; + if (new_size > self->capacity) { + uint32_t new_capacity = self->capacity * 2; + if (new_capacity < 8) new_capacity = 8; + if (new_capacity < new_size) new_capacity = new_size; + _array__reserve(self, element_size, new_capacity); + } +} + +/// This is not what you're looking for, see `array_splice`. +static inline void _array__splice(Array *self, size_t element_size, + uint32_t index, uint32_t old_count, + uint32_t new_count, const void *elements) { + uint32_t new_size = self->size + new_count - old_count; + uint32_t old_end = index + old_count; + uint32_t new_end = index + new_count; + assert(old_end <= self->size); + + _array__reserve(self, element_size, new_size); + + char *contents = (char *)self->contents; + if (self->size > old_end) { + memmove( + contents + new_end * element_size, + contents + old_end * element_size, + (self->size - old_end) * element_size + ); + } + if (new_count > 0) { + if (elements) { + memcpy( + (contents + index * element_size), + elements, + new_count * element_size + ); + } else { + memset( + (contents + index * element_size), + 0, + new_count * element_size + ); + } + } + self->size += new_count - old_count; +} + +/// A binary search routine, based on Rust's `std::slice::binary_search_by`. +/// This is not what you're looking for, see `array_search_sorted_with` or `array_search_sorted_by`. +#define _array__search_sorted(self, start, compare, suffix, needle, _index, _exists) \ + do { \ + *(_index) = start; \ + *(_exists) = false; \ + uint32_t size = (self)->size - *(_index); \ + if (size == 0) break; \ + int comparison; \ + while (size > 1) { \ + uint32_t half_size = size / 2; \ + uint32_t mid_index = *(_index) + half_size; \ + comparison = compare(&((self)->contents[mid_index] suffix), (needle)); \ + if (comparison <= 0) *(_index) = mid_index; \ + size -= half_size; \ + } \ + comparison = compare(&((self)->contents[*(_index)] suffix), (needle)); \ + if (comparison == 0) *(_exists) = true; \ + else if (comparison < 0) *(_index) += 1; \ + } while (0) + +/// Helper macro for the `_sorted_by` routines below. This takes the left (existing) +/// parameter by reference in order to work with the generic sorting function above. +#define _compare_int(a, b) ((int)*(a) - (int)(b)) + +#ifdef _MSC_VER +#pragma warning(pop) +#elif defined(__GNUC__) || defined(__clang__) +#pragma GCC diagnostic pop +#endif + +#ifdef __cplusplus +} +#endif + +#endif // TREE_SITTER_ARRAY_H_ diff --git a/src/tree_sitter/parser.h b/src/tree_sitter/parser.h new file mode 100644 index 0000000..858107d --- /dev/null +++ b/src/tree_sitter/parser.h @@ -0,0 +1,286 @@ +#ifndef TREE_SITTER_PARSER_H_ +#define TREE_SITTER_PARSER_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include +#include + +#define ts_builtin_sym_error ((TSSymbol)-1) +#define ts_builtin_sym_end 0 +#define TREE_SITTER_SERIALIZATION_BUFFER_SIZE 1024 + +#ifndef TREE_SITTER_API_H_ +typedef uint16_t TSStateId; +typedef uint16_t TSSymbol; +typedef uint16_t TSFieldId; +typedef struct TSLanguage TSLanguage; +typedef struct TSLanguageMetadata { + uint8_t major_version; + uint8_t minor_version; + uint8_t patch_version; +} TSLanguageMetadata; +#endif + +typedef struct { + TSFieldId field_id; + uint8_t child_index; + bool inherited; +} TSFieldMapEntry; + +// Used to index the field and supertype maps. +typedef struct { + uint16_t index; + uint16_t length; +} TSMapSlice; + +typedef struct { + bool visible; + bool named; + bool supertype; +} TSSymbolMetadata; + +typedef struct TSLexer TSLexer; + +struct TSLexer { + int32_t lookahead; + TSSymbol result_symbol; + void (*advance)(TSLexer *, bool); + void (*mark_end)(TSLexer *); + uint32_t (*get_column)(TSLexer *); + bool (*is_at_included_range_start)(const TSLexer *); + bool (*eof)(const TSLexer *); + void (*log)(const TSLexer *, const char *, ...); +}; + +typedef enum { + TSParseActionTypeShift, + TSParseActionTypeReduce, + TSParseActionTypeAccept, + TSParseActionTypeRecover, +} TSParseActionType; + +typedef union { + struct { + uint8_t type; + TSStateId state; + bool extra; + bool repetition; + } shift; + struct { + uint8_t type; + uint8_t child_count; + TSSymbol symbol; + int16_t dynamic_precedence; + uint16_t production_id; + } reduce; + uint8_t type; +} TSParseAction; + +typedef struct { + uint16_t lex_state; + uint16_t external_lex_state; +} TSLexMode; + +typedef struct { + uint16_t lex_state; + uint16_t external_lex_state; + uint16_t reserved_word_set_id; +} TSLexerMode; + +typedef union { + TSParseAction action; + struct { + uint8_t count; + bool reusable; + } entry; +} TSParseActionEntry; + +typedef struct { + int32_t start; + int32_t end; +} TSCharacterRange; + +struct TSLanguage { + uint32_t abi_version; + uint32_t symbol_count; + uint32_t alias_count; + uint32_t token_count; + uint32_t external_token_count; + uint32_t state_count; + uint32_t large_state_count; + uint32_t production_id_count; + uint32_t field_count; + uint16_t max_alias_sequence_length; + const uint16_t *parse_table; + const uint16_t *small_parse_table; + const uint32_t *small_parse_table_map; + const TSParseActionEntry *parse_actions; + const char * const *symbol_names; + const char * const *field_names; + const TSMapSlice *field_map_slices; + const TSFieldMapEntry *field_map_entries; + const TSSymbolMetadata *symbol_metadata; + const TSSymbol *public_symbol_map; + const uint16_t *alias_map; + const TSSymbol *alias_sequences; + const TSLexerMode *lex_modes; + bool (*lex_fn)(TSLexer *, TSStateId); + bool (*keyword_lex_fn)(TSLexer *, TSStateId); + TSSymbol keyword_capture_token; + struct { + const bool *states; + const TSSymbol *symbol_map; + void *(*create)(void); + void (*destroy)(void *); + bool (*scan)(void *, TSLexer *, const bool *symbol_whitelist); + unsigned (*serialize)(void *, char *); + void (*deserialize)(void *, const char *, unsigned); + } external_scanner; + const TSStateId *primary_state_ids; + const char *name; + const TSSymbol *reserved_words; + uint16_t max_reserved_word_set_size; + uint32_t supertype_count; + const TSSymbol *supertype_symbols; + const TSMapSlice *supertype_map_slices; + const TSSymbol *supertype_map_entries; + TSLanguageMetadata metadata; +}; + +static inline bool set_contains(const TSCharacterRange *ranges, uint32_t len, int32_t lookahead) { + uint32_t index = 0; + uint32_t size = len - index; + while (size > 1) { + uint32_t half_size = size / 2; + uint32_t mid_index = index + half_size; + const TSCharacterRange *range = &ranges[mid_index]; + if (lookahead >= range->start && lookahead <= range->end) { + return true; + } else if (lookahead > range->end) { + index = mid_index; + } + size -= half_size; + } + const TSCharacterRange *range = &ranges[index]; + return (lookahead >= range->start && lookahead <= range->end); +} + +/* + * Lexer Macros + */ + +#ifdef _MSC_VER +#define UNUSED __pragma(warning(suppress : 4101)) +#else +#define UNUSED __attribute__((unused)) +#endif + +#define START_LEXER() \ + bool result = false; \ + bool skip = false; \ + UNUSED \ + bool eof = false; \ + int32_t lookahead; \ + goto start; \ + next_state: \ + lexer->advance(lexer, skip); \ + start: \ + skip = false; \ + lookahead = lexer->lookahead; + +#define ADVANCE(state_value) \ + { \ + state = state_value; \ + goto next_state; \ + } + +#define ADVANCE_MAP(...) \ + { \ + static const uint16_t map[] = { __VA_ARGS__ }; \ + for (uint32_t i = 0; i < sizeof(map) / sizeof(map[0]); i += 2) { \ + if (map[i] == lookahead) { \ + state = map[i + 1]; \ + goto next_state; \ + } \ + } \ + } + +#define SKIP(state_value) \ + { \ + skip = true; \ + state = state_value; \ + goto next_state; \ + } + +#define ACCEPT_TOKEN(symbol_value) \ + result = true; \ + lexer->result_symbol = symbol_value; \ + lexer->mark_end(lexer); + +#define END_STATE() return result; + +/* + * Parse Table Macros + */ + +#define SMALL_STATE(id) ((id) - LARGE_STATE_COUNT) + +#define STATE(id) id + +#define ACTIONS(id) id + +#define SHIFT(state_value) \ + {{ \ + .shift = { \ + .type = TSParseActionTypeShift, \ + .state = (state_value) \ + } \ + }} + +#define SHIFT_REPEAT(state_value) \ + {{ \ + .shift = { \ + .type = TSParseActionTypeShift, \ + .state = (state_value), \ + .repetition = true \ + } \ + }} + +#define SHIFT_EXTRA() \ + {{ \ + .shift = { \ + .type = TSParseActionTypeShift, \ + .extra = true \ + } \ + }} + +#define REDUCE(symbol_name, children, precedence, prod_id) \ + {{ \ + .reduce = { \ + .type = TSParseActionTypeReduce, \ + .symbol = symbol_name, \ + .child_count = children, \ + .dynamic_precedence = precedence, \ + .production_id = prod_id \ + }, \ + }} + +#define RECOVER() \ + {{ \ + .type = TSParseActionTypeRecover \ + }} + +#define ACCEPT_INPUT() \ + {{ \ + .type = TSParseActionTypeAccept \ + }} + +#ifdef __cplusplus +} +#endif + +#endif // TREE_SITTER_PARSER_H_ diff --git a/syntax.md b/syntax.md new file mode 100644 index 0000000..b1a1a99 --- /dev/null +++ b/syntax.md @@ -0,0 +1,384 @@ +# CGround Syntax + +This document details syntax for CGround's textual representation. + +Lines with a comment start with `#`. + +## References + +Working with variables in CGround requires the use of sigils to determine how the variable is being used. + +### Value Reference (`$`) + +Prefixing a variable name with a `$` (dollar sign) inserts that value into the current instruction. Usually this means access to a variable. + +Example: + +``` +set &x 5 + +# Equivalent to println 5 +println $x +``` + +### Direct Reference (`&`) + +Prefixing a variable name with a `&` (ampersand) references a variable. Usually this means a new value is being inserted into a variable. + +Example: + +``` +set &x 5 +``` + +### Line Reference (`%`) + +Prefixing a variable name with a `%` (percentage) references a line. + +Example: + +``` +@myLabel +jump %myLabel +``` + +### Label (`@`) + +Prefixing a variable name with a `@` (at symbol) creates a label. + +Example: + +``` +@myLabel +jump %myLabel +``` + +### Function Reference (`!`) + +Prefixing a variable name with a `!` (exclamation mark) indicates definition or usage of a function. + +Example: + +``` +fun !myFunction -int + return 0 +endfun + +call !myFunction &returnVal +``` + +### Type Reference (`-`) + +Prefixing a variable name with a `-` (dash) indicates usage of a type. + +Example: + +``` +fun !myFunction -int + return 0 +endfun +``` + +## Types + +### String + +A string of characters. Equivalent to C `char*`. + +Example: + +``` +set &x "this is a string" +``` + +### Int + +A 64 bit signed integer. Equivalent to C `int64_t`. + +Example: + +``` +set &x 32 +``` + +### Double + +A double-prescision floating point number. Equivalent to C `double`. + +Example: + +``` +set &x 3.141 +``` + +### Char + +A one-byte ASCII character. Equivalent to C `char`. + +Example: + +``` +set &x 'a' +``` + +### Bool + +Either true or false. + +Example: + +``` +set &x true +set &x false +``` + +## Instructions + +### Control Flow + +#### if $condition %label + +Conditional jump to the specified label. If `$condition` is a boolean and is true, jumps to the specified label. Otherwise, nothing happens and execution continues. + +#### jump %label + +Jump to the specified label. + +#### end $status + +Exits the program with an integer status code. + + +### I/O + +#### input &variable + +Takes input from the stdin until a new line. Writes the input to the provided variable. + +#### print $value + +Prints the provided value to the stdout. + +#### println $value + +Prints the provided value to the stdout. Appends a new line. + + +### Variables and Lists + +#### set &variable $value + +Sets a variable to a value. + +#### init &var -type + +Initialises a variable with the default (or zero) value of the provided type. + +#### gettype $value &variable + +Gets the type of a variable and outputs it as a string to a variable. + +#### exists &variable &output + +Checks whether the variable exists. If so, outputs true to the output. If not, outputs false to the output. + +#### setlist &varname $val1 $val2 $val3... + +Initialises a list with the provided values. Any amount of values can be appended after the direct reference, which will be added to the list. + +Lists are zero-indexed. + +#### setlistat &listname $index $value + +Sets the list at the provided index to the provided value. + +Lists are zero-indexed. + +#### getlistat &list $index &variable + +Retrieves an element from the list at the provided index. Outputs to a variable. + +#### getlistsize &list &variable + +Gets the size of a list, and puts it in the variable. + +#### listappend $value &list + +Appends the provided value to the list. + + +### String Operations + +#### getstrsize $string &variable + +Gets the size of a string and outputs it to the provided variable. + +#### getstrcharat $string $index &variable + +Gets a character from the string at the provided index and outputs it to the variable. + + +### Maths + +#### add $value $value &variable + +Adds two values and outputs to a variable. + +The two values can be: + +* string and string (concatenates) +* int and int +* double and double +* int and double (In this case, the int will be promoted to a double.) + +#### subtract $value $value &variable + +Subtracts the RHS value from the LHS value and outputs to a variable. + +The two values can be: + +* int and int +* double and double +* int and double (In this case, the int will be promoted to a double.) + +#### multiply $value $value &variable + +Multiplies two values and outputs to a variable. + +The two values can be: + +* int and int +* double and double +* int and double (In this case, the int will be promoted to a double.) + +#### divide $value $value &variable + +Divides the LHS by the RHS and outputs to a variable. + +The two values can be: + +* int and int +* double and double +* int and double (In this case, the int will be promoted to a double.) + + +### Comparisons + +#### equal $value $value &variable + +If the two provided values are the same, outputs true to the variable. Otherwise, outputs false. + +Note: If provided values are of different types, outputs false by default. + +If comparing an int and double, the int will be promoted to a double. + +#### inequal $value $value &variable + +If the two provided values are not the same, outputs true to the variable. Otherwise, outputs false. + +Note: If provided values are of different types, outputs true by default. + +If comparing an int and double, the int will be promoted to a double. + +#### not $value &variable + +Outputs to the variable the opposite of the provided boolean (true becomes false, false becomes true). + +#### greater $value $value &variable + +If the LHS is greater than the RHS, outputs true to the variable. Otherwise, outputs false. + +The two values can be: + +* int and int +* double and double +* int and double (In this case, the int will be promoted to a double.) + +#### lesser $value $value &variable + +If the LHS is lesser than the RHS, outputs true to the variable. Otherwise, outputs false. + +The two values can be: + +* int and int +* double and double +* int and double (In this case, the int will be promoted to a double.) + + +### Type Conversions + +Notice: Most instructions in this section are currently unstable. Please report any bugs in this Git repository. + +#### stoi $value &variable + +Converts a string to an integer. Outputs to a variable. + +#### stod $value &variable + +Converts a string to a double. Outputs to a variable. + +#### tostring $value &variable + +Converts any type to a string. + + +### Functions + +#### fun !functionName -returnType -argType &arg1 -argType &arg2... + +Creates a function with the name `functionName`, and return type `returnType`. + +Arguments are defined with the type reference, then the direct reference symbolising the name of the argument. + +Any Ground instructions between this instruction and the concluding `endfun` instruction will be added to the function and not run immediately. + +#### return $value + +Returns a value from a function. If not inside a function, acts like the exit instruction. + +Return type must match the function return type. + +#### endfun + +Ends function definition. + +#### call !function $arg1 $arg2 $arg3... &variable + +Calls a function. After the function reference, a variable amount of value references may be provided to pass to the function. + +The last argument must be a direct reference which symbolises where to store the function's return value. + + +### Libraries + +#### use $libraryName + +Attempts to import a library written in Ground for usage within the current program. + +Looks in the path $GROUND_LIBS/`$libraryName`.grnd for the library. ($GROUND_LIBS is a system environment variable.) + +#### extern $libraryName + +Attempts to import a shared library written in a compiled language like C or C++ for usage within the current program. + +Looks in the path $GROUND_LIBS/`$libraryName`.so for the library. ($GROUND_LIBS is a system environment variable.) + +### Data Structures + +#### struct -structName + +Creates a new struct which can be initialised. Until the endstruct keyword, the only valid instructions are init, set, fun, endfun, struct, and endstruct. + +Any value created inside the struct will be added to the struct. + +#### endstruct + +Ends the creation of a struct. + +#### getfield $object &fieldName &outputVar + +Gets a field from an initialised object. fieldName must be a valid name of a field in the object. Errors if the field does not exist. + +#### setfield &object &fieldName $value + +Sets a field to a new value in the object. The value must be of the same type as the field's old value. diff --git a/tree-sitter.json b/tree-sitter.json new file mode 100644 index 0000000..7096eea --- /dev/null +++ b/tree-sitter.json @@ -0,0 +1,40 @@ +{ + "$schema": "https://tree-sitter.github.io/tree-sitter/assets/schemas/config.schema.json", + "grammars": [ + { + "name": "ground", + "camelcase": "ground", + "title": "Ground", + "scope": "source.ground", + "file-types": [ + "grnd" + ], + "injection-regex": "^ground$", + "class-name": "TreeSitterGround" + } + ], + "metadata": { + "version": "1.0.0", + "license": "MIT", + "description": "Ground VM textual representation highlighter", + "authors": [ + { + "name": "Maxwell Jeffress", + "email": "maxwelljeffress@proton.me", + "url": "https://maxwellj.xyz/" + } + ], + "links": { + "repository": "https://chookspace.com/ground/grammar" + } + }, + "bindings": { + "c": true, + "go": true, + "node": true, + "python": true, + "rust": true, + "swift": true, + "zig": false + } +}