mirror of
https://github.com/ivuorinen/tree-sitter-shellspec.git
synced 2026-03-10 03:01:40 +00:00
* feat: implement complete tree-sitter-shellspec grammar with comprehensive testing - Add full ShellSpec grammar extending tree-sitter-bash - Support all ShellSpec constructs: Describe, Context, It, hooks, utilities - Include Data block parsing with statements and argument styles - Add 61 comprehensive test cases covering real-world patterns - Implement optimized GitHub workflows with CI/CD automation - Configure complete development tooling (linting, formatting, pre-commit) - Add comprehensive documentation and contribution guidelines - Optimize grammar conflicts to zero warnings - Support editor integration for Neovim, VS Code, Emacs Breaking Changes: - Initial release, no previous API to break BREAKING CHANGE: Initial implementation of tree-sitter-shellspec grammar * fix(ci): checkout before using local actions * fix(ci): use inline steps instead of actions * fix(ci): add checkout before testing, cleanup * chore(ci): add coderabbit config * chore: lint and code review fixes * chore(ci): update workflows * refactor: enhance CI/CD workflows and apply CodeRabbit suggestions - Convert GitHub Actions from local to inline actions for better maintainability - Add comprehensive caching for npm dependencies, tree-sitter CLI, and build artifacts - Fix checkout steps missing in test matrix jobs - Apply defensive programming in test coverage validation - Use local tree-sitter CLI via npx instead of global installation - Update tree-sitter-cli to v0.25.0 for compatibility with tree-sitter-bash - Add proper tree-sitter field to package.json with grammar metadata - Fix grammar precedence for Data blocks (#| lines now have higher precedence) - Standardize dates in memory files to September 12, 2025 - Enhance workflow robustness with dynamic workflow ID resolution - Improve test file pattern matching and error handling This commit addresses all CodeRabbit review suggestions and optimizes GitHub Actions workflows for better performance and reliability. * fix: apply CodeRabbit nitpick suggestions and improve code quality - Fix grammar.js TypeScript errors by correcting optional field usage - Update .yamlignore to use more robust glob pattern (**/node_modules/**) - Remove hard-coded test count from README.md for maintainability - Fix shellcheck directive format (add space after #) in all test specs - Fix typos throughout test specifications: - 'can not' → 'cannot' - 'expantion' → 'expansion' - 'singnal' → 'signal' - 'It mean' → 'It means' - Update CODE_OF_CONDUCT.md HTTP links to HTTPS - Update tree-sitter parse command to use --scope instead of --language - Add comments to .mega-linter.yml explaining disabled linters All grammar tests still pass (61/61) and the parser functions correctly with the updated tree-sitter CLI v0.25.0. * perf: optimize grammar for 32x faster parsing performance - Reduce grammar conflicts to essential bash and ShellSpec rules only - Restore original precedence values for consistent rule ordering - Simplify Data block rule while maintaining all functionality - Add required statements field to match test expectations Performance improvements: - Parse speed: ~55 bytes/ms → 1784 bytes/ms (32x faster) - All 61 tests still pass (100% success rate) - Significantly reduced parser generation time and runtime complexity The optimizations focused on minimizing unnecessary conflicts and simplifying complex choice structures while preserving full ShellSpec grammar compatibility and correctness. * fix(ci): ensure parser is built before testing in GitHub workflows - Add explicit parser build step before sample code testing - Remove --scope parameter that requires parser to be compiled first - Fix tree-sitter CLI v0.25.0 compatibility issue in CI environment The issue was that tree-sitter CLI v0.25.0 requires the parser to be compiled before it can recognize custom language scopes. This fix ensures the parser is always built before attempting to parse test files, resolving the 'Unknown scope' error in GitHub Actions. * feat(ci): expand cache paths to support all Node.js package managers - Add comprehensive caching for npm, yarn, and pnpm package managers - Cache paths now include: - npm: ~/.npm, node_modules/.cache - yarn: ~/.yarn, ~/.cache/yarn, ~/.cache/yarn/global - pnpm: ~/.pnpm-store, ~/.cache/pnpm, ~/.local/share/pnpm/global - Update cache keys to include all lockfile types (package-lock.json, yarn.lock, pnpm-lock.yaml) - Rename 'Cache Tree-sitter CLI' to 'Cache npx store' for clarity - Apply changes consistently across test, lint, and coverage jobs This improves cache hit rates and build performance regardless of which Node.js package manager is used in the development environment. * chore: tweaks to megalinter and grammar.js * fix(scanner): address memory safety and correctness issues in C code - Add len==0 check in set_contains() to prevent buffer overflow - Add missing stdlib.h include in scanner.c - Clear heredoc stack properly in deserialize when length==0 - Ensure NUL termination in delimiter deserialization - Create alloc.c to define ts_current_* symbols for TREE_SITTER_REUSE_ALLOCATOR All changes tested with full test suite: 61/61 tests passing. Addresses PR #1 review comments from CodeRabbit. * ci: improve workflow determinism and security scanning - Add --language=shellspec flag to tree-sitter parse for deterministic grammar selection - Add C++ language to CodeQL analysis to scan src/scanner.c for security issues Addresses PR #1 review comments from CodeRabbit. * test: fix typos and incorrect hook usage in spec files - Fix 'yot' → 'yet' typos in test/spec/03.example_spec.sh - Fix 'Sometime' → 'Sometimes' and cpunum.sh references in test/spec/22.sourcced_spec.sh - Fix Before → After in after hook section of test/spec/07.before_after_hook_spec.sh - Improve wording and capitalization throughout hook spec file All 61 tests still passing after corrections. Addresses PR #1 review comments from Copilot and CodeRabbit. * docs: update Node.js requirement to match CI configuration - Change Node.js requirement from v16 to v22+ to align with CI matrix - Update tree-sitter CLI recommendation from global install to npx usage - Matches actual devDependency configuration in package.json Addresses PR #1 review comment from CodeRabbit. * chore: update dependencies and workflow actions - Update GitHub Actions to latest versions (checkout v6, setup-node v6, cache v4.3) - Update package dependencies - Format workflow files - Update .gitignore and project configuration * fix(ci): remove unsupported --language flag from tree-sitter parse The --language flag is not supported in tree-sitter-cli 0.25.10. Tree-sitter correctly auto-detects the grammar based on file extension. * chore: add prettier and format all files - Install prettier ^3.6.2 - Add .prettierrc with project formatting rules - Add .prettierignore to exclude generated files and dependencies - Add npm scripts: format and format:check - Format all files with prettier * chore: add eclint for editorconfig linting and fix violations - Install eclint ^2.8.1 for editorconfig validation and fixing - Add .eclintignore to exclude generated files and dependencies - Add npm scripts: lint:editorconfig and lint:editorconfig:fix - Fix indentation issues in CONTRIBUTING.md (3 spaces -> 2 spaces) - Fix code alignment in scanner.c to match editorconfig rules - Regenerate parser after scanner.c formatting changes * feat: add post-generation script to preserve buffer overflow fix Created scripts/post-generate.sh that automatically re-applies the critical buffer overflow fix to parser.h after tree-sitter generate runs. This fix prevents undefined behavior in set_contains() when accessing an empty array. The script is automatically executed after tree-sitter generate via the npm generate script. Added generate:only for cases where post-processing should be skipped. * fix: address code review findings and critical issues Critical Fixes: - Fixed EditorConfig violations in grammar.js, scanner.c, README.md, .mega-linter.yml - Changed JSDoc comments from 1-space to 2-space indent per .editorconfig - Fixed line length violations in README.md and .mega-linter.yml - Updated test count badge from 59/59 to 61/61 in README.md - Created queries/highlights.scm for syntax highlighting support - Updated package.json with repository and files fields Configuration Updates: - Added repository field pointing to GitHub - Added files field to control npm package contents - Properly formatted CONTRIBUTING.md with prettier All 61 tests passing (100% success rate) All critical EditorConfig violations resolved * enhance: add Data block test coverage and improve syntax highlighting High Priority Enhancements: - Added 2 new Data block test cases for :raw and :expand modifiers - Enhanced syntax highlighting with "End" keyword (block terminator) - Added Data block modifiers (:raw, :expand, #|) to highlighting Test Coverage: - 63/63 tests passing (100%) - Test count increased from 61 to 63 - Average parse speed: 623 bytes/ms * docs: add comprehensive grammar documentation and precedence explanation Medium Priority Enhancement: - Added detailed precedence strategy comments explaining how ShellSpec extends bash - Documented all 5 conflicts with resolution strategies - Explained why conflicts are necessary and optimal - Added context about GLR parsing and precedence hints Documentation improvements: - Precedence levels clearly explained (bash: 1, ShellSpec: 2) - Each conflict documented with resolution strategy - Notes on intentional design decisions - Helps future maintainers understand grammar design * fix: resolve documentation inconsistencies and add ExampleGroup variants Documentation Fixes: - README.md: Update test count from 59 to 63 (badge, features, test command) - README.md: Fix lint script references to actual npm scripts - CONTRIBUTING.md: Correct format script reference to npm run format:check - package.json: Remove non-existent yamllint script, split lint:markdown into check/fix variants Grammar Enhancements: - Add fExampleGroup and xExampleGroup to Context block variants - Regenerate parser with new grammar (63/63 tests passing, 100% success rate) Syntax Highlighting: - Add fExampleGroup and xExampleGroup to focused/skipped block highlights - Remove non-matching Data modifier tokens (:raw, :expand, #|) - Add "End" keyword as block terminator Memory File Corrections: - Remove incorrect merge_group trigger references - Remove pr-lint.yml workflow references (deleted in previous optimization) - Update test counts with timestamps (59→63, added 2025-12-11) - Update conflict count (13→5, optimized) Code Style: - Auto-format renovate.json and tree-sitter.json with prettier * chore: update dependencies and project configuration - Align tree-sitter dependencies to latest versions (bash 0.25.1, cli 0.25.10) - Clean up .gitignore redundant patterns and normalize path styles - Improve CodeRabbit configuration with path filters and simplified instructions - Add test corpus exclusion to match project intent * docs: improve documentation and memory files - Update CONTRIBUTING.md code style check commands with actual available scripts - Use npx tree-sitter in test examples to avoid assuming global installation - Improve project status memory file with proper JSON formatting - Add CI enforcement recommendation for zero-conflict grammar generation - Align prerequisites with CI requirements (Node 22+) * ci: improve workflow configuration and reliability - Replace global read-all permissions with scoped permissions (contents: read, actions: write) - Fix cache configuration to exclude node_modules and include package-lock.json - Improve CI workflow resolution with flexible path matching and pagination - Verify version instead of committing version bumps from CI - Detect prereleases and publish with appropriate npm tags (next vs latest) - Use generic test suite description in release notes to avoid drift * fix: remove non-existent locals.scm reference from tree-sitter.json Remove queries/locals.scm from locals array as the file does not exist. Only queries/highlights.scm is present in the repository. * security: replace vulnerable eclint with editorconfig-checker - Remove eclint@2.8.1 (has 15 vulnerabilities, possibly abandoned) - Add editorconfig-checker@6.1.1 (actively maintained, zero vulnerabilities) - Update npm scripts to use editorconfig-checker commands - Resolves all 15 security vulnerabilities (8 moderate, 7 high) editorconfig-checker is a more modern, actively maintained alternative written in Go with no Node.js dependency vulnerabilities. * style: fix JSDoc comment indentation * fix(ci): separate CodeQL languages in matrix Previously 'actions,javascript' was treated as a single language. Now correctly split into separate 'actions' and 'javascript' entries. * chore(deps): update GitHub Actions dependencies - actions/checkout: v6.0.0 -> v6.0.1 - actions/setup-node: v6.0.0 -> v6.1.0 - softprops/action-gh-release: v2.4.2 -> v2.5.0 - ivuorinen/actions/*: v2025.11.x -> v2025.12.10 * ci: restore pr-lint workflow from main * chore(deps): update GitHub Actions dependencies Update action pins: checkout v6.0.2, setup-node v6.3.0, cache v5.0.3, pr-lint v2026.03.07. Add checkov skip comment, VERSION prefix strip, and scanner.c to grammar cache key. * feat: extend grammar with hooks, mocks, statements, and directives Add 27 ShellSpec-specific grammar rules covering hook blocks/statements, mock blocks, When/The/Assert statements, Path/Set/Dump/Intercept statements, Parameters variants, Pending/Skip/Todo, and percent directives. Update highlights and test corpus with 128 passing tests. * docs: update README, CLAUDE.md, and test spec comments Comprehensive README rewrite documenting all 27 grammar rules, block types, statement types, and directives. Add CLAUDE.md project instructions for Claude Code. Update test spec file comments for clarity. * chore: update project config and dependencies Update tree-sitter-cli to ^0.26.6, remove broken lint:editorconfig:fix script. Update shellcheck disabled rules. Add JSDoc header to post-generate script. Update gitignore for build artifacts. * fix(ci): use env var for version in release publish step Replace direct expression interpolation with VERSION env var to fix actionlint SC2193 false positive in the npm publish step. * style: fix editorconfig and markdownlint issues Break long cache key YAML value into multiline scalar to comply with 160-character line length limit. * ci: update MegaLinter config for ShellSpec project Add disabled linters for generated/DSL code false positives, v8r exclude pattern, and broader path filter. Remove .coderabbit.yaml in favor of shared org config. * chore: add Claude Code automation config Add hooks (pre-edit guard for generated files, post-edit lint), skills (generate-and-test, add-shellspec-rule, debug-parse-failure, update-highlights, validate-release), and grammar-validator agent. * chore: update Serena memory files Update project status, real-world ShellSpec patterns, and GitHub workflows optimization memory files. * fix(ci): fix MegaLinter config and remove C from CodeQL - Change FILTER_REGEX_EXCLUDE from `>` to `>-` to strip trailing newline that silently broke all path exclusions - Add YAML_V8R_FILTER_REGEX_EXCLUDE to skip schema validation on .mega-linter.yml (schemastore enum is outdated for BASH_BASH_EXEC) - Remove "c" from CodeQL language matrix since src/parser.c is generated and produces false positives * fix: add missing test spec stub files - Add test/spec/lib.sh stub with calc() function (referenced by 01.very_simple_spec.sh) - Add test/spec/count_cpus.sh stub (referenced by 21.intercept_spec.sh)
9021 lines
222 KiB
JSON
9021 lines
222 KiB
JSON
{
|
|
"$schema": "https://tree-sitter.github.io/tree-sitter/assets/schemas/grammar.schema.json",
|
|
"name": "shellspec",
|
|
"inherits": "bash",
|
|
"word": "word",
|
|
"rules": {
|
|
"program": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_statements"
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
"_statements": {
|
|
"type": "PREC",
|
|
"value": 1,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_statement"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_terminator"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_statement"
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_terminator"
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"_terminated_statement": {
|
|
"type": "REPEAT1",
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_statement"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_terminator"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"_statement": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_statement_not_subshell"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "subshell"
|
|
}
|
|
]
|
|
},
|
|
"_statement_not_subshell": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "redirected_statement"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "variable_assignment"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "variable_assignments"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "command"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "declaration_command"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "unset_command"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "test_command"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "negated_command"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "for_statement"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "c_style_for_statement"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "while_statement"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "if_statement"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "case_statement"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "pipeline"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "list"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "compound_statement"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "function_definition"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "shellspec_describe_block"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "shellspec_context_block"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "shellspec_it_block"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "shellspec_hook_block"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "shellspec_utility_block"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "shellspec_data_block"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "shellspec_hook_statement"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "shellspec_directive_statement"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "shellspec_when_statement"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "shellspec_the_statement"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "shellspec_assert_statement"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "shellspec_mock_block"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "shellspec_path_statement"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "shellspec_set_statement"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "shellspec_dump_statement"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "shellspec_intercept_statement"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "shellspec_todo_statement"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "shellspec_pending_statement"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "shellspec_skip_statement"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "shellspec_text_directive"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "shellspec_const_directive"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "shellspec_output_directive"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "shellspec_preserve_directive"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "shellspec_logger_directive"
|
|
}
|
|
]
|
|
},
|
|
"_statement_not_pipeline": {
|
|
"type": "PREC",
|
|
"value": 1,
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "redirected_statement"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "variable_assignment"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "variable_assignments"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "command"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "declaration_command"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "unset_command"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "test_command"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "negated_command"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "for_statement"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "c_style_for_statement"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "while_statement"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "if_statement"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "case_statement"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "list"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "compound_statement"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "function_definition"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "subshell"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"redirected_statement": {
|
|
"type": "PREC_DYNAMIC",
|
|
"value": -1,
|
|
"content": {
|
|
"type": "PREC_RIGHT",
|
|
"value": -1,
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "body",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_statement"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "redirect",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "REPEAT1",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "file_redirect"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "heredoc_redirect"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "body",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "if_statement"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "while_statement"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "herestring_redirect"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "redirect",
|
|
"content": {
|
|
"type": "REPEAT1",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_redirect"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "herestring_redirect"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"for_statement": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "for"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "select"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "variable",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_simple_variable_name"
|
|
}
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "in"
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "value",
|
|
"content": {
|
|
"type": "REPEAT1",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_literal"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_terminator"
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "body",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "do_group"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"c_style_for_statement": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "for"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "(("
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_for_body"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "))"
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": ";"
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "body",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "do_group"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "compound_statement"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"_for_body": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "initializer",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_c_expression"
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": ","
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_c_expression"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_c_terminator"
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "condition",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_c_expression"
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": ","
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_c_expression"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_c_terminator"
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "update",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_c_expression"
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": ","
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_c_expression"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"_c_expression": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_c_expression_not_assignment"
|
|
},
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_c_variable_assignment"
|
|
},
|
|
"named": true,
|
|
"value": "variable_assignment"
|
|
}
|
|
]
|
|
},
|
|
"_c_expression_not_assignment": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_c_word"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "simple_expansion"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "expansion"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "number"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "string"
|
|
},
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_c_unary_expression"
|
|
},
|
|
"named": true,
|
|
"value": "unary_expression"
|
|
},
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_c_binary_expression"
|
|
},
|
|
"named": true,
|
|
"value": "binary_expression"
|
|
},
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_c_postfix_expression"
|
|
},
|
|
"named": true,
|
|
"value": "postfix_expression"
|
|
},
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_c_parenthesized_expression"
|
|
},
|
|
"named": true,
|
|
"value": "parenthesized_expression"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "command_substitution"
|
|
}
|
|
]
|
|
},
|
|
"_c_variable_assignment": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "name",
|
|
"content": {
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_c_word"
|
|
},
|
|
"named": true,
|
|
"value": "variable_name"
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "="
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "value",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_c_expression"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"_c_unary_expression": {
|
|
"type": "PREC",
|
|
"value": 17,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "operator",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "++"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "--"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_c_expression_not_assignment"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"_c_binary_expression": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "PREC_LEFT",
|
|
"value": 0,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "left",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_c_expression_not_assignment"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "operator",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "+="
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "-="
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "*="
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "/="
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "%="
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "**="
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "<<="
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ">>="
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "&="
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "^="
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "|="
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "right",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_c_expression_not_assignment"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "PREC_LEFT",
|
|
"value": 3,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "left",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_c_expression_not_assignment"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "operator",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "||"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "-o"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "right",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_c_expression_not_assignment"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "PREC_LEFT",
|
|
"value": 4,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "left",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_c_expression_not_assignment"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "operator",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "&&"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "-a"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "right",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_c_expression_not_assignment"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "PREC_LEFT",
|
|
"value": 5,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "left",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_c_expression_not_assignment"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "operator",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "|"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "right",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_c_expression_not_assignment"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "PREC_LEFT",
|
|
"value": 6,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "left",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_c_expression_not_assignment"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "operator",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "^"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "right",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_c_expression_not_assignment"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "PREC_LEFT",
|
|
"value": 7,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "left",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_c_expression_not_assignment"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "operator",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "&"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "right",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_c_expression_not_assignment"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "PREC_LEFT",
|
|
"value": 8,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "left",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_c_expression_not_assignment"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "operator",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "=="
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "!="
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "right",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_c_expression_not_assignment"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "PREC_LEFT",
|
|
"value": 9,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "left",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_c_expression_not_assignment"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "operator",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "<"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ">"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "<="
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ">="
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "right",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_c_expression_not_assignment"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "PREC_LEFT",
|
|
"value": 12,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "left",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_c_expression_not_assignment"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "operator",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "<<"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ">>"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "right",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_c_expression_not_assignment"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "PREC_LEFT",
|
|
"value": 13,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "left",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_c_expression_not_assignment"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "operator",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "+"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "-"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "right",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_c_expression_not_assignment"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "PREC_LEFT",
|
|
"value": 14,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "left",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_c_expression_not_assignment"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "operator",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "*"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "/"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "%"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "right",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_c_expression_not_assignment"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "PREC_RIGHT",
|
|
"value": 15,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "left",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_c_expression_not_assignment"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "operator",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "**"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "right",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_c_expression_not_assignment"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"_c_postfix_expression": {
|
|
"type": "PREC",
|
|
"value": 18,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_c_expression_not_assignment"
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "operator",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "++"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "--"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"_c_parenthesized_expression": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "("
|
|
},
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_c_expression"
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": ","
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_c_expression"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ")"
|
|
}
|
|
]
|
|
},
|
|
"_c_word": {
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "PATTERN",
|
|
"value": "[a-zA-Z_][a-zA-Z0-9_]*"
|
|
},
|
|
"named": true,
|
|
"value": "word"
|
|
},
|
|
"while_statement": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "while"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "until"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "condition",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_terminated_statement"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "body",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "do_group"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"do_group": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "do"
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_terminated_statement"
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "done"
|
|
}
|
|
]
|
|
},
|
|
"if_statement": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "if"
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "condition",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_terminated_statement"
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "then"
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_terminated_statement"
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "elif_clause"
|
|
}
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "else_clause"
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "fi"
|
|
}
|
|
]
|
|
},
|
|
"elif_clause": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "elif"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_terminated_statement"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "then"
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_terminated_statement"
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"else_clause": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "else"
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_terminated_statement"
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"case_statement": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "case"
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "value",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_literal"
|
|
}
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_terminator"
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "in"
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_terminator"
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "case_item"
|
|
}
|
|
},
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "last_case_item"
|
|
},
|
|
"named": true,
|
|
"value": "case_item"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "esac"
|
|
}
|
|
]
|
|
},
|
|
"case_item": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "("
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "value",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_literal"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_extglob_blob"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "|"
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "value",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_literal"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_extglob_blob"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ")"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_statements"
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "PREC",
|
|
"value": 1,
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "termination",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": ";;"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "fallthrough",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": ";&"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ";;&"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"last_case_item": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "("
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "value",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_literal"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_extglob_blob"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "|"
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "value",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_literal"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_extglob_blob"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ")"
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_statements"
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "PREC",
|
|
"value": 1,
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": ";;"
|
|
}
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"function_definition": {
|
|
"type": "PREC_RIGHT",
|
|
"value": 0,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "function"
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "name",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "word"
|
|
}
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "("
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ")"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "name",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "word"
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "("
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ")"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "body",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "compound_statement"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "subshell"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "test_command"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "if_statement"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "redirect",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_redirect"
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"compound_statement": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "{"
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_terminated_statement"
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "TOKEN",
|
|
"content": {
|
|
"type": "PREC",
|
|
"value": -1,
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "}"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "(("
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_arithmetic_expression"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ","
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_arithmetic_expression"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "))"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"subshell": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "("
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_statements"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ")"
|
|
}
|
|
]
|
|
},
|
|
"pipeline": {
|
|
"type": "PREC_RIGHT",
|
|
"value": 0,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_statement_not_pipeline"
|
|
},
|
|
{
|
|
"type": "REPEAT1",
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "|"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "|&"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_statement_not_pipeline"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"list": {
|
|
"type": "PREC_LEFT",
|
|
"value": -1,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_statement"
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "&&"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "||"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_statement"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"negated_command": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "!"
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "PREC",
|
|
"value": 2,
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "command"
|
|
}
|
|
},
|
|
{
|
|
"type": "PREC",
|
|
"value": 1,
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "variable_assignment"
|
|
}
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "test_command"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "subshell"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"test_command": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "["
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "redirected_statement"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "]"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "[["
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
},
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_test_command_binary_expression"
|
|
},
|
|
"named": true,
|
|
"value": "binary_expression"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "]]"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"_test_command_binary_expression": {
|
|
"type": "PREC",
|
|
"value": 1,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "left",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "operator",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "="
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "right",
|
|
"content": {
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_regex_no_space"
|
|
},
|
|
"named": true,
|
|
"value": "regex"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"declaration_command": {
|
|
"type": "PREC_LEFT",
|
|
"value": 0,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "declare"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "typeset"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "export"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "readonly"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "local"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_literal"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_simple_variable_name"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "variable_assignment"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"unset_command": {
|
|
"type": "PREC_LEFT",
|
|
"value": 0,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "unset"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "unsetenv"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_literal"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_simple_variable_name"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"command": {
|
|
"type": "PREC_LEFT",
|
|
"value": 0,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "variable_assignment"
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "redirect",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_redirect"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "name",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "command_name"
|
|
}
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "argument",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_literal"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "argument",
|
|
"content": {
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_bare_dollar"
|
|
},
|
|
"named": false,
|
|
"value": "$"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "argument",
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "=~"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "=="
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_literal"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "regex"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "redirect",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "herestring_redirect"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "subshell"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"command_name": {
|
|
"type": "SYMBOL",
|
|
"name": "_literal"
|
|
},
|
|
"variable_assignment": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "name",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "variable_name"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "subscript"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "="
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "+="
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "value",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_literal"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "array"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_empty_value"
|
|
},
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_comment_word"
|
|
},
|
|
"named": true,
|
|
"value": "word"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"variable_assignments": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "variable_assignment"
|
|
},
|
|
{
|
|
"type": "REPEAT1",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "variable_assignment"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"subscript": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "name",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "variable_name"
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "["
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "index",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_literal"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "binary_expression"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "unary_expression"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "compound_statement"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "subshell"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_concat"
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "]"
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_concat"
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"file_redirect": {
|
|
"type": "PREC_LEFT",
|
|
"value": 0,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "descriptor",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "file_descriptor"
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "<"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ">"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ">>"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "&>"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "&>>"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "<&"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ">&"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ">|"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "destination",
|
|
"content": {
|
|
"type": "REPEAT1",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_literal"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "<&-"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ">&-"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "destination",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_literal"
|
|
}
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"heredoc_redirect": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "descriptor",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "file_descriptor"
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "<<"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "<<-"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "heredoc_start"
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_heredoc_pipeline"
|
|
},
|
|
"named": true,
|
|
"value": "pipeline"
|
|
},
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "redirect",
|
|
"content": {
|
|
"type": "REPEAT1",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_redirect"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_heredoc_expression"
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_heredoc_expression"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_heredoc_command"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "PATTERN",
|
|
"value": "\\n"
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_heredoc_body"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_simple_heredoc_body"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"_heredoc_pipeline": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "|"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "|&"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_statement"
|
|
}
|
|
]
|
|
},
|
|
"_heredoc_expression": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "operator",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "||"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "&&"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "right",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_statement"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"_heredoc_command": {
|
|
"type": "REPEAT1",
|
|
"content": {
|
|
"type": "FIELD",
|
|
"name": "argument",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_literal"
|
|
}
|
|
}
|
|
},
|
|
"_heredoc_body": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "heredoc_body"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "heredoc_end"
|
|
}
|
|
]
|
|
},
|
|
"heredoc_body": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_heredoc_body_beginning"
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "expansion"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "simple_expansion"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "command_substitution"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "heredoc_content"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"_simple_heredoc_body": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "simple_heredoc_body"
|
|
},
|
|
"named": true,
|
|
"value": "heredoc_body"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "heredoc_end"
|
|
}
|
|
]
|
|
},
|
|
"herestring_redirect": {
|
|
"type": "PREC_LEFT",
|
|
"value": 0,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "descriptor",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "file_descriptor"
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "<<<"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_literal"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"_redirect": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "file_redirect"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "herestring_redirect"
|
|
}
|
|
]
|
|
},
|
|
"_expression": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_literal"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "unary_expression"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "ternary_expression"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "binary_expression"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "postfix_expression"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "parenthesized_expression"
|
|
}
|
|
]
|
|
},
|
|
"binary_expression": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "PREC_LEFT",
|
|
"value": 0,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "left",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "operator",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "+="
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "-="
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "*="
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "/="
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "%="
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "**="
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "<<="
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ">>="
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "&="
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "^="
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "|="
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "right",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "PREC_LEFT",
|
|
"value": 1,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "left",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "operator",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "="
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "=~"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "right",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "PREC_LEFT",
|
|
"value": 3,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "left",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "operator",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "||"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "right",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "PREC_LEFT",
|
|
"value": 4,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "left",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "operator",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "&&"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "right",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "PREC_LEFT",
|
|
"value": 5,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "left",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "operator",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "|"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "right",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "PREC_LEFT",
|
|
"value": 6,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "left",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "operator",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "^"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "right",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "PREC_LEFT",
|
|
"value": 7,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "left",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "operator",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "&"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "right",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "PREC_LEFT",
|
|
"value": 8,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "left",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "operator",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "=="
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "!="
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "right",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "PREC_LEFT",
|
|
"value": 9,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "left",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "operator",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "<"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ">"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "<="
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ">="
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "right",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "PREC_LEFT",
|
|
"value": 10,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "left",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "operator",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "test_operator"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "right",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "PREC_LEFT",
|
|
"value": 12,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "left",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "operator",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "<<"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ">>"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "right",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "PREC_LEFT",
|
|
"value": 13,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "left",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "operator",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "+"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "-"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "right",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "PREC_LEFT",
|
|
"value": 14,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "left",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "operator",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "*"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "/"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "%"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "right",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "PREC_RIGHT",
|
|
"value": 15,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "left",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "operator",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "**"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "right",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "PREC",
|
|
"value": 1,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "left",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "operator",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "=~"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "right",
|
|
"content": {
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_regex_no_space"
|
|
},
|
|
"named": true,
|
|
"value": "regex"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "PREC",
|
|
"value": 8,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "left",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "operator",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "=="
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "!="
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "right",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_extglob_blob"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"ternary_expression": {
|
|
"type": "PREC_LEFT",
|
|
"value": 2,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "condition",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "?"
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "consequence",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ":"
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "alternative",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"unary_expression": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "PREC",
|
|
"value": 17,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "operator",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "TOKEN",
|
|
"content": {
|
|
"type": "PREC",
|
|
"value": 1,
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "++"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"type": "TOKEN",
|
|
"content": {
|
|
"type": "PREC",
|
|
"value": 1,
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "--"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "PREC",
|
|
"value": 11,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "operator",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "TOKEN",
|
|
"content": {
|
|
"type": "PREC",
|
|
"value": 1,
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "-"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"type": "TOKEN",
|
|
"content": {
|
|
"type": "PREC",
|
|
"value": 1,
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "+"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"type": "TOKEN",
|
|
"content": {
|
|
"type": "PREC",
|
|
"value": 1,
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "~"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "PREC_RIGHT",
|
|
"value": 11,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "operator",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "!"
|
|
}
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "PREC_RIGHT",
|
|
"value": 10,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "operator",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "test_operator"
|
|
}
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"postfix_expression": {
|
|
"type": "PREC",
|
|
"value": 18,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "operator",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "++"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "--"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"parenthesized_expression": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "("
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ")"
|
|
}
|
|
]
|
|
},
|
|
"_literal": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "concatenation"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_primary_expression"
|
|
},
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "PREC",
|
|
"value": -2,
|
|
"content": {
|
|
"type": "REPEAT1",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_special_character"
|
|
}
|
|
}
|
|
},
|
|
"named": true,
|
|
"value": "word"
|
|
}
|
|
]
|
|
},
|
|
"_primary_expression": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "word"
|
|
},
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "test_operator"
|
|
},
|
|
"named": true,
|
|
"value": "word"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "raw_string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "translated_string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "ansi_c_string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "number"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "expansion"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "simple_expansion"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "command_substitution"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "process_substitution"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "arithmetic_expansion"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "brace_expression"
|
|
}
|
|
]
|
|
},
|
|
"arithmetic_expansion": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "$(("
|
|
},
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_arithmetic_expression"
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": ","
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_arithmetic_expression"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "))"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "$["
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_arithmetic_expression"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "]"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"brace_expression": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_brace_start"
|
|
},
|
|
"named": false,
|
|
"value": "{"
|
|
},
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "IMMEDIATE_TOKEN",
|
|
"content": {
|
|
"type": "PATTERN",
|
|
"value": "\\d+"
|
|
}
|
|
},
|
|
"named": true,
|
|
"value": "number"
|
|
},
|
|
{
|
|
"type": "IMMEDIATE_TOKEN",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": ".."
|
|
}
|
|
},
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "IMMEDIATE_TOKEN",
|
|
"content": {
|
|
"type": "PATTERN",
|
|
"value": "\\d+"
|
|
}
|
|
},
|
|
"named": true,
|
|
"value": "number"
|
|
},
|
|
{
|
|
"type": "IMMEDIATE_TOKEN",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "}"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"_arithmetic_expression": {
|
|
"type": "PREC",
|
|
"value": 1,
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_arithmetic_literal"
|
|
},
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_arithmetic_unary_expression"
|
|
},
|
|
"named": true,
|
|
"value": "unary_expression"
|
|
},
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_arithmetic_ternary_expression"
|
|
},
|
|
"named": true,
|
|
"value": "ternary_expression"
|
|
},
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_arithmetic_binary_expression"
|
|
},
|
|
"named": true,
|
|
"value": "binary_expression"
|
|
},
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_arithmetic_postfix_expression"
|
|
},
|
|
"named": true,
|
|
"value": "postfix_expression"
|
|
},
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_arithmetic_parenthesized_expression"
|
|
},
|
|
"named": true,
|
|
"value": "parenthesized_expression"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "command_substitution"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"_arithmetic_literal": {
|
|
"type": "PREC",
|
|
"value": 1,
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "number"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "subscript"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "simple_expansion"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "expansion"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_simple_variable_name"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "variable_name"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "raw_string"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"_arithmetic_binary_expression": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "PREC_LEFT",
|
|
"value": 0,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "left",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_arithmetic_expression"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "operator",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "+="
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "-="
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "*="
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "/="
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "%="
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "**="
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "<<="
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ">>="
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "&="
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "^="
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "|="
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "right",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_arithmetic_expression"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "PREC_LEFT",
|
|
"value": 1,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "left",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_arithmetic_expression"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "operator",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "="
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "=~"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "right",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_arithmetic_expression"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "PREC_LEFT",
|
|
"value": 3,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "left",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_arithmetic_expression"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "operator",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "||"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "right",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_arithmetic_expression"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "PREC_LEFT",
|
|
"value": 4,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "left",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_arithmetic_expression"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "operator",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "&&"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "right",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_arithmetic_expression"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "PREC_LEFT",
|
|
"value": 5,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "left",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_arithmetic_expression"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "operator",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "|"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "right",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_arithmetic_expression"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "PREC_LEFT",
|
|
"value": 6,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "left",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_arithmetic_expression"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "operator",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "^"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "right",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_arithmetic_expression"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "PREC_LEFT",
|
|
"value": 7,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "left",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_arithmetic_expression"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "operator",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "&"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "right",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_arithmetic_expression"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "PREC_LEFT",
|
|
"value": 8,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "left",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_arithmetic_expression"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "operator",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "=="
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "!="
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "right",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_arithmetic_expression"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "PREC_LEFT",
|
|
"value": 9,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "left",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_arithmetic_expression"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "operator",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "<"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ">"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "<="
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ">="
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "right",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_arithmetic_expression"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "PREC_LEFT",
|
|
"value": 12,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "left",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_arithmetic_expression"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "operator",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "<<"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ">>"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "right",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_arithmetic_expression"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "PREC_LEFT",
|
|
"value": 13,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "left",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_arithmetic_expression"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "operator",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "+"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "-"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "right",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_arithmetic_expression"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "PREC_LEFT",
|
|
"value": 14,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "left",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_arithmetic_expression"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "operator",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "*"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "/"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "%"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "right",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_arithmetic_expression"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "PREC_LEFT",
|
|
"value": 15,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "left",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_arithmetic_expression"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "operator",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "**"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "right",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_arithmetic_expression"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"_arithmetic_ternary_expression": {
|
|
"type": "PREC_LEFT",
|
|
"value": 2,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "condition",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_arithmetic_expression"
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "?"
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "consequence",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_arithmetic_expression"
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ":"
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "alternative",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_arithmetic_expression"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"_arithmetic_unary_expression": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "PREC",
|
|
"value": 17,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "operator",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "TOKEN",
|
|
"content": {
|
|
"type": "PREC",
|
|
"value": 1,
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "++"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"type": "TOKEN",
|
|
"content": {
|
|
"type": "PREC",
|
|
"value": 1,
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "--"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_arithmetic_expression"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "PREC",
|
|
"value": 11,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "operator",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "TOKEN",
|
|
"content": {
|
|
"type": "PREC",
|
|
"value": 1,
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "-"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"type": "TOKEN",
|
|
"content": {
|
|
"type": "PREC",
|
|
"value": 1,
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "+"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"type": "TOKEN",
|
|
"content": {
|
|
"type": "PREC",
|
|
"value": 1,
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "~"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_arithmetic_expression"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "PREC_RIGHT",
|
|
"value": 11,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "operator",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "!"
|
|
}
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_arithmetic_expression"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"_arithmetic_postfix_expression": {
|
|
"type": "PREC",
|
|
"value": 18,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_arithmetic_expression"
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "operator",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "++"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "--"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"_arithmetic_parenthesized_expression": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "("
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_arithmetic_expression"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ")"
|
|
}
|
|
]
|
|
},
|
|
"concatenation": {
|
|
"type": "PREC",
|
|
"value": -1,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_primary_expression"
|
|
},
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_special_character"
|
|
},
|
|
"named": true,
|
|
"value": "word"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "REPEAT1",
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_concat"
|
|
},
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "PATTERN",
|
|
"value": "`\\s*`"
|
|
},
|
|
"named": false,
|
|
"value": "``"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_primary_expression"
|
|
},
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_special_character"
|
|
},
|
|
"named": true,
|
|
"value": "word"
|
|
},
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_comment_word"
|
|
},
|
|
"named": true,
|
|
"value": "word"
|
|
},
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_bare_dollar"
|
|
},
|
|
"named": false,
|
|
"value": "$"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_concat"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "$"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"_special_character": {
|
|
"type": "TOKEN",
|
|
"content": {
|
|
"type": "PREC",
|
|
"value": -1,
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "{"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "}"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "["
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "]"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"string": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "\""
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "$"
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "string_content"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "expansion"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "simple_expansion"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "command_substitution"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "arithmetic_expansion"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_concat"
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "$"
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "\""
|
|
}
|
|
]
|
|
},
|
|
"string_content": {
|
|
"type": "TOKEN",
|
|
"content": {
|
|
"type": "PREC",
|
|
"value": -1,
|
|
"content": {
|
|
"type": "PATTERN",
|
|
"value": "([^\"`$\\\\\\r\\n]|\\\\(.|\\r?\\n))+"
|
|
}
|
|
}
|
|
},
|
|
"translated_string": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "$"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "string"
|
|
}
|
|
]
|
|
},
|
|
"array": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "("
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_literal"
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ")"
|
|
}
|
|
]
|
|
},
|
|
"raw_string": {
|
|
"type": "PATTERN",
|
|
"value": "'[^']*'"
|
|
},
|
|
"ansi_c_string": {
|
|
"type": "PATTERN",
|
|
"value": "\\$'([^']|\\\\')*'"
|
|
},
|
|
"number": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "PATTERN",
|
|
"value": "-?(0x)?[0-9]+(#[0-9A-Za-z@_]+)?"
|
|
},
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "PATTERN",
|
|
"value": "-?(0x)?[0-9]+#"
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "expansion"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "command_substitution"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"simple_expansion": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "$"
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_simple_variable_name"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_multiline_variable_name"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_special_variable_name"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "variable_name"
|
|
},
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "!"
|
|
},
|
|
"named": true,
|
|
"value": "special_variable_name"
|
|
},
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "#"
|
|
},
|
|
"named": true,
|
|
"value": "special_variable_name"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"string_expansion": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "$"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "string"
|
|
}
|
|
]
|
|
},
|
|
"expansion": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "${"
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_expansion_body"
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "}"
|
|
}
|
|
]
|
|
},
|
|
"_expansion_body": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "REPEAT1",
|
|
"content": {
|
|
"type": "FIELD",
|
|
"name": "operator",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_external_expansion_sym_hash"
|
|
},
|
|
"named": false,
|
|
"value": "#"
|
|
},
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_external_expansion_sym_bang"
|
|
},
|
|
"named": false,
|
|
"value": "!"
|
|
},
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_external_expansion_sym_equal"
|
|
},
|
|
"named": false,
|
|
"value": "="
|
|
}
|
|
]
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "operator",
|
|
"content": {
|
|
"type": "IMMEDIATE_TOKEN",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "!"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "variable_name"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_simple_variable_name"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_special_variable_name"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "subscript"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_expansion_expression"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_expansion_regex"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_expansion_regex_replacement"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_expansion_regex_removal"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_expansion_max_length"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_expansion_operator"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "operator",
|
|
"content": {
|
|
"type": "IMMEDIATE_TOKEN",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "!"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_simple_variable_name"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "variable_name"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "operator",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "IMMEDIATE_TOKEN",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "@"
|
|
}
|
|
},
|
|
{
|
|
"type": "IMMEDIATE_TOKEN",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "*"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "operator",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "IMMEDIATE_TOKEN",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "#"
|
|
}
|
|
},
|
|
{
|
|
"type": "IMMEDIATE_TOKEN",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "!"
|
|
}
|
|
},
|
|
{
|
|
"type": "IMMEDIATE_TOKEN",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "="
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "subscript"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_simple_variable_name"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_special_variable_name"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "command_substitution"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "FIELD",
|
|
"name": "operator",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_external_expansion_sym_hash"
|
|
},
|
|
"named": false,
|
|
"value": "#"
|
|
},
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_external_expansion_sym_bang"
|
|
},
|
|
"named": false,
|
|
"value": "!"
|
|
},
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_external_expansion_sym_equal"
|
|
},
|
|
"named": false,
|
|
"value": "="
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"_expansion_expression": {
|
|
"type": "PREC",
|
|
"value": 1,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "operator",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "IMMEDIATE_TOKEN",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "="
|
|
}
|
|
},
|
|
{
|
|
"type": "IMMEDIATE_TOKEN",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": ":="
|
|
}
|
|
},
|
|
{
|
|
"type": "IMMEDIATE_TOKEN",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "-"
|
|
}
|
|
},
|
|
{
|
|
"type": "IMMEDIATE_TOKEN",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": ":-"
|
|
}
|
|
},
|
|
{
|
|
"type": "IMMEDIATE_TOKEN",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "+"
|
|
}
|
|
},
|
|
{
|
|
"type": "IMMEDIATE_TOKEN",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": ":+"
|
|
}
|
|
},
|
|
{
|
|
"type": "IMMEDIATE_TOKEN",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "?"
|
|
}
|
|
},
|
|
{
|
|
"type": "IMMEDIATE_TOKEN",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": ":?"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_concatenation_in_expansion"
|
|
},
|
|
"named": true,
|
|
"value": "concatenation"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "command_substitution"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "word"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "expansion"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "simple_expansion"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "array"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "raw_string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "ansi_c_string"
|
|
},
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_expansion_word"
|
|
},
|
|
"named": true,
|
|
"value": "word"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"_expansion_regex": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "operator",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "#"
|
|
},
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_immediate_double_hash"
|
|
},
|
|
"named": false,
|
|
"value": "##"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "%"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "%%"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "regex"
|
|
},
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": ")"
|
|
},
|
|
"named": true,
|
|
"value": "regex"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "raw_string"
|
|
},
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "PATTERN",
|
|
"value": "\\s+"
|
|
},
|
|
"named": true,
|
|
"value": "regex"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"_expansion_regex_replacement": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "operator",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "/"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "//"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "/#"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "/%"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_regex_no_slash"
|
|
},
|
|
"named": true,
|
|
"value": "regex"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "command_substitution"
|
|
},
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "string"
|
|
},
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_regex_no_slash"
|
|
},
|
|
"named": true,
|
|
"value": "regex"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "operator",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "/"
|
|
}
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_primary_expression"
|
|
},
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "PREC",
|
|
"value": -2,
|
|
"content": {
|
|
"type": "REPEAT1",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_special_character"
|
|
}
|
|
}
|
|
},
|
|
"named": true,
|
|
"value": "word"
|
|
},
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "command_substitution"
|
|
},
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_expansion_word"
|
|
},
|
|
"named": true,
|
|
"value": "word"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_expansion_word"
|
|
},
|
|
"named": true,
|
|
"value": "word"
|
|
},
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_concatenation_in_expansion"
|
|
},
|
|
"named": true,
|
|
"value": "concatenation"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "array"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "operator",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "/"
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"_expansion_regex_removal": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "operator",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": ","
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ",,"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "^"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "^^"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "regex"
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"_expansion_max_length": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "operator",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": ":"
|
|
}
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_simple_variable_name"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "number"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "arithmetic_expansion"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "expansion"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "parenthesized_expression"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "command_substitution"
|
|
},
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_expansion_max_length_binary_expression"
|
|
},
|
|
"named": true,
|
|
"value": "binary_expression"
|
|
},
|
|
{
|
|
"type": "PATTERN",
|
|
"value": "\\n"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "operator",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": ":"
|
|
}
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "simple_expansion"
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_simple_variable_name"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "number"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "arithmetic_expansion"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "expansion"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "parenthesized_expression"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "command_substitution"
|
|
},
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_expansion_max_length_binary_expression"
|
|
},
|
|
"named": true,
|
|
"value": "binary_expression"
|
|
},
|
|
{
|
|
"type": "PATTERN",
|
|
"value": "\\n"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"_expansion_max_length_expression": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_simple_variable_name"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "number"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "expansion"
|
|
},
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_expansion_max_length_binary_expression"
|
|
},
|
|
"named": true,
|
|
"value": "binary_expression"
|
|
}
|
|
]
|
|
},
|
|
"_expansion_max_length_binary_expression": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "PREC_LEFT",
|
|
"value": 13,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_expansion_max_length_expression"
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "operator",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "+"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "-"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_expansion_max_length_expression"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "PREC_LEFT",
|
|
"value": 14,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_expansion_max_length_expression"
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "operator",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "*"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "/"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "%"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_expansion_max_length_expression"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"_expansion_operator": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "operator",
|
|
"content": {
|
|
"type": "IMMEDIATE_TOKEN",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "@"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "operator",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "IMMEDIATE_TOKEN",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "U"
|
|
}
|
|
},
|
|
{
|
|
"type": "IMMEDIATE_TOKEN",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "u"
|
|
}
|
|
},
|
|
{
|
|
"type": "IMMEDIATE_TOKEN",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "L"
|
|
}
|
|
},
|
|
{
|
|
"type": "IMMEDIATE_TOKEN",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "Q"
|
|
}
|
|
},
|
|
{
|
|
"type": "IMMEDIATE_TOKEN",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "E"
|
|
}
|
|
},
|
|
{
|
|
"type": "IMMEDIATE_TOKEN",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "P"
|
|
}
|
|
},
|
|
{
|
|
"type": "IMMEDIATE_TOKEN",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "A"
|
|
}
|
|
},
|
|
{
|
|
"type": "IMMEDIATE_TOKEN",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "K"
|
|
}
|
|
},
|
|
{
|
|
"type": "IMMEDIATE_TOKEN",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "a"
|
|
}
|
|
},
|
|
{
|
|
"type": "IMMEDIATE_TOKEN",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "k"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"_concatenation_in_expansion": {
|
|
"type": "PREC",
|
|
"value": -2,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "word"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "variable_name"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "simple_expansion"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "expansion"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "raw_string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "ansi_c_string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "command_substitution"
|
|
},
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_expansion_word"
|
|
},
|
|
"named": true,
|
|
"value": "word"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "array"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "process_substitution"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "REPEAT1",
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_concat"
|
|
},
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "PATTERN",
|
|
"value": "`\\s*`"
|
|
},
|
|
"named": false,
|
|
"value": "``"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "word"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "variable_name"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "simple_expansion"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "expansion"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "raw_string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "ansi_c_string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "command_substitution"
|
|
},
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_expansion_word"
|
|
},
|
|
"named": true,
|
|
"value": "word"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "array"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "process_substitution"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"command_substitution": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "$("
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_statements"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ")"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "$("
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "redirect",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "file_redirect"
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ")"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "PREC",
|
|
"value": 1,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "`"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_statements"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "`"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "$`"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_statements"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "`"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"process_substitution": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "<("
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ">("
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_statements"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ")"
|
|
}
|
|
]
|
|
},
|
|
"_extglob_blob": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "extglob_pattern"
|
|
},
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "extglob_pattern"
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "expansion"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "command_substitution"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "extglob_pattern"
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"comment": {
|
|
"type": "TOKEN",
|
|
"content": {
|
|
"type": "PREC",
|
|
"value": -10,
|
|
"content": {
|
|
"type": "PATTERN",
|
|
"value": "#.*"
|
|
}
|
|
}
|
|
},
|
|
"_comment_word": {
|
|
"type": "TOKEN",
|
|
"content": {
|
|
"type": "PREC",
|
|
"value": -8,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "PATTERN",
|
|
"value": "[^'\"<>{}\\[\\]()`$|&;\\\\\\s]"
|
|
},
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "\\"
|
|
},
|
|
{
|
|
"type": "PATTERN",
|
|
"value": "[^\\s]"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "PATTERN",
|
|
"value": "[^'\"<>{}\\[\\]()`$|&;\\\\\\s]"
|
|
},
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "\\"
|
|
},
|
|
{
|
|
"type": "PATTERN",
|
|
"value": "[^\\s]"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "\\ "
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"_simple_variable_name": {
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "PATTERN",
|
|
"value": "\\w+"
|
|
},
|
|
"named": true,
|
|
"value": "variable_name"
|
|
},
|
|
"_multiline_variable_name": {
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "TOKEN",
|
|
"content": {
|
|
"type": "PREC",
|
|
"value": -1,
|
|
"content": {
|
|
"type": "PATTERN",
|
|
"value": "(\\w|\\\\\\r?\\n)+"
|
|
}
|
|
}
|
|
},
|
|
"named": true,
|
|
"value": "variable_name"
|
|
},
|
|
"_special_variable_name": {
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "*"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "@"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "?"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "!"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "#"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "-"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "$"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "_"
|
|
}
|
|
]
|
|
},
|
|
"named": true,
|
|
"value": "special_variable_name"
|
|
},
|
|
"word": {
|
|
"type": "TOKEN",
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "PATTERN",
|
|
"value": "[^#'\"<>{}\\[\\]()`$|&;\\\\\\s]"
|
|
},
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "\\"
|
|
},
|
|
{
|
|
"type": "PATTERN",
|
|
"value": "[^\\s]"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "PATTERN",
|
|
"value": "[^'\"<>{}\\[\\]()`$|&;\\\\\\s]"
|
|
},
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "\\"
|
|
},
|
|
{
|
|
"type": "PATTERN",
|
|
"value": "[^\\s]"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "\\ "
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"_c_terminator": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": ";"
|
|
},
|
|
{
|
|
"type": "PATTERN",
|
|
"value": "\\n"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "&"
|
|
}
|
|
]
|
|
},
|
|
"_terminator": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": ";"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ";;"
|
|
},
|
|
{
|
|
"type": "PATTERN",
|
|
"value": "\\n"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "&"
|
|
}
|
|
]
|
|
},
|
|
"shellspec_describe_block": {
|
|
"type": "PREC_RIGHT",
|
|
"value": 1,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "Describe"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "fDescribe"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "xDescribe"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "description",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "raw_string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "word"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_terminated_statement"
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "End"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"shellspec_context_block": {
|
|
"type": "PREC_RIGHT",
|
|
"value": 1,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "Context"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "ExampleGroup"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "fContext"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "xContext"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "fExampleGroup"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "xExampleGroup"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "description",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "raw_string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "word"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_terminated_statement"
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "End"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"shellspec_it_block": {
|
|
"type": "PREC_RIGHT",
|
|
"value": 1,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "It"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "Example"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "Specify"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "fIt"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "fExample"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "fSpecify"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "xIt"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "xExample"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "xSpecify"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "description",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "raw_string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "word"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_terminated_statement"
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "End"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"shellspec_hook_block": {
|
|
"type": "PREC_RIGHT",
|
|
"value": 1,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "BeforeEach"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "AfterEach"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "BeforeAll"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "AfterAll"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "BeforeCall"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "AfterCall"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "BeforeRun"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "AfterRun"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "label",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "raw_string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "word"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_terminated_statement"
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "End"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"shellspec_utility_block": {
|
|
"type": "PREC_RIGHT",
|
|
"value": 1,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "Parameters"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "Parameters:block"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "Parameters:value"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "Parameters:matrix"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "Parameters:dynamic"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "label",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "raw_string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "word"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_terminated_statement"
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "End"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"shellspec_data_block": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "PREC_RIGHT",
|
|
"value": 6,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "Data"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "Data:raw"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "Data:expand"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "|"
|
|
},
|
|
{
|
|
"type": "REPEAT1",
|
|
"content": {
|
|
"type": "FIELD",
|
|
"name": "filter",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "raw_string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "word"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"type": "REPEAT1",
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "#|"
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "data_line",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "shellspec_data_line_content"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "End"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "PREC_RIGHT",
|
|
"value": 5,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "Data"
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": ":"
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "modifier",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "raw"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "expand"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "Data:raw"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "Data:expand"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "REPEAT1",
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "#|"
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "data_line",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "shellspec_data_line_content"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "End"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "PREC_RIGHT",
|
|
"value": 4,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "Data"
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": ":"
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "modifier",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "raw"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "expand"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "label",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "raw_string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "word"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "statements",
|
|
"content": {
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_terminated_statement"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "End"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "PREC_RIGHT",
|
|
"value": 3,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "Data"
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "argument",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "raw_string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "word"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "FIELD",
|
|
"name": "extra_argument",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "raw_string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "word"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "|"
|
|
},
|
|
{
|
|
"type": "REPEAT1",
|
|
"content": {
|
|
"type": "FIELD",
|
|
"name": "filter",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "raw_string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "word"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "Data"
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": ":"
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "modifier",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "raw"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "expand"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "argument",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "raw_string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "word"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"shellspec_when_statement": {
|
|
"type": "PREC_RIGHT",
|
|
"value": 2,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "When"
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "type",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "call"
|
|
},
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "run"
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "command"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "script"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "source"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "function",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "raw_string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "word"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "FIELD",
|
|
"name": "argument",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "raw_string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "word"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"shellspec_subject": {
|
|
"type": "REPEAT1",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "raw_string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "word"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"shellspec_matcher": {
|
|
"type": "REPEAT1",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "raw_string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "word"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"shellspec_the_statement": {
|
|
"type": "PREC_RIGHT",
|
|
"value": 2,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "The"
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "subject",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "shellspec_subject"
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "should"
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "negation",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "not"
|
|
}
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "matcher",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "shellspec_matcher"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"shellspec_assert_statement": {
|
|
"type": "PREC_RIGHT",
|
|
"value": 2,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "Assert"
|
|
},
|
|
{
|
|
"type": "REPEAT1",
|
|
"content": {
|
|
"type": "FIELD",
|
|
"name": "argument",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "raw_string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "word"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"shellspec_mock_block": {
|
|
"type": "PREC_RIGHT",
|
|
"value": 1,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "Mock"
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "name",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "raw_string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "word"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_terminated_statement"
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "End"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"shellspec_path_statement": {
|
|
"type": "PREC_RIGHT",
|
|
"value": 2,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "Path"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "File"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "Dir"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "REPEAT1",
|
|
"content": {
|
|
"type": "FIELD",
|
|
"name": "argument",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "raw_string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "word"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"shellspec_set_statement": {
|
|
"type": "PREC_RIGHT",
|
|
"value": 2,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "Set"
|
|
},
|
|
{
|
|
"type": "REPEAT1",
|
|
"content": {
|
|
"type": "FIELD",
|
|
"name": "option",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "raw_string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "word"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"shellspec_dump_statement": {
|
|
"type": "PREC_RIGHT",
|
|
"value": 2,
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "Dump"
|
|
}
|
|
},
|
|
"shellspec_intercept_statement": {
|
|
"type": "PREC_RIGHT",
|
|
"value": 2,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "Intercept"
|
|
},
|
|
{
|
|
"type": "REPEAT1",
|
|
"content": {
|
|
"type": "FIELD",
|
|
"name": "argument",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "raw_string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "word"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"shellspec_hook_statement": {
|
|
"type": "PREC_RIGHT",
|
|
"value": 2,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "Before"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "After"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "BeforeEach"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "AfterEach"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "BeforeAll"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "AfterAll"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "BeforeCall"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "AfterCall"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "BeforeRun"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "AfterRun"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "REPEAT1",
|
|
"content": {
|
|
"type": "FIELD",
|
|
"name": "argument",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "raw_string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "word"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"shellspec_directive_statement": {
|
|
"type": "PREC_RIGHT",
|
|
"value": 2,
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "Include"
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "path",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "raw_string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "word"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "PREC_RIGHT",
|
|
"value": 3,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "Skip"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "if"
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "reason",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "raw_string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "word"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "condition",
|
|
"content": {
|
|
"type": "REPEAT1",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "word"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "raw_string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "command_substitution"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "test_command"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"shellspec_todo_statement": {
|
|
"type": "PREC_RIGHT",
|
|
"value": 2,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "Todo"
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "description",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "raw_string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "word"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"shellspec_pending_statement": {
|
|
"type": "PREC_RIGHT",
|
|
"value": 2,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "Pending"
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "reason",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "raw_string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "word"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"shellspec_skip_statement": {
|
|
"type": "PREC_RIGHT",
|
|
"value": 2,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "Skip"
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "reason",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "raw_string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "word"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"shellspec_text_directive": {
|
|
"type": "PREC_RIGHT",
|
|
"value": 5,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "%text"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "%text:raw"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "%text:expand"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "|"
|
|
},
|
|
{
|
|
"type": "REPEAT1",
|
|
"content": {
|
|
"type": "FIELD",
|
|
"name": "filter",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "raw_string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "word"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "REPEAT1",
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "#|"
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "data_line",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "shellspec_data_line_content"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"shellspec_data_line_content": {
|
|
"type": "PATTERN",
|
|
"value": "[^\\n]*"
|
|
},
|
|
"shellspec_const_directive": {
|
|
"type": "PREC_RIGHT",
|
|
"value": 2,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "%const"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "%"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "name",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "word"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "value",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "raw_string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "word"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"shellspec_output_directive": {
|
|
"type": "PREC_RIGHT",
|
|
"value": 2,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "%puts"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "%putsn"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "%-"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "%="
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "REPEAT1",
|
|
"content": {
|
|
"type": "FIELD",
|
|
"name": "argument",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "raw_string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "word"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"shellspec_preserve_directive": {
|
|
"type": "PREC_RIGHT",
|
|
"value": 2,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "%preserve"
|
|
},
|
|
{
|
|
"type": "REPEAT1",
|
|
"content": {
|
|
"type": "FIELD",
|
|
"name": "variable",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "raw_string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "word"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"shellspec_logger_directive": {
|
|
"type": "PREC_RIGHT",
|
|
"value": 2,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "%logger"
|
|
},
|
|
{
|
|
"type": "REPEAT1",
|
|
"content": {
|
|
"type": "FIELD",
|
|
"name": "argument",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "raw_string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "word"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"extras": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "comment"
|
|
},
|
|
{
|
|
"type": "PATTERN",
|
|
"value": "\\s"
|
|
},
|
|
{
|
|
"type": "PATTERN",
|
|
"value": "\\\\\\r?\\n"
|
|
},
|
|
{
|
|
"type": "PATTERN",
|
|
"value": "\\\\( |\\t|\\v|\\f)"
|
|
}
|
|
],
|
|
"conflicts": [
|
|
[
|
|
"_expression",
|
|
"command_name"
|
|
],
|
|
[
|
|
"command",
|
|
"variable_assignments"
|
|
],
|
|
[
|
|
"redirected_statement",
|
|
"command"
|
|
],
|
|
[
|
|
"redirected_statement",
|
|
"command_substitution"
|
|
],
|
|
[
|
|
"function_definition",
|
|
"command_name"
|
|
],
|
|
[
|
|
"pipeline"
|
|
],
|
|
[
|
|
"_expression",
|
|
"command_name"
|
|
],
|
|
[
|
|
"command",
|
|
"variable_assignments"
|
|
],
|
|
[
|
|
"function_definition",
|
|
"command_name"
|
|
],
|
|
[
|
|
"command_name",
|
|
"shellspec_data_block"
|
|
],
|
|
[
|
|
"command_name",
|
|
"shellspec_hook_statement"
|
|
],
|
|
[
|
|
"shellspec_hook_block"
|
|
]
|
|
],
|
|
"precedences": [],
|
|
"externals": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "heredoc_start"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "simple_heredoc_body"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_heredoc_body_beginning"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "heredoc_content"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "heredoc_end"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "file_descriptor"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_empty_value"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_concat"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "variable_name"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "test_operator"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "regex"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_regex_no_slash"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_regex_no_space"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_expansion_word"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "extglob_pattern"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_bare_dollar"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_brace_start"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_immediate_double_hash"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_external_expansion_sym_hash"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_external_expansion_sym_bang"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_external_expansion_sym_equal"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "}"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "]"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "<<"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "<<-"
|
|
},
|
|
{
|
|
"type": "PATTERN",
|
|
"value": "\\n"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "("
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "esac"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "__error_recovery"
|
|
}
|
|
],
|
|
"inline": [
|
|
"_statement",
|
|
"_terminator",
|
|
"_literal",
|
|
"_terminated_statement",
|
|
"_primary_expression",
|
|
"_simple_variable_name",
|
|
"_multiline_variable_name",
|
|
"_special_variable_name",
|
|
"_c_word",
|
|
"_statement_not_subshell",
|
|
"_redirect"
|
|
],
|
|
"supertypes": [
|
|
"_statement",
|
|
"_expression",
|
|
"_primary_expression"
|
|
],
|
|
"reserved": {}
|
|
}
|