Code Monkey home page Code Monkey logo

imrim12 / formkl Goto Github PK

View Code? Open in Web Editor NEW
20.0 1.0 0.0 6.08 MB

Formkl (Form markup language) is an open-source DSL (Domain-Specific Language) to define and create form schema. It is designed to be simple, consistent and highly readable as natural language.

Home Page: https://formkl.org

License: MIT License

JavaScript 3.18% Vue 9.66% TypeScript 86.34% HTML 0.23% CSS 0.47% Shell 0.12%
dsl dynamic-form-builder form markup-language react vue

formkl's People

Contributors

allcontributors[bot] avatar imrim12 avatar prd-y-nguyen avatar quangtudng avatar tailtq avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

formkl's Issues

Limit maximum answer allowed

Enable for field

{
  "Something" includes {
    2 require "Email" text;
  }
}

or enable for section

{
  2 "Something" includes {
    require "Email" text;
  }
}

Single selection field

require gender from ("Male", "Female", "Other");
require select from ("Male", "Female", "Other");

Multiple selection field

require select multiple from ("Something", "Something else");
require select 2 from ("Something", "Something else", "Some other thing");

Parser contains limited information, it doesn't show error lines

Expected Behavior

The parser doesn't work as expected, it should display the lines where the error lies on. Instead, it only shows Unexpected token ... and the traceback in the library.

Failure Information (for bugs)

/Users/username/test/test.js:25
  throw err;
  ^

SyntaxError: Unexpected token: "h"
    at d.getNextToken (/Users/username/test/node_modules/formkl/dist/index.cjs:1:1968)
    at d.getNextToken (/Users/username/test/node_modules/formkl/dist/index.cjs:1:1930)
    at L._eat (/Users/username/test/node_modules/formkl/dist/index.cjs:2:8437)
    at L.StringLiteral (/Users/username/test/node_modules/formkl/dist/index.cjs:2:8008)
    at L.SectionBlock (/Users/username/test/node_modules/formkl/dist/index.cjs:2:1886)
    at L.SectionBlockList (/Users/username/test/node_modules/formkl/dist/index.cjs:2:1540)
    at L.FormBlock (/Users/username/test/node_modules/formkl/dist/index.cjs:2:1070)
    at L.parse (/Users/username/test/node_modules/formkl/dist/index.cjs:2:398)
    at Object.<anonymous> (/Users/username/test/test.js:17:22)
    at Module._compile (node:internal/modules/cjs/loader:1126:14)

Steps to Reproduce

Below is my code which I intentionally remove the character s in the "Personal Information" line:

const { Parser: FormklParser } = require('formkl');

try {
  const text = `
    formkl "Your Formkl example" "This form is generated by the formkl adapter" {
      multiple "Work Experience" has {
        require text;
      }
      "Personal Information" ha{
        text;
        multiple paragraph;
        multiple text as "something";
      }
    }
  `;
  new FormklParser().parse(text);
} catch (err) {
  throw err;
}

Context

Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.

  • Operating System: MacOS Monetery 12.6.2
  • Library version: Both 1.0.0-rc.4 and 1.0.0-rc.5

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.